diff options
| author | Pawel Laszczak <[email protected]> | 2023-03-08 12:44:27 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2023-03-16 11:43:42 +0000 |
| commit | 1272fd652a226ccb34e9f47371b6121948048438 (patch) | |
| tree | 3c0f9b600f08228baf2b7c107fe3815e53334304 /drivers/usb/cdns3/cdns3-pci-wrap.c | |
| parent | usb: cdnsp: Fixes issue with redundant Status Stage (diff) | |
| download | kernel-1272fd652a226ccb34e9f47371b6121948048438.tar.gz kernel-1272fd652a226ccb34e9f47371b6121948048438.zip | |
usb: cdns3: Fix issue with using incorrect PCI device function
PCI based platform can have more than two PCI functions.
USBSS PCI Glue driver during initialization should
consider only DRD/HOST/DEVICE PCI functions and
all other should be ignored. This patch adds additional
condition which causes that only DRD and HOST/DEVICE
function will be accepted.
cc: <[email protected]>
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Signed-off-by: Pawel Laszczak <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-pci-wrap.c')
| -rw-r--r-- | drivers/usb/cdns3/cdns3-pci-wrap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/cdns3/cdns3-pci-wrap.c b/drivers/usb/cdns3/cdns3-pci-wrap.c index deeea618ba33..1f6320d98a76 100644 --- a/drivers/usb/cdns3/cdns3-pci-wrap.c +++ b/drivers/usb/cdns3/cdns3-pci-wrap.c @@ -60,6 +60,11 @@ static struct pci_dev *cdns3_get_second_fun(struct pci_dev *pdev) return NULL; } + if (func->devfn != PCI_DEV_FN_HOST_DEVICE && + func->devfn != PCI_DEV_FN_OTG) { + return NULL; + } + return func; } |
