Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Nirmal Patel <nirmal.patel@linux.intel.com>
To: sashiko-bot@kernel.org
Cc: sashiko-reviews@lists.linux.dev, linux-pci@vger.kernel.org
Subject: Re: [PATCH v6] PCI: vmd: Add feature to scan BIOS enumerated devices.
Date: Mon, 29 Jun 2026 09:39:50 -0700	[thread overview]
Message-ID: <20260629093950.00006c85@linux.intel.com> (raw)
In-Reply-To: <20260623012058.D9C2C1F000E9@smtp.kernel.org>

On Tue, 23 Jun 2026 01:20:58 +0000
sashiko-bot@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider:
> - [Medium] The IRQ domain and its associated fwnode are permanently
> leaked for devices with VMD_FEAT_USE_BIOS_INFO due to an
> unconditional early return in vmd_remove_irq_domain(). --
> 
> commit 0711c95d550249c54951b1f20ee8a7fe26dafc0b
> Author: Nirmal Patel <nirmal.patel@linux.intel.com>
> 
> PCI: vmd: Add feature to scan BIOS enumerated devices.
> 
> This commit adds support for newer VMD hardware (like device ID
> 0x28c1) by using BIOS-configured shadow registers and bus ranges
> instead of manually configuring them.
> 
> > diff --git a/drivers/pci/controller/vmd.c
> > b/drivers/pci/controller/vmd.c --- a/drivers/pci/controller/vmd.c
> > +++ b/drivers/pci/controller/vmd.c
> > @@ -374,6 +393,9 @@ static void vmd_set_msi_remapping(struct
> > vmd_dev *vmd, bool enable) 
> >  static void vmd_remove_irq_domain(struct vmd_dev *vmd)
> >  {
> > +	if (!!(vmd->features & VMD_FEAT_USE_BIOS_INFO))
> > +		return;
> > +  
> 
> [Severity: Medium]
> Does this early return cause an IRQ domain and fwnode resource leak?
> 
> When a VMD device like 0x28c1 (which has VMD_FEAT_USE_BIOS_INFO) is
> probed, vmd_enable_domain() can conditionally create an IRQ domain if
> running under Xen or if the BIOS-configured shadow registers
> offset[0] or offset[1] are non-zero.
> 
> If the driver is unloaded or fails later in the probe process, this
> return causes the function to exit immediately before calling
> irq_domain_remove() and irq_domain_free_fwnode(). Should the IRQ
> domain teardown still execute even if VMD_FEAT_USE_BIOS_INFO is set?
> 
Fair point. xen can cause irq domain deletion failure. Let me remove
the return statement from vmd_remove_irq_domain.

      reply	other threads:[~2026-06-29 16:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23  1:13 [PATCH v6] PCI: vmd: Add feature to scan BIOS enumerated devices Nirmal Patel
2026-06-23  1:20 ` sashiko-bot
2026-06-29 16:39   ` Nirmal Patel [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=20260629093950.00006c85@linux.intel.com \
    --to=nirmal.patel@linux.intel.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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