public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linux PCI <linux-pci@vger.kernel.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bjorn Helgaas <helgaas@kernel.org>
Subject: Re: [PATCH] ACPI: PCI: Fix device reference counting in acpi_get_pci_dev()
Date: Wed, 19 Oct 2022 11:54:42 +0300	[thread overview]
Message-ID: <Y0+7Ug9Yh6J6uHVr@intel.com> (raw)
In-Reply-To: <12097002.O9o76ZdvQC@kreacher>

On Tue, Oct 18, 2022 at 07:34:03PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Commit 63f534b8bad9 ("ACPI: PCI: Rework acpi_get_pci_dev()") failed
> to reference count the device returned by acpi_get_pci_dev() as
> expected by its callers which in some cases may cause device objects
> to be dropped prematurely.
> 
> Add the missing get_device() to acpi_get_pci_dev().
> 
> Fixes: 63f534b8bad9 ("ACPI: PCI: Rework acpi_get_pci_dev()")

FYI this (and the rtc-cmos regression discussed in
https://lore.kernel.org/linux-acpi/5887691.lOV4Wx5bFT@kreacher/)
took down the entire Intel gfx CI. I've applied both fixes
into our fixup branch and things are looking much healthier
now.

This one caused i915 selftests to eat a lot of POISON_FREE
in the CI. While bisecting it locally I didn't have
poisoning enabled so I got refcount_t undeflows instead.

https://intel-gfx-ci.01.org/tree/drm-tip/index.html has a lot
of colorful boxes to click if you're interested in any of the
logs. The fixes are included in the CI_DRM_12259 build. Earlier
builds were broken.

> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/acpi/pci_root.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: linux-pm/drivers/acpi/pci_root.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/pci_root.c
> +++ linux-pm/drivers/acpi/pci_root.c
> @@ -323,6 +323,7 @@ struct pci_dev *acpi_get_pci_dev(acpi_ha
>  
>  	list_for_each_entry(pn, &adev->physical_node_list, node) {
>  		if (dev_is_pci(pn->dev)) {
> +			get_device(pn->dev);
>  			pci_dev = to_pci_dev(pn->dev);
>  			break;
>  		}
> 
> 
> 

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-10-19  9:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 17:34 [PATCH] ACPI: PCI: Fix device reference counting in acpi_get_pci_dev() Rafael J. Wysocki
2022-10-19  8:54 ` Ville Syrjälä [this message]
2022-10-19 11:35   ` Rafael J. Wysocki
2022-10-19 12:22     ` Ville Syrjälä
2022-10-19 12:57       ` Jani Nikula
2022-10-19 13:00       ` Rafael J. Wysocki
2022-10-19 16:53   ` Bjorn Helgaas
2022-10-19 17:40     ` Ville Syrjälä

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=Y0+7Ug9Yh6J6uHVr@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=helgaas@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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