From: "Arnd Bergmann" <arnd@arndb.de>
To: "Alan Stern" <stern@rowland.harvard.edu>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: "Niklas Schnelle" <schnelle@linux.ibm.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
"Geert Uytterhoeven" <geert@linux-m68k.org>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
linux-kernel@vger.kernel.org,
Linux-Arch <linux-arch@vger.kernel.org>,
linux-pci@vger.kernel.org, "Arnd Bergmann" <arnd@kernel.org>,
linux-usb@vger.kernel.org
Subject: Re: [PATCH v4 35/41] usb: uhci: handle HAS_IOPORT dependencies
Date: Wed, 17 May 2023 14:17:58 +0200 [thread overview]
Message-ID: <440855f4-897c-4597-bbe6-7c5f295f616a@app.fastmail.com> (raw)
In-Reply-To: <2c03973e-0635-4dbb-a1df-bfda8cbee161@rowland.harvard.edu>
On Tue, May 16, 2023, at 22:17, Alan Stern wrote:
> On Tue, May 16, 2023 at 06:29:56PM +0200, Greg Kroah-Hartman wrote:
>> On Tue, May 16, 2023 at 01:00:31PM +0200, Niklas Schnelle wrote:
>
>> I'm confused now.
>>
>> So if CONFIG_HAS_IOPORT is enabled, wonderful, all is good.
>>
>> But if it isn't, then these are just no-ops that do nothing? So then
>> the driver will fail to work? Why have these stubs at all?
>>
>> Why not just not build the driver at all if this option is not enabled?
>
> I should add something to my previous email. This particular section of
> code is protected by:
>
> #ifndef CONFIG_USB_UHCI_SUPPORT_NON_PCI_HC
> /* Support PCI only */
>
> So it gets used only in cases where the driver supports just a PCI bus
> -- no other sorts of non-PCI on-chip devices. But the preceding patch
> in this series changes the Kconfig file to say:
>
> config USB_UHCI_HCD
> tristate "UHCI HCD (most Intel and VIA) support"
> depends on (USB_PCI && HAS_IOPORT) || USB_UHCI_SUPPORT_NON_PCI_HC
>
> As a result, when the configuration includes support only for PCI
> controllers the driver won't get built unless HAS_IOPORT is set. Thus
> the no-op case (in this part of the code) can't arise.
Indeed, that makes sense.
> Which is a long-winded way of saying that you're right; the UHCI_IN()
> and UHCI_OUT() wrappers aren't needed in this part of the driver. I
> guess Niklas put them in either for consistency with the rest of the
> code or because it didn't occur to him that they could be omitted. (And
> I didn't spot it either.)
It's probably less confusing to leave out the PCI-only part of
the patch then and only modify the generic portion.
Arnd
next prev parent reply other threads:[~2023-05-17 12:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230516110038.2413224-1-schnelle@linux.ibm.com>
2023-05-16 11:00 ` [PATCH v4 34/41] usb: add HAS_IOPORT dependencies Niklas Schnelle
2023-05-16 11:00 ` [PATCH v4 35/41] usb: uhci: handle " Niklas Schnelle
2023-05-16 16:29 ` Greg Kroah-Hartman
2023-05-16 16:44 ` Arnd Bergmann
2023-05-16 19:51 ` Alan Stern
2023-05-17 8:29 ` Niklas Schnelle
2023-05-16 20:17 ` Alan Stern
2023-05-17 12:17 ` Arnd Bergmann [this message]
2023-05-19 11:31 ` Niklas Schnelle
2023-05-16 11:00 ` [PATCH v4 36/41] usb: pci-quirks: " Niklas Schnelle
2023-05-30 11:00 ` Niklas Schnelle
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=440855f4-897c-4597-bbe6-7c5f295f616a@app.fastmail.com \
--to=arnd@arndb.de \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@kernel.org \
--cc=bhelgaas@google.com \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=rafael@kernel.org \
--cc=schnelle@linux.ibm.com \
--cc=stern@rowland.harvard.edu \
--cc=u.kleine-koenig@pengutronix.de \
/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