From: "Maurice Hieronymus" <mhi@mailbox.org>
To: "Lukas Wunner" <lukas@wunner.de>, "Maurice Hieronymus" <mhi@mailbox.org>
Cc: "Edward Cree" <ecree.xilinx@gmail.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Justin Tee" <justin.tee@broadcom.com>,
"Paul Ely" <paul.ely@broadcom.com>,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
"Juergen Gross" <jgross@suse.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Oleksandr Tyshchenko" <oleksandr_tyshchenko@epam.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>,
"Borislav Petkov" <bp@alien8.de>,
"Tony Luck" <tony.luck@intel.com>,
"Danilo Krummrich" <dakr@kernel.org>,
rust-for-linux@vger.kernel.org, netdev@vger.kernel.org,
linux-net-drivers@amd.com, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org,
xen-devel@lists.xenproject.org, linux-edac@vger.kernel.org
Subject: Re: [PATCH v2] PCI: Move pci_dev->is_busmaster into priv_flags
Date: Sat, 18 Jul 2026 19:02:51 +0200 [thread overview]
Message-ID: <DK1UXXRGW737.2IVTYCHPRM9ET@mailbox.org> (raw)
In-Reply-To: <alcSjoypegNolW48@wunner.de>
On Wed Jul 15, 2026 at 6:54 AM CEST, Lukas Wunner wrote:
> pci_dev_assign_busmaster() should not have public visibility.
> Drivers should really use pci_set_master() / pci_clear_master()
> and nothing else.
>
> It seems Xen is the only one in the tree which needs this:
>
>> +++ b/drivers/xen/xen-pciback/pciback_ops.c
>> @@ -125,14 +125,14 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
>> if (pci_is_enabled(dev))
>> pci_disable_device(dev);
>>
>> - dev->is_busmaster = 0;
>> + pci_dev_assign_busmaster(dev, false);
>> } else {
>> pci_read_config_word(dev, PCI_COMMAND, &cmd);
>> if (cmd & (PCI_COMMAND_INVALIDATE)) {
>> cmd &= ~(PCI_COMMAND_INVALIDATE);
>> pci_write_config_word(dev, PCI_COMMAND, cmd);
>>
>> - dev->is_busmaster = 0;
>> + pci_dev_assign_busmaster(dev, false);
>> }
>> }
>> }
>
> Please change these direct assignments to pci_clear_master(),
> preferably in a separate patch to ease bisecting if anything
> breaks.
This conversion does not preserve behavior. The direct assignments
clear only the software flag, while pci_clear_master() also clears
PCI_COMMAND_MASTER in config space.
I am not an expert on xen devices. That's why I want to clarify first
that this does not break anything. Especially since commit
7681f31ec9cd ("xen/pciback: Don't disable PCI_COMMAND on PCI device
reset.") deliberately removed the PCI_COMMAND write right above the
first assignment, and pci_clear_master() would reintroduce a
PCI_COMMAND write there.
Best,
Maurice
prev parent reply other threads:[~2026-07-18 17:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 19:37 [PATCH v2] PCI: Move pci_dev->is_busmaster into priv_flags Maurice Hieronymus
2026-07-15 4:54 ` Lukas Wunner
2026-07-18 17:02 ` Maurice Hieronymus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DK1UXXRGW737.2IVTYCHPRM9ET@mailbox.org \
--to=mhi@mailbox.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=bhelgaas@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=bp@alien8.de \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=gary@garyguo.net \
--cc=jgross@suse.com \
--cc=justin.tee@broadcom.com \
--cc=kuba@kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net-drivers@amd.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=lukas@wunner.de \
--cc=martin.petersen@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=oleksandr_tyshchenko@epam.com \
--cc=pabeni@redhat.com \
--cc=paul.ely@broadcom.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=sstabellini@kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=tony.luck@intel.com \
--cc=work@onurozkan.dev \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox