From: sashiko-bot@kernel.org
To: "Jihong Min" <hurryman2212@gmail.com>
Cc: linux-pci@vger.kernel.org, linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v3 1/2] usb: xhci-pci: add generic auxiliary device interface
Date: Thu, 07 May 2026 04:14:07 +0000 [thread overview]
Message-ID: <20260507041408.493A7C2BCF4@smtp.kernel.org> (raw)
In-Reply-To: <effa7bd7bef8a8ea28b9e28fe47af6a58e39edf2.1778123510.git.hurryman2212@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Lockless modification of devres payload in `xhci_pci_try_remove_aux_device` bypasses the subsystem's devres locking mechanism.
--
commit bb8a85242e2a88f6613cf1810360076073e5ac66
Author: Jihong Min <hurryman2212@gmail.com>
usb: xhci-pci: add generic auxiliary device interface
This commit adds a small auxiliary device registration path for selected
xHCI PCI controllers like the AMD Promontory 21. It creates an auxiliary
device and stores it in devres so subsystem-specific child drivers can bind
to controller-specific functionality outside xhci-pci.
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index 585b2f3117b08..618d6840e1083 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
[ ... ]
> @@ -103,6 +106,80 @@ static int xhci_pci_run(struct usb_hcd *hcd);
[ ... ]
> +static void xhci_pci_try_remove_aux_device(struct pci_dev *pdev)
> +{
> + struct xhci_pci_aux_devres *devres;
> +
> + devres = devres_find(&pdev->dev, xhci_pci_aux_devres_release, NULL,
> + NULL);
> + if (!devres || !devres->auxdev)
> + return;
> +
> + auxiliary_device_destroy(devres->auxdev);
> + devres->auxdev = NULL;
Is it safe to locklessly modify the devres payload here?
The code uses devres_find() to obtain the devres object and manually clears
devres->auxdev after destroying the auxiliary device. This bypasses the
devres subsystem's internal spinlocks and leaves a dead devres node in the
device's list until standard devres_release_all() runs.
Should this use devres_release() instead? Calling devres_release() would
safely acquire the required locks, invoke the callback, remove the node
from the list, and free the memory.
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1778123510.git.hurryman2212@gmail.com?part=1
next prev parent reply other threads:[~2026-05-07 4:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 3:31 [PATCH v3 0/2] AMD Promontory 21 xHCI temperature hwmon support Jihong Min
2026-05-07 3:31 ` [PATCH v3 1/2] usb: xhci-pci: add generic auxiliary device interface Jihong Min
2026-05-07 4:14 ` sashiko-bot [this message]
2026-05-07 9:31 ` Mathias Nyman
2026-05-08 7:04 ` Jihong Min
2026-05-08 13:17 ` Guenter Roeck
2026-05-08 14:22 ` Jihong Min
2026-05-07 3:31 ` [PATCH v3 2/2] hwmon: add AMD Promontory 21 xHCI temperature sensor support Jihong Min
2026-05-07 15:53 ` Guenter Roeck
2026-05-08 5:42 ` Jihong Min
2026-05-08 13:12 ` Guenter Roeck
2026-05-08 14:21 ` Jihong Min
2026-05-08 16:27 ` Mario Limonciello
2026-05-08 16:56 ` Jihong Min
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=20260507041408.493A7C2BCF4@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=hurryman2212@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.