From: sashiko-bot@kernel.org
To: "Vidya Sagar" <vidyas@nvidia.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH V1 3/4] PCI/sysfs: Take the device lock when setting reset methods
Date: Thu, 19 Nov 2026 10:20:16 +0000 [thread overview]
Message-ID: <sashiko-outbox-222944@kernel.org> (raw)
In-Reply-To: <20261119100628.1948990-4-vidyas@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] PCI/sysfs: missing Fixes trailer for reset_method_store() lock
fix
--
commit f6a788ffd2891c157884c924ff811b7d6b5ba6aa
Author: Vidya Sagar <vidyas@nvidia.com>
> PCI/sysfs: Take the device lock when setting reset methods
>
> reset_method_store() updates dev->reset_methods without holding any
> lock. A reset can run at the same time: __pci_reset_function_locked()
> walks the list one entry at a time while the write copies the new list
> over it, so the reset may use a mix of the old and the new list.
>
> Take the device lock in reset_method_store(), as
> __pci_reset_function_locked() already requires. This also serializes
> concurrent writes. The reset methods already run under this lock during
> a reset, and probing a method does less than running it, so probing them
> with the lock held is safe. A write now waits while a reset of the
> device is in progress.
>
> Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
[Severity: Low]
This fixes a race condition in reset_method_store(). Should it include:
Fixes: d88f521da3ef ("PCI: Allow userspace to query and set device reset mechanism")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119100628.1948990-2-vidyas@nvidia.com?part=3
next prev parent reply other threads:[~2026-11-19 10:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 10:06 [PATCH V1 0/4] PCI: Don't list reset methods that can't reset the device Vidya Sagar
2026-11-19 10:06 ` [PATCH V1 1/4] PCI/CXL: Don't offer 'cxl_bus' reset where a bus reset can't work Vidya Sagar
2026-11-19 10:20 ` sashiko-bot
2026-11-19 10:06 ` [PATCH V1 2/4] PCI: Don't run IOMMU reset hooks when only probing reset methods Vidya Sagar
2026-11-19 10:14 ` sashiko-bot
2026-11-19 10:06 ` [PATCH V1 3/4] PCI/sysfs: Take the device lock when setting " Vidya Sagar
2026-11-19 10:20 ` sashiko-bot [this message]
2026-11-19 10:06 ` [PATCH V1 4/4] PCI: Re-check function 0 reset methods after scanning its slot Vidya Sagar
2026-11-19 10:32 ` sashiko-bot
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=sashiko-outbox-222944@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vidyas@nvidia.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