From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: platform-driver-x86@vger.kernel.org,
Hans de Goede <hdegoede@redhat.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Lukas Wunner <lukas@wunner.de>,
linux-pci@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH v5 1/2] platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe
Date: Fri, 29 Dec 2023 15:34:15 +0200 (EET) [thread overview]
Message-ID: <d66c303d-da76-639-56a3-8f2b58401b59@linux.intel.com> (raw)
In-Reply-To: <20231229063912.2517922-2-shinichiro.kawasaki@wdc.com>
On Fri, 29 Dec 2023, Shin'ichiro Kawasaki wrote:
> p2sb_bar() unhides P2SB device to get resources from the device. It
> guards the operation by locking pci_rescan_remove_lock so that parallel
> rescans do not find the P2SB device. However, this lock causes deadlock
> when PCI bus rescan is triggered by /sys/bus/pci/rescan. The rescan
> locks pci_rescan_remove_lock and probes PCI devices. When PCI devices
> call p2sb_bar() during probe, it locks pci_rescan_remove_lock again.
> Hence the deadlock.
>
> To avoid the deadlock, do not lock pci_rescan_remove_lock in p2sb_bar().
> Instead, do the lock at fs_initcall. Introduce p2sb_cache_resources()
> for fs_initcall which gets and caches the P2SB resources. At p2sb_bar(),
> refer the cache and return to the caller.
>
> Link: https://lore.kernel.org/linux-pci/6xb24fjmptxxn5js2fjrrddjae6twex5bjaftwqsuawuqqqydx@7cl3uik5ef6j/
> Fixes: 9745fb07474f ("platform/x86/intel: Add Primary to Sideband (P2SB) bridge support")
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thanks for the update. I've replaced the commit in review-ilpo branch with
this v5 patch 1/2.
--
i.
next prev parent reply other threads:[~2023-12-29 13:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-29 6:39 [PATCH v5 0/2] platform/x86: p2sb: Fix deadlock at sysfs PCI bus rescan Shin'ichiro Kawasaki
2023-12-29 6:39 ` [PATCH v5 1/2] platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe Shin'ichiro Kawasaki
2023-12-29 13:34 ` Ilpo Järvinen [this message]
2023-12-29 6:39 ` [PATCH v5 2/2] platform/x86: p2sb: Use pci_resource_n() in p2sb_read_bar0() Shin'ichiro Kawasaki
-- strict thread matches above, loose matches on Subject: below --
2024-01-03 21:31 [PATCH v5 1/2] platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe Klara Modin
2024-01-04 8:41 ` Shinichiro Kawasaki
2024-01-04 12:22 ` Klara Modin
2024-01-04 12:36 ` Lukas Wunner
2024-01-05 8:18 ` Shinichiro Kawasaki
2024-01-05 8:44 ` Lukas Wunner
2024-01-05 10:26 ` Shinichiro Kawasaki
2024-01-05 11:45 ` Klara Modin
2024-01-06 1:03 ` Shinichiro Kawasaki
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=d66c303d-da76-639-56a3-8f2b58401b59@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=platform-driver-x86@vger.kernel.org \
--cc=shinichiro.kawasaki@wdc.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