From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: phasta@kernel.org
Cc: Simon Richter <Simon.Richter@hogyros.de>,
Shawn Lin <shawn.lin@rock-chips.com>,
Bjorn Helgaas <bhelgaas@google.com>,
"Vaibhaav Ram T . L" <vaibhaavram.tl@microchip.com>,
Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>,
Even Xu <even.xu@intel.com>, Xinpeng Sun <xinpeng.sun@intel.com>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Jiri Kosina <jikos@kernel.org>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Zhou Wang <wangzhou1@hisilicon.com>,
Longfang Liu <liulongfang@huawei.com>,
Vinod Koul <vkoul@kernel.org>, Lee Jones <lee@kernel.org>,
Jijie Shao <shaojijie@huawei.com>,
Jian Shen <shenjian15@huawei.com>,
Sunil Goutham <sgoutham@marvell.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Jeff Hugo <jeff.hugo@oss.qualcomm.com>,
Oded Gabbay <ogabbay@kernel.org>,
Maciej Falkowski <maciej.falkowski@linux.intel.com>,
Karol Wachowski <karol.wachowski@linux.intel.com>,
Min Ma <mamin506@gmail.com>, Lizhi Hou <lizhi.hou@amd.com>,
Andreas Noever <andreas.noever@gmail.com>,
Mika Westerberg <westeri@kernel.org>,
Tomasz Jeznach <tjeznach@rivosinc.com>,
Will Deacon <will@kernel.org>,
Xinliang Liu <xinliang.liu@linaro.org>,
Tian Tao <tiantao6@hisilicon.com>,
Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Srujana Challa <schalla@marvell.com>,
Bharat Bhushan <bbhushan2@marvell.com>,
Antoine Tenart <atenart@kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
Raag Jadav <raag.jadav@intel.com>,
Hans de Goede <hansg@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Andy Shevchenko <andy@kernel.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Andi Shyti <andi.shyti@kernel.org>,
Robert Richter <rric@kernel.org>, Mark Brown <broonie@kernel.org>,
Nirmal Patel <nirmal.patel@linux.intel.com>,
Kurt Schwemmer <kurt.schwemmer@microsemi.com>,
Logan Gunthorpe <logang@deltatee.com>,
Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Bingbu Cao <bingbu.cao@intel.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
Benjamin Tissoires <bentiss@kernel.org>,
linux-input@vger.kernel.org, linux-i3c@lists.infradead.org,
dmaengine@vger.kernel.org, netdev@vger.kernel.org,
nic_swsd@realtek.com, linux-arm-msm@vger.kernel.org,
dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org,
iommu@lists.linux.dev, linux-riscv@lists.infradead.org,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
linux-cxl@vger.kernel.org, linux-crypto@vger.kernel.org,
platform-driver-x86@vger.kernel.org,
linux-serial@vger.kernel.org, mhi@lists.linux.dev,
Jan Dabros <jsd@semihalf.com>,
linux-i2c@vger.kernel.org, Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
linux-spi@vger.kernel.org,
Jonathan Derrick <jonathan.derrick@linux.dev>,
linux-pci@vger.kernel.org, linux-gpio@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-mmc@vger.kernel.org
Subject: Re: [PATCH 0/37] PCI/MSI: Enforce explicit IRQ vector management by removing devres auto-free
Date: Tue, 24 Feb 2026 11:12:15 +0200 [thread overview]
Message-ID: <aZ1rb8zoqmQmakDP@smile.fi.intel.com> (raw)
In-Reply-To: <7ca512d133f7a3bcfe00e9b0b2af5fe5f147ad77.camel@mailbox.org>
On Tue, Feb 24, 2026 at 08:39:43AM +0100, Philipp Stanner wrote:
> On Tue, 2026-02-24 at 13:14 +0900, Simon Richter wrote:
> > On 2/24/26 12:29 AM, Shawn Lin wrote:
> > > When such a driver also uses `pcim_enable_device()`, the devres framework may
> > > attempt to free the IRQ vectors a second time upon device release, leading to
> > > a double-free. Analysis of the tree shows this hazardous pattern exists widely,
> > > while 35 other drivers correctly rely solely on the implicit cleanup.
> >
> > Would it make sense to have a function pcim_free_irq_vectors(), to allow
> > explicit freeing even if the device is otherwise managed, analogous to
> > pcim_iounmap()?
>
> We used to add those. In part because it is easier to port old users.
>
> Nowadays I tend to think that those APIs were more on the too-complex
> than too-simple side for a long time. As an expert or as the API
> designer you wouldn't expect it, but there are actually far too many
> users who came to believe they always have to use pcim_iounmap() and
> counter parts.
>
> If I could design it from scratch I would probably try to tell users to
> use the unmanaged versions instead of revoking the devres consequence.
+many.
> Devres is actually about your consequence always happening whenever the
> driver unloads, for whatever reason.
I believe you meant "unbinds". The device<-->driver link can be broken
without unloading the driver.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-02-24 9:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 15:29 [PATCH 0/37] PCI/MSI: Enforce explicit IRQ vector management by removing devres auto-free Shawn Lin
2026-02-23 15:29 ` [PATCH 01/37] PCI/MSI: Add Devres managed IRQ vectors allocation Shawn Lin
2026-02-24 0:04 ` Jakub Kicinski
2026-02-24 2:08 ` Shawn Lin
2026-02-24 7:47 ` Philipp Stanner
2026-02-24 8:21 ` Shawn Lin
2026-02-24 8:32 ` Philipp Stanner
2026-02-24 16:20 ` Jonathan Cameron
2026-02-23 15:29 ` [PATCH 37/37] PCI/MSI: Only check is_msi_managed in pcim_setup_msi_release() Shawn Lin
2026-02-23 15:50 ` [PATCH 0/37] PCI/MSI: Enforce explicit IRQ vector management by removing devres auto-free Andy Shevchenko
2026-02-23 16:09 ` Shawn Lin
2026-02-23 17:38 ` Andy Shevchenko
2026-02-24 2:29 ` Shawn Lin
2026-02-23 15:56 ` [PATCH 26/37] net: stmmac: Replace pci_alloc_irq_vectors() with pcim_alloc_irq_vectors() Shawn Lin
2026-02-23 15:56 ` [PATCH 27/37] r8169: " Shawn Lin
2026-02-23 15:57 ` [PATCH 28/37] net: thunder_bgx: " Shawn Lin
2026-02-23 15:57 ` [PATCH 29/37] net: hibmcge: " Shawn Lin
2026-02-24 4:14 ` [PATCH 0/37] PCI/MSI: Enforce explicit IRQ vector management by removing devres auto-free Simon Richter
2026-02-24 7:39 ` Philipp Stanner
2026-02-24 9:12 ` Andy Shevchenko [this message]
2026-02-24 10:30 ` Philipp Stanner
2026-02-24 10:39 ` Andy Shevchenko
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=aZ1rb8zoqmQmakDP@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=Simon.Richter@hogyros.de \
--cc=airlied@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andi.shyti@kernel.org \
--cc=andreas.noever@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=andy@kernel.org \
--cc=arnd@arndb.de \
--cc=atenart@kernel.org \
--cc=bbhushan2@marvell.com \
--cc=bentiss@kernel.org \
--cc=bhelgaas@google.com \
--cc=bingbu.cao@intel.com \
--cc=brgl@kernel.org \
--cc=broonie@kernel.org \
--cc=daniel@zonque.org \
--cc=dave@stgolabs.net \
--cc=davem@davemloft.net \
--cc=dmaengine@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=even.xu@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=haojian.zhuang@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=hkallweit1@gmail.com \
--cc=iommu@lists.linux.dev \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=jikos@kernel.org \
--cc=jirislaby@kernel.org \
--cc=jonathan.cameron@huawei.com \
--cc=jonathan.derrick@linux.dev \
--cc=jsd@semihalf.com \
--cc=karol.wachowski@linux.intel.com \
--cc=kumaravel.thiagarajan@microchip.com \
--cc=kurt.schwemmer@microsemi.com \
--cc=lee@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=liulongfang@huawei.com \
--cc=lizhi.hou@amd.com \
--cc=logang@deltatee.com \
--cc=maciej.falkowski@linux.intel.com \
--cc=mamin506@gmail.com \
--cc=mani@kernel.org \
--cc=mchehab@kernel.org \
--cc=mhi@lists.linux.dev \
--cc=mika.westerberg@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
--cc=nirmal.patel@linux.intel.com \
--cc=ogabbay@kernel.org \
--cc=phasta@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=raag.jadav@intel.com \
--cc=rric@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=schalla@marvell.com \
--cc=sgoutham@marvell.com \
--cc=shaojijie@huawei.com \
--cc=shawn.lin@rock-chips.com \
--cc=shenjian15@huawei.com \
--cc=simona@ffwll.ch \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=tiantao6@hisilicon.com \
--cc=tjeznach@rivosinc.com \
--cc=ulf.hansson@linaro.org \
--cc=vaibhaavram.tl@microchip.com \
--cc=vkoul@kernel.org \
--cc=wangzhou1@hisilicon.com \
--cc=westeri@kernel.org \
--cc=will@kernel.org \
--cc=xinliang.liu@linaro.org \
--cc=xinpeng.sun@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