Some processors contain multiple CCPs with differing device IDs. Enable
the selection of specific devices based on ID. The parameter value is
a single PCI ID.

Signed-off-by: Gary R Hook <gary.h...@amd.com>
---
 drivers/crypto/ccp/sp-pci.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c
index 29177d113c90..b024b92fb749 100644
--- a/drivers/crypto/ccp/sp-pci.c
+++ b/drivers/crypto/ccp/sp-pci.c
@@ -36,6 +36,9 @@
 /*
  * Limit CCP use to a specifed number of queues per device.
  */
+static unsigned int pcidev;
+module_param(pcidev, uint, 0444);
+MODULE_PARM_DESC(pcidev, "Device number for a specific CCP");
 
 static struct mutex devcount_mutex ____cacheline_aligned;
 static unsigned int devcount = 0;
@@ -204,6 +207,10 @@ static int sp_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
        if (maxdev && (devcount >= maxdev)) /* Too many devices? */
                return 0;
 
+       /* If a specific device ID has been specified, filter for it */
+        if (pcidev && (pdev->device != pcidev))
+                        return 0;
+
        ret = -ENOMEM;
        sp = sp_alloc_struct(dev);
        if (!sp)

Reply via email to