Thread (6 messages) flat view 6 messages, 3 authors, 2018-06-12

Re: [PATCH] pci/shpchp: no claim on pcie port device

From: Christoph Hellwig <hch@infradead.org>
Date: 2018-06-12 07:29:29
Also in: linux-pci

On Tue, Jun 12, 2018 at 02:42:13PM +0800, Pingfan Liu wrote:
The Linux Device Driver Model allows a physical device to be handled
by only a single driver. But at present, both shpchp and portdrv_pci
claim PCI_CLASS_BRIDGE_PCI, and touch devices_kset. This causes a
few problems, one is the wrong shutdown seq of devices, owing to the
broken devices_kset.
How can they both touch devices_kset?  Once one driver has claimed the
device it should not be available to others.
+	/* do not claim pcie port device */
+	if (pci_is_pcie(dev) &&
+	    ((pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) ||
+	     (pci_pcie_type(dev) == PCI_EXP_TYPE_UPSTREAM) ||
+	     (pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM)))
+		return -ENODEV;
No need for the inner braces.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help