linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michał Pecio" <michal.pecio@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: xhci: Restore xhci_pci support for Renesas HCs
Date: Mon, 27 Jan 2025 20:53:40 +0100	[thread overview]
Message-ID: <20250127205340.78b99964@foxbook> (raw)
In-Reply-To: <2025012701-citrus-omission-89b3@gregkh>

On Mon, 27 Jan 2025 18:29:52 +0100, Greg Kroah-Hartman wrote:
> On Mon, Jan 27, 2025 at 03:10:51PM +0100, Michal Pecio wrote:
> > Some Renesas HCs require firmware upload to work, this is handled
> > by the xhci_pci_renesas driver. Other variants of those chips load
> > firmware from onboard flash and can work with xhci_pci alone.
> > 
> > A refactor merged in v6.12 broke the latter configuration and users
> > are finding their hardware not working after upgrading and need to
> > enable the firmware loader which isn't really necessary on their
> > systems.  
> 
> Why isn't it necessary?  Those chips want firmware to be uploaded, and
> if the driver doesn't need it, it should be able to handle it if it is
> not present.

Because their chips have already loaded themselves from attached SPI
flash, so they are ready to use with xhci_pci like any other HC.

The FW isn't optional, we just usually don't need to load it. And FW
for those chips is obscure and not redistributable AFAIK, so people
have little reason to enable xhci_pci_renesas if their board has ROM
and works without it. It is 'N' by default.

> No, please don't put #ifdef in .c files if at all preventable.

Hmm, I suppose I could replace the #ifdef with 'if (IS_ENABLED(...))'
and leave the rest to dead code elimination if that's preferred.

Annoyingly, the code to be knocked out is in xhci-pci and it has to
stay there to avoid runtime dependency on xhci-pci-renesas, which was
the whole point of the refactor.

> If the firmware isn't there, then the driver should be fixed to keep
> on working if it determines loading it is not needed.  This type of
> check should not be needed in the xhci-pci.c file.

This is a check for kernel configuration, not for firmware. If the
loader is disabled, we don't want to reject those chips expecting them
to be taken care of by the loader, because that is not going to happen.

Regards,
Michal

  reply	other threads:[~2025-01-27 19:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-27 14:10 [PATCH] usb: xhci: Restore xhci_pci support for Renesas HCs Michal Pecio
2025-01-27 17:29 ` Greg Kroah-Hartman
2025-01-27 19:53   ` Michał Pecio [this message]
2025-01-28  9:45 ` [PATCH v2] " Michal Pecio
2025-02-03 18:21   ` nb

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=20250127205340.78b99964@foxbook \
    --to=michal.pecio@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.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;
as well as URLs for NNTP newsgroup(s).