From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Greg Thelen <gthelen@google.com>
Cc: Vinod Koul <vkoul@kernel.org>,
Mathias Nyman <mathias.nyman@intel.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: xhci: avoid renesas_usb_fw.mem when it's unusable
Date: Fri, 2 Jul 2021 07:56:15 +0200 [thread overview]
Message-ID: <YN6qf51XfkHFsDx/@kroah.com> (raw)
In-Reply-To: <20210702054754.2056918-1-gthelen@google.com>
On Thu, Jul 01, 2021 at 10:47:54PM -0700, Greg Thelen wrote:
> Commit a66d21d7dba8 ("usb: xhci: Add support for Renesas controller with
> memory") added renesas_usb_fw.mem firmware reference to xhci-pci. Thus
> modinfo indicates xhci-pci.ko has "firmware: renesas_usb_fw.mem". But
> the firmware is only actually used with CONFIG_USB_XHCI_PCI_RENESAS. An
> unusable firmware reference can trigger safety checkers which look for
> drivers with unmet firmware dependencies.
>
> Avoid referring to renesas_usb_fw.mem in circumstances when it cannot be
> loaded (when CONFIG_USB_XHCI_PCI_RENESAS isn't set).
>
> Signed-off-by: Greg Thelen <gthelen@google.com>
> ---
> drivers/usb/host/xhci-pci.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index 18c2bbddf080..cb148da7a789 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -618,8 +618,10 @@ static void xhci_pci_shutdown(struct usb_hcd *hcd)
> /*-------------------------------------------------------------------------*/
>
> static const struct xhci_driver_data reneses_data = {
> +#if IS_ENABLED(CONFIG_USB_XHCI_PCI_RENESAS)
If this is not enabled, why is the whole structure needed?
> .quirks = XHCI_RENESAS_FW_QUIRK,
> .firmware = "renesas_usb_fw.mem",
> +#endif
> };
>
> /* PCI driver selection metadata; PCI hotplugging uses this */
> @@ -636,7 +638,13 @@ static const struct pci_device_id pci_ids[] = {
> { /* end: all zeroes */ }
> };
> MODULE_DEVICE_TABLE(pci, pci_ids);
> +/*
> + * Without CONFIG_USB_XHCI_PCI_RENESAS renesas_xhci_check_request_fw() won't
> + * load firmware, so don't encumber the xhci-pci driver with it.
> + */
> +#if IS_ENABLED(CONFIG_USB_XHCI_PCI_RENESAS)
> MODULE_FIRMWARE("renesas_usb_fw.mem");
> +#endif
Why not just have this one chunk, why is the first chunk needed?
And a blank line please before your comment?
And can you add a Fixes: line to the changelog text when you resend?
thanks,
greg k-h
next prev parent reply other threads:[~2021-07-02 5:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-02 5:47 [PATCH] usb: xhci: avoid renesas_usb_fw.mem when it's unusable Greg Thelen
2021-07-02 5:56 ` Greg Kroah-Hartman [this message]
2021-07-02 7:11 ` Greg Thelen
2021-07-02 7:12 ` [PATCH V2] " Greg Thelen
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=YN6qf51XfkHFsDx/@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=gthelen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=vkoul@kernel.org \
/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