Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Bjorn Helgaas
Tue, 01 Dec 2026 20:36
Re: [PATCH net] net: wwan: t7xx: Do not call pcim_enable_device() on every reinit
Author: Bjorn Helgaas
Date: Tue, 01 Dec 2026 20:36
Date: Tue, 01 Dec 2026 20:36
40 lines
10333 bytes
10333 bytes
On Tue, Dec 01, 2026 at 10:45:31AM +0100, pstanner@redhat.com wrote:
> On Mon, 2026-11-30 at 18:02 -0600, Bjorn Helgaas wrote:
> > On Tue, Dec 01, 2026 at 02:56:31AM +0400, Arina Kharlamova wrote:
> > > t7xx_pcie_reinit() runs on resume from L2 or L3 and on every reprobe
> > > after a modem reset. It calls pcim_enable_device(), which did nothing
> > > for an already enabled managed device until commit 77f79ac8de0f
> > > ("PCI: Remove struct pci_devres.enabled status bit"). Since then each
> > > call raises the enable count. Since commit f748a07a0b64 ("PCI: Remove
> > > legacy pcim_release()") each call also registers a new
> > > pcim_disable_device() devres action, and the actions pile up until the
> > > device is unbound.
> > >
> > > The device is enabled once in t7xx_pci_probe() and the driver never
> > > disables it, so drop the call from the reinit path.
> >
> > This and the loongson/lsdc issue
> > (https://lore.kernel.org/all/20261201-s2p-d60-v1-1-d88cf22132ab@mbzuai.ac.ae)
> > seem like basically the same issue, so I wonder if the pcim API could
> > be improved to avoid it. It seems a bit subtle and like something
> > driver authors are likely to trip over.
>
> I don't think that the APIs behavior should be guarded with more checks
> (like "already enabled" checks). In the past, first the managed API was
> added, and then (for unknown reasons) counter APIs were added to revoke
> the managed actions. Look at pcim_pin_device(). IMO that makes the API
> more convoluted, inconsistent and even harder to understand.
>
> But it's true that drivers often don't seem to understand what a
> managed interface is, proven by the fact that many of them also called
> pcim_disable_device() in their remove(), which leads the entire design
> ad absurdum.
>
> I think what we can is to document more explicitly what functions you
> could use when and for what purpose. Especially, we should deprecate
> pcim_disable_device(), pcim_iounmap() et al.
I wonder if sashiko could be taught to look for this issue, e.g.,
maybe something in
https://github.com/sashiko-dev/sashiko/blob/main/projects/linux/prompts/maintainers/pci.md?
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads