]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto/ccp: Use PCI bridge defaults for IDE
authorAlexey Kardashevskiy <aik@amd.com>
Fri, 23 Jan 2026 05:30:56 +0000 (16:30 +1100)
committerDan Williams <dan.j.williams@intel.com>
Fri, 30 Jan 2026 22:27:03 +0000 (14:27 -0800)
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: 4be423572da1 ("crypto/ccp: Implement SEV-TIO PCIe IDE (phase1)")
Signed-off-by: Alexey Kardashevskiy <aik@amd.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://patch.msgid.link/20260123053057.1350569-2-aik@amd.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/crypto/ccp/sev-dev-tsm.c

index ea29cd5d0ff9fa9a02cbf0414a9b830ff7c90928..7407b77c2ef279fe349e09f485600e5557125f09 100644 (file)
 
 MODULE_IMPORT_NS("PCI_IDE");
 
-#define TIO_DEFAULT_NR_IDE_STREAMS     1
-
-static uint nr_ide_streams = TIO_DEFAULT_NR_IDE_STREAMS;
-module_param_named(ide_nr, nr_ide_streams, uint, 0644);
-MODULE_PARM_DESC(ide_nr, "Set the maximum number of IDE streams per PHB");
-
 #define dev_to_sp(dev)         ((struct sp_device *)dev_get_drvdata(dev))
 #define dev_to_psp(dev)                ((struct psp_device *)(dev_to_sp(dev)->psp_data))
 #define dev_to_sev(dev)                ((struct sev_device *)(dev_to_psp(dev)->sev_data))
@@ -193,7 +187,6 @@ static void streams_teardown(struct pci_ide **ide)
 static int stream_alloc(struct pci_dev *pdev, struct pci_ide **ide,
                        unsigned int tc)
 {
-       struct pci_dev *rp = pcie_find_root_port(pdev);
        struct pci_ide *ide1;
 
        if (ide[tc]) {
@@ -201,11 +194,6 @@ static int stream_alloc(struct pci_dev *pdev, struct pci_ide **ide,
                return -EBUSY;
        }
 
-       /* FIXME: find a better way */
-       if (nr_ide_streams != TIO_DEFAULT_NR_IDE_STREAMS)
-               pci_notice(pdev, "Enable non-default %d streams", nr_ide_streams);
-       pci_ide_set_nr_streams(to_pci_host_bridge(rp->bus->bridge), nr_ide_streams);
-
        ide1 = pci_ide_stream_alloc(pdev);
        if (!ide1)
                return -EFAULT;