Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-31 Thread Michael Ellerman
Bjorn Helgaas writes: > On Thu, Jul 19, 2018 at 02:18:09PM +1000, Benjamin Herrenschmidt wrote: >> On Wed, 2018-07-18 at 18:29 -0500, Bjorn Helgaas wrote: >> > [+cc Paul, Michael, linuxppc-dev] >> > >> >>/... >> >> > > Debugging revealed a race condition between pcie core driver >> > >

Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-27 Thread Benjamin Herrenschmidt
On Fri, 2018-07-27 at 17:25 -0500, Bjorn Helgaas wrote: > > As for the powerpc bits, I'm probably the one who wrote them, however, > > I'm on vacation this week and right now, no bandwidth to context switch > > all that back in :-) So give me a few days and/or ping me next week. > > OK, here's a

Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-27 Thread Bjorn Helgaas
On Thu, Jul 19, 2018 at 02:18:09PM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2018-07-18 at 18:29 -0500, Bjorn Helgaas wrote: > > [+cc Paul, Michael, linuxppc-dev] > > > >/... > > > > Debugging revealed a race condition between pcie core driver > > > enabling is_added

Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-19 Thread Benjamin Herrenschmidt
On Thu, 2018-07-19 at 20:55 +0200, Lukas Wunner wrote: > On Thu, Jul 19, 2018 at 9:48 AM, Benjamin Herrenschmidt > > Indeed. However I'm not fan of the solution. Shouldn't we instead have > > some locking for the content of pci_dev? I've always been wary of us > > having other similar races in

Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-19 Thread Hari Vyas
Hi Bjonr, Ben On Thu, Jul 19, 2018 at 9:48 AM, Benjamin Herrenschmidt wrote: > On Wed, 2018-07-18 at 18:29 -0500, Bjorn Helgaas wrote: >> [+cc Paul, Michael, linuxppc-dev] >> > >/... > >> > Debugging revealed a race condition between pcie core driver >> > enabling is_added

Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-18 Thread Benjamin Herrenschmidt
On Wed, 2018-07-18 at 18:29 -0500, Bjorn Helgaas wrote: > [+cc Paul, Michael, linuxppc-dev] > /... > > Debugging revealed a race condition between pcie core driver > > enabling is_added bit(pci_bus_add_device()) and nvme driver > > reset work-queue enabling is_busmaster bit (by

Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-18 Thread Bjorn Helgaas
[+cc Paul, Michael, linuxppc-dev] On Tue, Jul 03, 2018 at 02:35:41PM +0530, Hari Vyas wrote: > When a pci device is detected, a variable is_added is set to > 1 in pci device structure and proc, sys entries are created. > > When a pci device is removed, first is_added is checked for one > and