PCI: designware-ep: Fix ->get_msi() to check MSI_EN bit
authorKishon Vijay Abraham I <kishon@ti.com>
Tue, 19 Dec 2017 09:55:41 +0000 (15:25 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:01:26 +0000 (11:01 +0100)
commit194b5ce11968127090e6a5fd4f09229a9e52d98c
tree5204ddeffa0d1b1f91cbf06def392b8953f2e2a2
parentd67d7bf8f12d1b9dcbd4a6d6b9cd086e9d87059a
PCI: designware-ep: Fix ->get_msi() to check MSI_EN bit

[ Upstream commit a134a457ed985dca8cce7ac4ea66129ea70eba73 ]

->get_msi() now checks MSI_EN bit in the MSI CAPABILITY register to
find whether the host supports MSI instead of using the
MSI ADDRESS in the MSI CAPABILITY register.

This fixes the issue with the following sequence
  'modprobe pci_endpoint_test' enables MSI
  'rmmod pci_endpoint_test' disables MSI but MSI address (in EP's
capability register) has a valid value
  'modprobe pci_endpoint_test no_msi=1' - Since MSI address (in EP's
capability register) has a valid value (set during the previous
insertion of the module), EP thinks host supports MSI.

Fixes: f8aed6ec624f ("PCI: dwc: designware: Add EP mode support")
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/dwc/pcie-designware-ep.c
drivers/pci/dwc/pcie-designware.h