From: Bjorn Helgaas <helgaas@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "Devegowda, Chandrashekar" <chandrashekar.devegowda@intel.com>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
"linux-bluetooth@vger.kernel.org"
<linux-bluetooth@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"Srivatsa, Ravishankar" <ravishankar.srivatsa@intel.com>,
"Tumkur Narayan, Chethan" <chethan.tumkur.narayan@intel.com>,
"K, Kiran" <kiran.k@intel.com>,
"Ben Ami, Golan" <golan.ben.ami@intel.com>
Subject: Re: [PATCH v1] Bluetooth: btintel_pcie: Support function level reset
Date: Tue, 28 Oct 2025 16:06:40 -0500 [thread overview]
Message-ID: <20251028210640.GA1529794@bhelgaas> (raw)
In-Reply-To: <7acf9a2f2cec5d00fc1581ad3a12b1f4b580b349.camel@sipsolutions.net>
On Mon, Oct 27, 2025 at 11:08:22AM +0100, Johannes Berg wrote:
> Hi,
>
> So I've been asked to chime in here, mostly on behalf of iwlwifi, and
> I'll actually respond to two of your messages a bit.
>
> (from your previous email first:)
>
> > Sort of weird that the commit log mentions FLR, but it's not mentioned
> > in the patch itself except for BTINTEL_PCIE_FLR_RESET_MAX_RETRY.
> > Apparently the assumption is that DSM_SET_RESET_METHOD_PCIE performs
> > an FLR.
>
> It's not just weird, it's simply wrong. This is not about FLR at all.
Thanks for clearing that up.
> > If you reset the device, you know the state of the device afterward,
> > and the driver should be able to initialize its own data structures
> > accordingly. This should not require any PCI device removal or
> > rescan.
>
> Obviously, we know the state of the device, but ... it _does_ require
> PCI removal *and* rescan, because the device completely falls off the
> bus and needs to be rediscovered. The drivers also fundamentally have to
> be unbound from it, since all state of the device (including BAR setup)
> is lost. I'm fairly certain that if you were to query even the device
> IDs after the reset, you'd see 0xFFFFFFFF, but in truth I don't fully
> understand how this works at the PCIe bus level.
It might be different for other buses, but the PCI core really doesn't
do anything to the device during removal or rescan. It does turn off
power management interrupts from the device and the like, but I'm
pretty sure it doesn't reset the device or do anything to make it
start responding to PCI transactions again.
Obviously remove and rescan reinitializes the *driver* because the PCI
core calls the driver .remove() method, reads the Vendor and Device
IDs, reads and if necessary programs the BARs, and calls the driver
.probe() method.
I think it's really the PLDR that's making the difference here, not
the remove and rescan. I guess you could experimentally read some
config registers after the PLDR and before the remove/rescan.
Since you know the other device is dead already, I don't have a
problem with resetting the shared parts of the device, so you do need
some way to poke the other driver to reinit. But I think using the
PCI core remove/rescan to do that makes it more complicated than
necessary and distracts from what's really happening.
Bjorn
next prev parent reply other threads:[~2025-10-28 21:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-14 10:16 [PATCH v1] Bluetooth: btintel_pcie: Support function level reset Chandrashekar Devegowda
2025-03-14 7:32 ` [v1] " bluez.test.bot
2025-03-14 19:40 ` [PATCH v1] " Bjorn Helgaas
2025-03-18 14:55 ` Luiz Augusto von Dentz
2025-03-18 15:47 ` Bjorn Helgaas
2025-05-25 10:30 ` K, Kiran
2025-10-23 9:42 ` Devegowda, Chandrashekar
2025-10-23 20:36 ` Bjorn Helgaas
2025-10-27 10:08 ` Johannes Berg
2025-10-28 21:06 ` Bjorn Helgaas [this message]
2025-10-29 10:38 ` Johannes Berg
2025-10-29 16:26 ` Bjorn Helgaas
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=20251028210640.GA1529794@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=chandrashekar.devegowda@intel.com \
--cc=chethan.tumkur.narayan@intel.com \
--cc=golan.ben.ami@intel.com \
--cc=johannes@sipsolutions.net \
--cc=kiran.k@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=ravishankar.srivatsa@intel.com \
/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