Skip to content

Commit 403dd7d

Browse files
aikdjbw
authored andcommitted
crypto/ccp: Use PCI bridge defaults for IDE
The current number of streams in AMD TSM is 1 which is too little, the core uses 255. Also, even if the module parameter is increased, calling pci_ide_set_nr_streams() second time triggers WARN_ON. Simplify the code by sticking to the PCI core defaults. Fixes: 4be4235 ("crypto/ccp: Implement SEV-TIO PCIe IDE (phase1)") Signed-off-by: Alexey Kardashevskiy <[email protected]> Acked-by: Tom Lendacky <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 894148a commit 403dd7d

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

drivers/crypto/ccp/sev-dev-tsm.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919

2020
MODULE_IMPORT_NS("PCI_IDE");
2121

22-
#define TIO_DEFAULT_NR_IDE_STREAMS 1
23-
24-
static uint nr_ide_streams = TIO_DEFAULT_NR_IDE_STREAMS;
25-
module_param_named(ide_nr, nr_ide_streams, uint, 0644);
26-
MODULE_PARM_DESC(ide_nr, "Set the maximum number of IDE streams per PHB");
27-
2822
#define dev_to_sp(dev) ((struct sp_device *)dev_get_drvdata(dev))
2923
#define dev_to_psp(dev) ((struct psp_device *)(dev_to_sp(dev)->psp_data))
3024
#define dev_to_sev(dev) ((struct sev_device *)(dev_to_psp(dev)->sev_data))
@@ -193,19 +187,13 @@ static void streams_teardown(struct pci_ide **ide)
193187
static int stream_alloc(struct pci_dev *pdev, struct pci_ide **ide,
194188
unsigned int tc)
195189
{
196-
struct pci_dev *rp = pcie_find_root_port(pdev);
197190
struct pci_ide *ide1;
198191

199192
if (ide[tc]) {
200193
pci_err(pdev, "Stream for class=%d already registered", tc);
201194
return -EBUSY;
202195
}
203196

204-
/* FIXME: find a better way */
205-
if (nr_ide_streams != TIO_DEFAULT_NR_IDE_STREAMS)
206-
pci_notice(pdev, "Enable non-default %d streams", nr_ide_streams);
207-
pci_ide_set_nr_streams(to_pci_host_bridge(rp->bus->bridge), nr_ide_streams);
208-
209197
ide1 = pci_ide_stream_alloc(pdev);
210198
if (!ide1)
211199
return -EFAULT;

0 commit comments

Comments
 (0)