linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] pci: Rework is_added race fix and address bridge enable races
@ 2018-08-17  4:48 Benjamin Herrenschmidt
  2018-08-17  4:48 ` [RFC PATCH 1/6] Revert "PCI: Fix is_added/is_busmaster race condition" Benjamin Herrenschmidt
                   ` (6 more replies)
  0 siblings, 7 replies; 30+ messages in thread
From: Benjamin Herrenschmidt @ 2018-08-17  4:48 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci
  Cc: Hari Vyas, Ray Jui, Srinath Mannam, Guenter Roeck, Jens Axboe,
	Lukas Wunner, Konstantin Khlebnikov, Marta Rybczynska,
	Pierre-Yves Kerbrat, linux-kernel

This is really two series but since they conflict a bit separately
here they are in one:

First we undo the mess of those atomic priv_flags. The atomicity
doesn't provide any security since there's no locking against
the other state pertaining to those flags, it only protects the
flags themselves.

The is_added mess is fixed much more simply by moving the assignment
of the flag to before we start the driver. This is in line with the
rest of the PCI code: until bound to the device model, we are essentially
assuming a single threaded environment. is_added is a flag that is
logically owned by that part of the PCI code, and thus should be set
and cleared within that "safer" environment.

This removes the horrid relative includes in the powerpc code as well.

The second part aims at fixing the enable/disable/set_master races,
and does so by providing a framework for future device state locking
issues.

It introduces a pci_dev->state_mutex which is used at a lower level
than the device_lock (the device lock isn't suitable, as explained
in the cset comments) and uses it to protect enablement and set_master.



^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2018-08-20 11:43 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-17  4:48 [RFC PATCH 0/6] pci: Rework is_added race fix and address bridge enable races Benjamin Herrenschmidt
2018-08-17  4:48 ` [RFC PATCH 1/6] Revert "PCI: Fix is_added/is_busmaster race condition" Benjamin Herrenschmidt
2018-08-17  4:57   ` Benjamin Herrenschmidt
2018-08-17 15:44   ` Bjorn Helgaas
2018-08-18  3:24     ` Benjamin Herrenschmidt
2018-08-19  2:24       ` Bjorn Helgaas
2018-08-20  2:10         ` Benjamin Herrenschmidt
2018-08-20  6:25           ` Hari Vyas
2018-08-20 11:09             ` Benjamin Herrenschmidt
2018-08-20 11:43               ` Hari Vyas
2018-08-20  7:17           ` Lukas Wunner
2018-08-20 11:12             ` Benjamin Herrenschmidt
2018-08-17  4:48 ` [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add Benjamin Herrenschmidt
2018-08-17  4:57   ` Benjamin Herrenschmidt
2018-08-17 16:25   ` Bjorn Helgaas
2018-08-17 18:15     ` Lukas Wunner
2018-08-18  3:41       ` Benjamin Herrenschmidt
2018-08-18  3:28     ` Benjamin Herrenschmidt
2018-08-17  4:48 ` [RFC PATCH 3/6] pci: Remove priv_flags and use dev->error_state for "disconnected" status Benjamin Herrenschmidt
2018-08-17  5:13   ` [RFC PATCH v2 " Benjamin Herrenschmidt
2018-08-17  4:49 ` [RFC PATCH 4/6] pci: Add a mutex to pci_dev to protect device state Benjamin Herrenschmidt
2018-08-17  4:49 ` [RFC PATCH 5/6] pci: Protect the enable/disable state of pci_dev using the state mutex Benjamin Herrenschmidt
2018-08-17  8:09   ` Marta Rybczynska
2018-08-17  8:30     ` Benjamin Herrenschmidt
2018-08-17  9:00       ` Hari Vyas
2018-08-17  9:39         ` Benjamin Herrenschmidt
2018-08-17 10:10           ` Hari Vyas
2018-08-17 10:24             ` Benjamin Herrenschmidt
2018-08-17  4:49 ` [RFC PATCH 6/6] pci: Protect is_busmaster using the state lock Benjamin Herrenschmidt
2018-08-17  5:03 ` [RFC PATCH 0/6] pci: Rework is_added race fix and address bridge enable races Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).