From: Thierry Reding <treding@nvidia.com>
To: maowenan <maowenan@huawei.com>
Cc: felipe.balbi@linux.intel.com, gregkh@linuxfoundation.org,
nkristam@nvidia.com, arnd@arndb.de, johan@kernel.org,
krzk@kernel.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] usb: gadget: Add dependency for USB_TEGRA_XUDC
Date: Mon, 04 Nov 2019 13:53:12 +0000 [thread overview]
Message-ID: <20191104135312.GD996639@ulmo> (raw)
In-Reply-To: <51315499-99d0-eca3-a7df-b8dd84628bbd@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]
On Mon, Nov 04, 2019 at 06:50:01PM +0800, maowenan wrote:
>
>
> On 2019/11/4 18:04, Thierry Reding wrote:
> > On Mon, Nov 04, 2019 at 10:59:45AM +0800, Mao Wenan wrote:
> >> If CONFIG_USB_TEGRA_XUDC=y and CONFIG_USB_ROLE_SWITCH=m,
> >> below erros can be seen:
> >> drivers/usb/gadget/udc/tegra-xudc.o: In function `tegra_xudc_remove':
> >> tegra-xudc.c:(.text+0x6b0): undefined reference to `usb_role_switch_unregister'
> >> drivers/usb/gadget/udc/tegra-xudc.o: In function `tegra_xudc_probe':
> >> tegra-xudc.c:(.text+0x1b88): undefined reference to `usb_role_switch_register'
> >> drivers/usb/gadget/udc/tegra-xudc.o: In function `tegra_xudc_usb_role_sw_work':
> >> tegra-xudc.c:(.text+0x5ecc): undefined reference to `usb_role_switch_get_role'
> >>
> >> This patch add dependency USB_ROLE_SWITCH for UDC driver.
> >>
> >> Fixes: 49db427232fe ("usb: gadget: Add UDC driver for tegra XUSB device mode controller")
> >> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> >> ---
> >> drivers/usb/gadget/udc/Kconfig | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
> >> index acaec3a..d103154 100644
> >> --- a/drivers/usb/gadget/udc/Kconfig
> >> +++ b/drivers/usb/gadget/udc/Kconfig
> >> @@ -445,6 +445,7 @@ config USB_TEGRA_XUDC
> >> tristate "NVIDIA Tegra Superspeed USB 3.0 Device Controller"
> >> depends on ARCH_TEGRA || COMPILE_TEST
> >> depends on PHY_TEGRA_XUSB
> >> + depends on USB_ROLE_SWITCH
> >
> > It looks like most other drivers that use the USB role switch class do
> > "select" here. Now, that's suboptimal because USB_ROLE_SWITCH is a user-
> > visible symbol, which can lead to conflicts, so it should be avoided. I
> > think that in this case it might make sense to hide USB_ROLE_SWITCH and
> > then convert all "depends on USB_ROLE_SWITCH" occurrences to "select
> > USB_ROLE_SWITCH". The USB role switch class is, after all, not useful by
> > itself. It always needs a host and/or gadget driver to make use of it.
> >
>
> Thanks, I send v2 and change 'depends on' to 'select' for this patch.
Great, can you also follow up with a patch to hide the USB_ROLE_SWITCH
option so that we can avoid any of the pitfalls associated with user-
visible symbols and "select"?
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <treding@nvidia.com>
To: maowenan <maowenan@huawei.com>
Cc: <felipe.balbi@linux.intel.com>, <gregkh@linuxfoundation.org>,
<nkristam@nvidia.com>, <arnd@arndb.de>, <johan@kernel.org>,
<krzk@kernel.org>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH -next] usb: gadget: Add dependency for USB_TEGRA_XUDC
Date: Mon, 4 Nov 2019 14:53:12 +0100 [thread overview]
Message-ID: <20191104135312.GD996639@ulmo> (raw)
In-Reply-To: <51315499-99d0-eca3-a7df-b8dd84628bbd@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]
On Mon, Nov 04, 2019 at 06:50:01PM +0800, maowenan wrote:
>
>
> On 2019/11/4 18:04, Thierry Reding wrote:
> > On Mon, Nov 04, 2019 at 10:59:45AM +0800, Mao Wenan wrote:
> >> If CONFIG_USB_TEGRA_XUDC=y and CONFIG_USB_ROLE_SWITCH=m,
> >> below erros can be seen:
> >> drivers/usb/gadget/udc/tegra-xudc.o: In function `tegra_xudc_remove':
> >> tegra-xudc.c:(.text+0x6b0): undefined reference to `usb_role_switch_unregister'
> >> drivers/usb/gadget/udc/tegra-xudc.o: In function `tegra_xudc_probe':
> >> tegra-xudc.c:(.text+0x1b88): undefined reference to `usb_role_switch_register'
> >> drivers/usb/gadget/udc/tegra-xudc.o: In function `tegra_xudc_usb_role_sw_work':
> >> tegra-xudc.c:(.text+0x5ecc): undefined reference to `usb_role_switch_get_role'
> >>
> >> This patch add dependency USB_ROLE_SWITCH for UDC driver.
> >>
> >> Fixes: 49db427232fe ("usb: gadget: Add UDC driver for tegra XUSB device mode controller")
> >> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> >> ---
> >> drivers/usb/gadget/udc/Kconfig | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
> >> index acaec3a..d103154 100644
> >> --- a/drivers/usb/gadget/udc/Kconfig
> >> +++ b/drivers/usb/gadget/udc/Kconfig
> >> @@ -445,6 +445,7 @@ config USB_TEGRA_XUDC
> >> tristate "NVIDIA Tegra Superspeed USB 3.0 Device Controller"
> >> depends on ARCH_TEGRA || COMPILE_TEST
> >> depends on PHY_TEGRA_XUSB
> >> + depends on USB_ROLE_SWITCH
> >
> > It looks like most other drivers that use the USB role switch class do
> > "select" here. Now, that's suboptimal because USB_ROLE_SWITCH is a user-
> > visible symbol, which can lead to conflicts, so it should be avoided. I
> > think that in this case it might make sense to hide USB_ROLE_SWITCH and
> > then convert all "depends on USB_ROLE_SWITCH" occurrences to "select
> > USB_ROLE_SWITCH". The USB role switch class is, after all, not useful by
> > itself. It always needs a host and/or gadget driver to make use of it.
> >
>
> Thanks, I send v2 and change 'depends on' to 'select' for this patch.
Great, can you also follow up with a patch to hide the USB_ROLE_SWITCH
option so that we can avoid any of the pitfalls associated with user-
visible symbols and "select"?
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-11-04 13:53 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-04 2:59 [PATCH -next] usb: gadget: Add dependency for USB_TEGRA_XUDC Mao Wenan
2019-11-04 2:59 ` Mao Wenan
2019-11-04 10:04 ` Thierry Reding
2019-11-04 10:04 ` Thierry Reding
2019-11-04 10:50 ` maowenan
2019-11-04 10:50 ` maowenan
2019-11-04 11:21 ` [PATCH v2 " Mao Wenan
2019-11-04 11:21 ` Mao Wenan
2019-11-04 13:52 ` Thierry Reding
2019-11-04 13:52 ` Thierry Reding
2019-11-04 13:53 ` Thierry Reding [this message]
2019-11-04 13:53 ` [PATCH " Thierry Reding
2019-11-04 14:48 ` [PATCH -next] usb: roles: Hide option USB_ROLE_SWITCH Mao Wenan
2019-11-04 14:48 ` Mao Wenan
2019-11-05 12:42 ` Heikki Krogerus
2019-11-05 12:42 ` Heikki Krogerus
2019-11-05 13:16 ` Dan Carpenter
2019-11-05 13:16 ` Dan Carpenter
2019-11-05 15:26 ` Heikki Krogerus
2019-11-05 15:26 ` Heikki Krogerus
2019-11-06 11:23 ` Dan Carpenter
2019-11-06 11:23 ` Dan Carpenter
2019-11-05 12:37 ` [PATCH -next] usb: gadget: Add dependency for USB_TEGRA_XUDC Heikki Krogerus
2019-11-05 12:37 ` Heikki Krogerus
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=20191104135312.GD996639@ulmo \
--to=treding@nvidia.com \
--cc=arnd@arndb.de \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=maowenan@huawei.com \
--cc=nkristam@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.