Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 20:15 +0200, Lukas Wunner wrote: > > The two steps (enumeration and driver attachment) are protected by > pci_lock_rescan_remove(). Initially, when a pci_dev is newly allocated > with kzalloc(), is_added is 0. The transition from 0 to 1 happens while > under

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 20:15 +0200, Lukas Wunner wrote: > > The two steps (enumeration and driver attachment) are protected by > pci_lock_rescan_remove(). Initially, when a pci_dev is newly allocated > with kzalloc(), is_added is 0. The transition from 0 to 1 happens while > under

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 11:25 -0500, Bjorn Helgaas wrote: > On Fri, Aug 17, 2018 at 02:48:58PM +1000, Benjamin Herrenschmidt wrote: > > This re-fixes the bug reported by Hari Vyas > > after my revert of his commit but in a much simpler way. > > > > The main issues is that is_added was being set

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 11:25 -0500, Bjorn Helgaas wrote: > On Fri, Aug 17, 2018 at 02:48:58PM +1000, Benjamin Herrenschmidt wrote: > > This re-fixes the bug reported by Hari Vyas > > after my revert of his commit but in a much simpler way. > > > > The main issues is that is_added was being set

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-17 Thread Lukas Wunner
On Fri, Aug 17, 2018 at 11:25:34AM -0500, Bjorn Helgaas wrote: > The "bind driver, then set dev->added = 1" order seems to have been > there since the beginning of dev->is_added: > > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8a1bc9013a03 > > This patch seems

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-17 Thread Lukas Wunner
On Fri, Aug 17, 2018 at 11:25:34AM -0500, Bjorn Helgaas wrote: > The "bind driver, then set dev->added = 1" order seems to have been > there since the beginning of dev->is_added: > > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8a1bc9013a03 > > This patch seems

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-17 Thread Bjorn Helgaas
On Fri, Aug 17, 2018 at 02:48:58PM +1000, Benjamin Herrenschmidt wrote: > This re-fixes the bug reported by Hari Vyas > after my revert of his commit but in a much simpler way. > > The main issues is that is_added was being set after the driver > got bound and started, and thus setting it could

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-17 Thread Bjorn Helgaas
On Fri, Aug 17, 2018 at 02:48:58PM +1000, Benjamin Herrenschmidt wrote: > This re-fixes the bug reported by Hari Vyas > after my revert of his commit but in a much simpler way. > > The main issues is that is_added was being set after the driver > got bound and started, and thus setting it could

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-16 Thread Benjamin Herrenschmidt
s/device_add/device_attach .. ugh. On Fri, 2018-08-17 at 14:48 +1000, Benjamin Herrenschmidt wrote: > This re-fixes the bug reported by Hari Vyas > after my revert of his commit but in a much simpler way. > > The main issues is that is_added was being set after the driver > got bound and

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-16 Thread Benjamin Herrenschmidt
s/device_add/device_attach .. ugh. On Fri, 2018-08-17 at 14:48 +1000, Benjamin Herrenschmidt wrote: > This re-fixes the bug reported by Hari Vyas > after my revert of his commit but in a much simpler way. > > The main issues is that is_added was being set after the driver > got bound and