[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] PCI: Replace pci_dev->is_busmaster with accessors
- To: Maurice Hieronymus <mhi@xxxxxxxxxxx>
- From: Lukas Wunner <lukas@xxxxxxxxx>
- Date: Sun, 12 Jul 2026 16:28:18 +0200
- Authentication-results: eu.smtp.expurgate.cloud; none
- Cc: Edward Cree <ecree.xilinx@xxxxxxxxx>, Andrew Lunn <andrew+netdev@xxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Eric Dumazet <edumazet@xxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Paolo Abeni <pabeni@xxxxxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, Justin Tee <justin.tee@xxxxxxxxxxxx>, Paul Ely <paul.ely@xxxxxxxxxxxx>, "James E.J. Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Miguel Ojeda <ojeda@xxxxxxxxxx>, Boqun Feng <boqun@xxxxxxxxxx>, Gary Guo <gary@xxxxxxxxxxx>, Björn Roy Baron <bjorn3_gh@xxxxxxxxxxxxxx>, Benno Lossin <lossin@xxxxxxxxxx>, Andreas Hindborg <a.hindborg@xxxxxxxxxx>, Alice Ryhl <aliceryhl@xxxxxxxxxx>, Trevor Gross <tmgross@xxxxxxxxx>, Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>, Tamir Duberstein <tamird@xxxxxxxxxx>, Alexandre Courbot <acourbot@xxxxxxxxxx>, Onur Özkan <work@xxxxxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Danilo Krummrich <dakr@xxxxxxxxxx>, rust-for-linux@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, linux-net-drivers@xxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-edac@xxxxxxxxxxxxxxx
- Delivery-date: Sun, 12 Jul 2026 14:28:32 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Sat, Jul 11, 2026 at 05:21:06PM +0200, Maurice Hieronymus wrote:
> `is_busmaster` is one bit of a ~60-bit C bitfield in `struct pci_dev`.
> Bits sharing a bitfield word must not be modified concurrently, but its
> writers take no common lock: `pci_set_master()` can run without the
> device lock (e.g. from runtime PM resume paths), `pci_disable_device()`
> clears the bit, and other bits in the same word are written from
> entirely different contexts, e.g. `broken_parity_status` from sysfs.
> Concurrent read-modify-write cycles of the shared word can then lose
> updates.
>
> Move `is_busmaster` into a new `flags` bitmap modified with atomic
> bitops and accessed through generated accessor functions, following the
> example of commit a7cc262a1135 ("driver core: Replace dev->offline +
> ->offline_disabled with accessors"). More bitfield flags can follow the
> same pattern later.
We already have the priv_flags member in struct pci_dev,
please use that instead of adding another one for the same purpose.
Thanks,
Lukas
|