From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC3013E3179 for ; Fri, 8 May 2026 13:17:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246277; cv=none; b=gNbT00NUncKM/KUcuEgEmAMkg+q5ZcwbrGzGSLwu0+rs3KBRVqyAbUcqXFxBUpWPcgnLUi74MdDjjr1cazVyptqpQKO8+ncu3QRTaEkgdNACwRUeQ+Q6fLNWg1qeC6l3ZEUtFI0mWiMMFJDgOq7h4FeLuB724w/S+aWTd1Y0IUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246277; c=relaxed/simple; bh=8p27S5MOGU71UbNINV14aMU5g0i9T0ZM6IUt5Ys7L38=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jeRJRR9DMUhFmv0AGv2O4GtNdEYnm7q0S02eesXEmhOy82XBccFdmzi917PhjzA3s4h0PgZKtBVVFdVHeoWYzZiBZ5po91MuhW2lEhyAy4x0txo6tvSmMdywh8+Kn4q72jhwlGSgkwtuvugsASB1E8lMMGv0D7kS5T4WyKqk6sM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=psxYf6iS; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="psxYf6iS" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-82735a41920so785343b3a.2 for ; Fri, 08 May 2026 06:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778246275; x=1778851075; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=GPQqbo0BGx+WtuCfVxMY5CEZE7UAc0Y6Xa4Xm40mq+I=; b=psxYf6iSnTx2vR6kv8IOLvrsIJ/otyW6lYKpJ3tR1EOOlfaMSYkQc/srNsYRiQIGIh w5Sxi9qQ+eTg3Q35xbRrdZvp8oY5Ti5+p6kPNPYGiylf0D0Vp4YMhRfAkdiCVION+S8G tPGZaPERI6TK6+47FnYDwPfqyltZ4VCovlvoM5RvUiqbWYbsNSHrCNy2rbBf5PCCdGLw HkWLGdVtQBoZoF8tLIJrX2TPVIEtTH2qfUDy3MOOesAA7i/FOpvnVUs34+Bsvt5NSDDc IrVTFfOhCunrMp/gcBtJoIvhayhDaWYQA7YtjlWYthV1I7R4M1xS3WmwQpfYM0DYKiIU WH0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778246275; x=1778851075; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GPQqbo0BGx+WtuCfVxMY5CEZE7UAc0Y6Xa4Xm40mq+I=; b=VLHn9FMXrhZW+4AtLRLzFsHDrpy6Fqbgdoab9pcLP7LvFSKdQQ97BKRRfJuh5J8iJr 7peB+fMylmd/dOSvxNP8S3W0v/2szpOyar1EFdbiUjTDQjB52Dmyn8M7XWlPVrIcEpwX oN1VhZ0KCVAZexXa9bS8k65MPlHMfnpIAx/Z77jpIvZqbinXuC8ar/fDVBT12jQUrX/D UNUMqD/q7irm8TlWD8tEVTH8zc4GtIXVbcfWv+pCPnzcvcMq2ubwlOkxC2WuiQvvCoqr ycJfDOw1q2jHesnp8uKOnxMH+g+/s3WTe62UJgJe+bVZn3OWGMBHkhZHV1c88XJkwp2i x+fw== X-Forwarded-Encrypted: i=1; AFNElJ+uDycxplFpQ1MH/4mx2cKXsAbFI9eDlOKudK1o9GaK5VHhQ3QPemopCeZWwfVTOZog4bgUUohz0SxMkbE=@vger.kernel.org X-Gm-Message-State: AOJu0YxERnxeeCac9yrKwNfJaBZChJZ/n8qHzcEMCQez+qgd/OO6pT8A YZDnhaINZ/sqHjOYzYZA5PGmyg4EslIak5p93IE0AIK3LuCIf1ZojO1D X-Gm-Gg: AeBDietKcM/DF1HVsZjULbQ4ChLShFdHnkPdyt7pXsff84Wwf2l6YYlOtsKeLtfCIeU FOx9rPKr5ih7/W2BYfDp87rE6F6oQUAviNn3A3eIcRWpUuTArej5nAGM13eKGxFTjznk6w7PJQB 6hUbriCrwJsrGwrZFxZP5fnwiwGho6ZGz7PsFPAwGHg3aVyzk/b3KK+d3Jv09k4z/tc4HNfMm5/ Hn84qWMdbHS47stNBKhI6NJnvItEQBUfvDhFt7VsQK3rL4JiFDP5VWkucGL74814U0bXaLRQpeK oq3OA5xW9Lvv5t61BCqFnSJCfZ7H0RVyLKGId7yUV8S80aEGUzUOBA+syc5hrnxMBYQdTazl5o0 mkwQVnn9R49Vvm7lWTG7pJIWUwwZIQpQM1TXgqsiIPhc60hH+CYujhrcSzGNhNWCAGfRj/mHuCx rhvUaHb5QRjTpUGHzh2+ScD279j2FkxanRocxtsxDCM+ldkhGPHjkAbguHLmrTxjdWfxYave4U X-Received: by 2002:a05:6a00:f0f:b0:838:3f54:a0ee with SMTP id d2e1a72fcca58-83a5b2d2c16mr12005499b3a.7.1778246275059; Fri, 08 May 2026 06:17:55 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:da43:aeff:fecc:bfd5? ([2600:1700:e321:62f0:da43:aeff:fecc:bfd5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83965945101sm12098812b3a.13.2026.05.08.06.17.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 May 2026 06:17:54 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Fri, 8 May 2026 06:17:53 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/2] usb: xhci-pci: add generic auxiliary device interface To: Jihong Min , Mathias Nyman , Jihong Min , Greg Kroah-Hartman , Mathias Nyman Cc: Jonathan Corbet , Shuah Khan , Mario Limonciello , Basavaraj Natikar , linux-usb@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8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vm1nnoH4licaU5Y1nSkFR/j2douI5P7Cj687WuNMC6CcFd6j72kRfxklOqXw zvy+2NEcXyziiLXp84130yxAKXfluax9sZhhrhKT6VrD45S6N3HxJpXQ/RY/EX35neH2/F7B RgSloce2+zWfpELyS1qRkCUTt1tlGV2p+y2BPfXzrHn2vxvbhEn1QpQ6t+85FKN8YEhJEygJ F0WaMvQMNrk9UAUziVcUkLU52NS9SXqpVg8vgrO0JKx97IXFPcNh0DWsSj/0Y8HO/RDkGXYn FDMj7fZSPKyPQPmEHg+W/KzxSSfdgWIHF2QaQ0b2q1wOSec4Rti52ohmNSY+KNIW/zODhugJ np3900V20aS7eD9K8GTU0TGC1pyz6IVJwIE= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/8/26 00:04, Jihong Min wrote: > Hi Mathias, > > I tried the xhci-pci-prom21.c approach you suggested, with a PROM21-specific > PCI glue driver calling xhci_pci_common_probe() and creating the auxiliary > hwmon child device from that driver. > > While doing that I noticed a possible boot-time regression with the module > case. > > If CONFIG_USB_XHCI_PCI=y and CONFIG_USB_XHCI_PCI_PROM21=m, then generic > xhci-pci sees CONFIG_USB_XHCI_PCI_PROM21 as enabled and refuses the PROM21 > PCI ID: > >     if (IS_ENABLED(CONFIG_USB_XHCI_PCI_PROM21) && >         pci_match_id(pci_ids_prom21, dev)) >             return -ENODEV; > > That means the PROM21 xHCI controller is handled only by > xhci-pci-prom21.ko. If that module is not present in the initramfs or is not > loaded early enough, the PROM21 xHCI controller remains unbound during early > boot. Devices behind that controller, such as a USB keyboard used for early > boot or disk unlock, would not work even though the generic xhci-pci driver is > built in and could otherwise operate the controller. > > This seems different from the Renesas case, where the separate PCI driver is > needed for controller-specific firmware handling. For PROM21, the USB/xHCI > operation itself is still generic; the only extra function is publishing an > optional hwmon child device. > > So I am not sure what the preferred direction should be: > >   1. Keep the separate xhci-pci-prom21.c PCI glue driver and make >      USB_XHCI_PCI_PROM21 built-in only, or otherwise constrain the Kconfig so >      the generic xhci-pci handoff cannot break early boot. > >   2. Keep PROM21 handled by generic xhci-pci and add only a small >      PROM21-specific auxiliary-device creation hook in xhci-pci after the >      common probe succeeds. In that model, failure to create the optional hwmon >      auxiliary device would not affect USB operation. > >   3. Some other split that keeps PROM21-specific sensor code outside >      xhci-pci, but does not prevent generic xhci-pci from binding the >      controller when the optional PROM21 glue is not available early. > > Do you still prefer the separate xhci-pci-prom21.c PCI driver for this case, > or would the minimal xhci-pci auxiliary-device hook be more appropriate given > the built-in xhci-pci / modular PROM21 glue case? > Maybe I am missing something, but it seems to me that CONFIG_USB_XHCI_PCI_PROM21 should be just as built-in as CONFIG_USB_XHCI_PCI. Thanks, Guenter > Sincerely, > Jihong Min > > On 5/7/26 18:31, Mathias Nyman wrote: >> On 5/7/26 06:31, Jihong Min wrote: >>> Some xHCI PCI controllers expose controller-specific functionality that is >>> not part of generic xHCI operation and is better handled by optional child >>> drivers in other subsystems. Add a small auxiliary device registration path >>> for selected xHCI PCI controllers. >>> >>> The initial PCI ID match table lists AMD Promontory 21 (PROM21) 1022:43fd >>> controllers. For matching controllers, xhci-pci creates an auxiliary >>> device and stores it in devres so the remove path destroys it before HCD >>> teardown. >>> >>> Subsystem-specific child drivers can then bind to those devices through >>> the auxiliary bus and keep their hardware-specific logic outside xhci-pci. >>> >>> Assisted-by: Codex:gpt-5.5 >>> Signed-off-by: Jihong Min >>> --- >>>   drivers/usb/host/Kconfig    | 10 +++++ >>>   drivers/usb/host/xhci-pci.c | 83 +++++++++++++++++++++++++++++++++++++ >>>   2 files changed, 93 insertions(+) >>> >>> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig >>> index 0a277a07cf70..e0c2c7ac5c97 100644 >>> --- a/drivers/usb/host/Kconfig >>> +++ b/drivers/usb/host/Kconfig >>> @@ -42,6 +42,16 @@ config USB_XHCI_PCI >>>       depends on USB_PCI >>>       default y >>>   +config USB_XHCI_PCI_AUXDEV >>> +    bool "xHCI PCI auxiliary device support" >>> +    depends on USB_XHCI_PCI >>> +    select AUXILIARY_BUS >>> +    help >>> +      This enables xHCI PCI support for registering auxiliary devices >>> +      for selected controllers. It is used by optional child drivers >>> +      that bind to xHCI PCI controller-specific functionality through >>> +      the auxiliary bus. >>> + >>>   config USB_XHCI_PCI_RENESAS >>>       tristate "Support for additional Renesas xHCI controller with firmware" >>>       depends on USB_XHCI_PCI >>> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c >>> index 585b2f3117b0..618d6840e108 100644 >>> --- a/drivers/usb/host/xhci-pci.c >>> +++ b/drivers/usb/host/xhci-pci.c >>> @@ -8,6 +8,8 @@ >>>    * Some code borrowed from the Linux EHCI driver. >>>    */ >>>   +#include >>> +#include >>>   #include >>>   #include >>>   #include >>> @@ -80,6 +82,7 @@ >>>   #define PCI_DEVICE_ID_AMD_RAVEN_15E1_XHCI        0x15e1 >>>   #define PCI_DEVICE_ID_AMD_RAVEN2_XHCI            0x15e5 >>>   #define PCI_DEVICE_ID_AMD_RENOIR_XHCI            0x1639 >>> +#define PCI_DEVICE_ID_AMD_PROM21_XHCI            0x43fd >>>   #define PCI_DEVICE_ID_AMD_PROMONTORYA_4            0x43b9 >>>   #define PCI_DEVICE_ID_AMD_PROMONTORYA_3            0x43ba >>>   #define PCI_DEVICE_ID_AMD_PROMONTORYA_2            0x43bb >>> @@ -103,6 +106,80 @@ static int xhci_pci_run(struct usb_hcd *hcd); >>>   static int xhci_pci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, >>>                         struct usb_tt *tt, gfp_t mem_flags); >>>   +static const struct pci_device_id pci_ids_have_aux[] = { >>> +    { PCI_DEVICE_DATA(AMD, PROM21_XHCI, "prom21_hwmon") }, >>> +    { /* end: all zeroes */ } >>> +}; >>> + >>> +struct xhci_pci_aux_devres { >>> +    struct auxiliary_device *auxdev; >>> +}; >>> + >>> +static const char *xhci_pci_aux_dev_name(struct pci_dev *pdev) >>> +{ >>> +    const struct pci_device_id *id; >>> + >>> +    id = pci_match_id(pci_ids_have_aux, pdev); >>> +    if (!id) >>> +        return NULL; >>> + >>> +    return (const char *)id->driver_data; >>> +} >>> + >>> +static void xhci_pci_aux_devres_release(struct device *dev, void *res) >>> +{ >>> +    struct xhci_pci_aux_devres *devres = res; >>> + >>> +    if (devres->auxdev) >>> +        auxiliary_device_destroy(devres->auxdev); >>> +} >>> + >>> +static void xhci_pci_try_add_aux_device(struct pci_dev *pdev) >>> +{ >>> +    struct xhci_pci_aux_devres *devres; >>> +    struct auxiliary_device *auxdev; >>> +    const char *aux_dev_name; >>> + >>> +    aux_dev_name = xhci_pci_aux_dev_name(pdev); >>> +    if (!aux_dev_name) >>> +        return; >>> + >>> +    devres = devres_alloc(xhci_pci_aux_devres_release, sizeof(*devres), >>> +                  GFP_KERNEL); >>> +    if (!devres) { >>> +        dev_warn(&pdev->dev, >>> +             "failed to allocate auxiliary device state\n"); >>> +        return; >>> +    } >>> + >>> +    auxdev = auxiliary_device_create(&pdev->dev, KBUILD_MODNAME, >>> +                     aux_dev_name, NULL, >>> +                     (pci_domain_nr(pdev->bus) << 16) | >>> +                         pci_dev_id(pdev)); >>> +    if (!auxdev) { >>> +        devres_free(devres); >>> +        dev_warn(&pdev->dev, "failed to add %s auxiliary device\n", >>> +             aux_dev_name); >>> +        return; >>> +    } >>> + >>> +    devres->auxdev = auxdev; >>> +    devres_add(&pdev->dev, devres); >>> +} >>> + >>> +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; >>> +} >>> + >>>   static const struct xhci_driver_overrides xhci_pci_overrides __initconst = { >>>       .reset = xhci_pci_setup, >>>       .start = xhci_pci_run, >>> @@ -677,6 +754,9 @@ int xhci_pci_common_probe(struct pci_dev *dev, const struct pci_device_id *id) >>>       if (device_property_read_bool(&dev->dev, "ti,pwron-active-high")) >>>           pci_clear_and_set_config_dword(dev, 0xE0, 0, 1 << 22); >>>   +    if (IS_ENABLED(CONFIG_USB_XHCI_PCI_AUXDEV)) >>> +        xhci_pci_try_add_aux_device(dev); >>> + >>>       return 0; >> >> I think this should be turned around so that the vendor specific code calls the common code. >> xhci-pci-renesas.c does this nicely. >> >> In your case it would be adding something like a xhci-pci-prom21.c pci driver: >> >> xhci_pci_prom21_probe(struct pci_dev *dev, const struct pci_device_id *id) >> { >>     crate_auxiliary_device(dev); >>     return xhci_pci_common_probe(dev, id); >> } >> >> xhci_pci_prom21_remove(struct pci_dev *dev) >> { >>     destroy_auxiliary_device(dev); >>     xhci_pci_remove(dev); >> } >> >> static const struct pci_device_id pci_ids[] = { >>     { PCI_DEVICE(YOUR_AMD_PCI_VENDOR_ID, YOUR_PROM21_DEVICE_ID) }, >>     { /* end: all zeroes */ } >> }; >> MODULE_DEVICE_TABLE(pci, pci_ids); >> >> static struct pci_driver xhci_prom21_pci_driver = { >>     .name =        "xhci-pci-prom21", >>     .id_table =    pci_ids, >> >>     .probe =    xhci_pci_prom21_probe, >>     .remove =    xhci_pci_prom21_remove, >> >>     .shutdown =     usb_hcd_pci_shutdown, >>     .driver = { >>         .pm = pm_ptr(&usb_hcd_pci_pm_ops), >>     }, >> }; >> module_pci_driver(xhci_prom21_pci_driver); >> >> MODULE_DESCRIPTION("AMD Promontory 21 xHCI PCI Host Controller Driver"); >> MODULE_IMPORT_NS("xhci"); >> MODULE_LICENSE("GPL v2"); >> >> -Mathias >