Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1313602pxv; Fri, 2 Jul 2021 00:13:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZPWW0xXbLb1nuE+VPc9945eO9hkCLkTbtxXoJ0pWCrM3ys29oob4jqw0jLfaAesEnNNYS X-Received: by 2002:a92:dd89:: with SMTP id g9mr2447319iln.209.1625210009141; Fri, 02 Jul 2021 00:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625210009; cv=none; d=google.com; s=arc-20160816; b=nJVdoS1WHL4uje+FACQxkwEsh7gBoL3gPrSgKLinkPx81OdA8X1NeX5G/0htnG75o5 2wFpAULOIuGkO5fMuOr2u64UVAhIuif2+ho22axGPc96PQSFS21ODWwYMTOELmRnQ2Nk NtFXdM7mA+GkjrNuATcu/6Bxc9sgJpMQ5ryrzhIhnHHuqrJXf2sdGtBQkAKpeC3Ixw2I 3sPwPPud3nyt/xK0gn0Osepvmds5pt0GLIEmlTWlIXt/IFsO6ErWap97yxVcEFti3I4N 9vxszlhuehmF+Uhchp2EHcbJNlbCArMXX9JbeHBixt/JtWgJan+OgJiK+xS0hMfyVEg0 a/Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=HBjx96dRvIYpvLm9bDce2WQF6RaXhOM1qkXEjF3chQI=; b=MaEGLm47dlMkGWmDNHTUhehX5TgYDR8yjR8/0p9pU8ZuPvaa62KMC23Akpohpeniqq 7lB6F/mCXqpO5RY+bmn+JiPzsoVer+gGuN5ozTCrzRblmDj0kW76gEkNSf2aNi4kr6NI mza5pNsv5pOyD8rxVg17jsBMCgcLiPYct1xNqsKmvHJ8tmu9wu+4mzNMTbcs0atiWoLg px7Rnx0VnI2IvNL8Qvv7r08mkT6uc/5uj8/A0lBXf9lAV1OpW3hhx9Oyp8oSvdGNFktb W3L2Q9Wta0Q/1GPaArw+n9xtU8hGh1hdcqap/3SUgvv8X06wYkpeqR/Zio4A1JnBh2Y0 yjuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vqiqhchL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si2396477jap.83.2021.07.02.00.13.16; Fri, 02 Jul 2021 00:13:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vqiqhchL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230166AbhGBHOX (ORCPT + 99 others); Fri, 2 Jul 2021 03:14:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbhGBHOW (ORCPT ); Fri, 2 Jul 2021 03:14:22 -0400 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36C08C061765 for ; Fri, 2 Jul 2021 00:11:51 -0700 (PDT) Received: by mail-qv1-xf4a.google.com with SMTP id r15-20020a0562140c4fb0290262f40bf4bcso5594386qvj.11 for ; Fri, 02 Jul 2021 00:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=HBjx96dRvIYpvLm9bDce2WQF6RaXhOM1qkXEjF3chQI=; b=vqiqhchLV2gT4U8J5tgFK6IYRNU7yAhHftRlqQdbbKrd1a0Dah7U7nbSEW4Ib34+Q+ e5ggChBQeS9T4rZi9vXd7PpWhtWstB+7OGSGpSq5Luy9a2XsJreHA8dPpvM74ZrE5HPO 8jQEMhGCcP6d/Oq/sVdWushjB6jzxzl6I1JQzSqALfACNHhmWk+H57WxsPRnhoEPi03E lCStBDLFIGG45xCjbqnmMMKy++0cwNxzZV+n6IfmG1EVS998zYwciGSx3lgrhZ0mWKSQ 3atYvgpKueteQbEoFpIVqwCTbFdfIED63q09L45NCUT7C2qODDW14OopAFY8qNxMpm5N 9Brg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=HBjx96dRvIYpvLm9bDce2WQF6RaXhOM1qkXEjF3chQI=; b=EqkzEXxw/mqKDKICJXn8ubAoVrdi7i7FJ8fl/nomLatWqpkt8uE7ATGBsLId9YZ1KL tgwtdWaDAJgabBZy8m/l/5Ep6ZaMIT1zfCK8k2tdq26CNE/MqNUngRAScUqXOr6eLhcU Bas1QFupyD+x+ftyj7+9Japk7sSjJkocYFsi2Y0BEk4j75baNi8S/WmYGyDUn0i45w8z NYRqyHufSjGjlUZuunNGEr0/u36tSVS6Ee4zxQCisGTpF/mT6RSbveiUXIayylp3FCBB AWUwz1xR7KAgcqbrSIlVWhVvIsf5RnMfkCwUWMBOMTmi1lpjjMJEG6i285b1vLC5QvmL j/Zg== X-Gm-Message-State: AOAM533oAA3dLIQFZ8iOkWxftQFadTMJHbqxNah/PBMSKAPwfsejJ5tW zaZG6cslKbweE9Dq45AcyuUZne8C2JMf X-Received: from gthelen2.svl.corp.google.com ([2620:15c:2cd:202:81c6:dd12:da9f:dd72]) (user=gthelen job=sendgmr) by 2002:a0c:f78a:: with SMTP id s10mr3743938qvn.61.1625209910018; Fri, 02 Jul 2021 00:11:50 -0700 (PDT) Date: Fri, 02 Jul 2021 00:11:48 -0700 In-Reply-To: Message-Id: Mime-Version: 1.0 References: <20210702054754.2056918-1-gthelen@google.com> Subject: Re: [PATCH] usb: xhci: avoid renesas_usb_fw.mem when it's unusable From: Greg Thelen To: Greg Kroah-Hartman Cc: Vinod Koul , Mathias Nyman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Greg Kroah-Hartman wrote: > 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 >> --- >> 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? Removing the struct meant 2 more #if guards needed below to initialize pci_ids, which exceeded my taste. >> .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? It seemed cleaner to remove both renesas_usb_fw.mem references rather than leave one unusable one in reneses_data above. But a simpler patch is appealing, especially given the number of #if guards needed to remove reneses_data. Patch V2 will just go with this 1-hunk approach. > And a blank line please before your comment? Will do. > And can you add a Fixes: line to the changelog text when you resend? Will do. > thanks, > > greg k-h