From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755182AbcIMHE0 (ORCPT ); Tue, 13 Sep 2016 03:04:26 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:60999 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563AbcIMHEY (ORCPT ); Tue, 13 Sep 2016 03:04:24 -0400 From: Arnd Bergmann To: Peter Chen Cc: Greg Kroah-Hartman , Peter Chen , Felipe Balbi , Heikki Krogerus , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: Kconfig: make USB_ULPI_BUS select USB_COMMON Date: Tue, 13 Sep 2016 09:04:08 +0200 Message-ID: <2868310.g9cFv2gbYX@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20160913014855.GE25182@b29397-desktop> References: <20160912153649.3163096-1-arnd@arndb.de> <20160913014855.GE25182@b29397-desktop> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:LBbYedNf2eLx3oWv3lmFGsi+g1CSpSjzi1lP98RJuyzcjuTS5Ss 6jf5eY/JHOnJ2m5D9r60qdXq/i19fvstuGsCU7MnwsfCxl5FonmBlrsk1eBrAh6pYlT6hzF h69PHNEplDShcTDuoAhZVmm/cC6nbfqD0M56AFTxl8Piu9rK4JWQy/VVxeOrUmBMrX4koFu /RzQK8nFohVULNbDZR2nw== X-UI-Out-Filterresults: notjunk:1;V01:K0:MbjRd5wnE4o=:Y4UyG80VQ7k/YOyeB6MCOi Im8/1S7qSRepiDhBcGDQlSFRjGT8CjdOX3cvEWkQ+hjGkcinq4Edcsf5DD/9TRv6kroeXLbd0 EPmRsPUPualeyp57QbXLc+H0QBnyAMPwR6Jod1nsa/bMnXQFdYtCLTQZWjNXsRmjuabhDQ1da CDjTLavtSeXywMZ8DymVgaqb9kWYBWP5O126AbzQ1sVHSK5XlCR8VE6YtQZ5/eZgWfdX+VOvq dHWMtcnOgYq3NaY/SjzhC2cm0A9j7TrQBRW6RrTabUC+gkavsFdogk/szAXRbxvVzHugccLZB TzH9Aszz0x36aOMnz489W2zCucyUXhqE23+nrBKbUoAI/JYs+Jp9KZ8RUzIip3RmZ5CcQTazs RCxsxIcyw5t1wY6J4jdiI0uWDG7z4dD89c2yLXYkVFlkC0XbEp0EXQt8U8SIZXcPS2cTxQ+TE An+qN4J7jG9VVLJaJvHzHDZAqJbuQIYMks4unTOL3NyUfxc3PmmUF2ysbijHXPLNDhMl9+Z1V xWHfCJrorKI8sTlHfqASTOBbfqiHS5ocTffJYccSYe8i6HTnbuKcLukNPasBz1TvnO462/rtn Tb6yr2+AYXPG8q98gbYfOh5qVCbH4/x1ZvRu5fMp3Z5YhaKEhmOzFe7y10xKuV5ZhnpV6yPh/ AT7GIo+WRdyq6uQn1PRbczroRm4kA33ILI/ef7yFdY18kmiGYv02zw3Nc6i4YMS+VnI0E5R+c 00pFdnhzouDZpW4V Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, September 13, 2016 9:48:55 AM CEST Peter Chen wrote: > On Mon, Sep 12, 2016 at 05:36:23PM +0200, Arnd Bergmann wrote: > > Moving the CONFIG_USB_ULPI_BUS option to the top-level Kconfig file > > means that we can enable it without any of the other USB support, > > leading to a build error because Kbuild never enters the > > drivers/usb/common/ directory without CONFIG_USB_COMMON: > > > > ERROR: "ulpi_unregister_driver" [drivers/phy/phy-tusb1210.ko] undefined! > > ERROR: "__ulpi_register_driver" [drivers/phy/phy-tusb1210.ko] undefined! > > ERROR: "ulpi_write" [drivers/phy/phy-tusb1210.ko] undefined! > > > > Thanks, Arnd. I have submitted the fix. > > https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/commit/?h=usb-next&id=6406c3d226374c28d452b11db3b5ac241ce26191 I see you used 'depends on USB_COMMON' though instead of 'select USB_COMMON'. This seems inconsistent with how we handle the other places after the patch I did earlier this year [see below]. It probably works fine for now, but having a mix of 'depends on' and 'select' can be confusing for users as well as create dependency loops that break the build. Arnd commit badf6d47f8a93098c6e05fdeb735b44b61877451 Author: Arnd Bergmann Date: Wed Mar 23 17:45:08 2016 +0100 usb: common: rework CONFIG_USB_COMMON logic The phy-am335x driver selects 'USB_COMMON', but all other drivers use 'depends on' for that symbol, and it depends on USB || USB_GADGET itself, which causes a Kconfig warning: warning: (AM335X_PHY_USB) selects USB_COMMON which has unmet direct dependencies (USB_SUPPORT && (USB || USB_GADGET)) As suggested by Felipe Balbi, this turns the logic around, and makes 'USB_COMMON' selected by everything else that needs it, so we can remove the dependencies. Fixes: 59f042f644c5 ("usb: phy: phy-am335x: bypass first VBUS sensing for host-only mode") Signed-off-by: Arnd Bergmann Acked-by: Felipe Balbi Reviewed-by: Peter Chen Signed-off-by: Felipe Balbi diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 26566db09de0..e92b97cd6056 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -250,7 +250,8 @@ config PHY_SUN9I_USB tristate "Allwinner sun9i SoC USB PHY driver" depends on ARCH_SUNXI && HAS_IOMEM && OF depends on RESET_CONTROLLER - depends on USB_COMMON + depends on USB_SUPPORT + select USB_COMMON select GENERIC_PHY help Enable this to support the transceiver that is part of Allwinner diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 8ed451dd651e..8689dcba5201 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig @@ -31,8 +31,6 @@ if USB_SUPPORT config USB_COMMON tristate - default y - depends on USB || USB_GADGET config USB_ARCH_HAS_HCD def_bool y @@ -41,6 +39,7 @@ config USB_ARCH_HAS_HCD config USB tristate "Support for Host-side USB" depends on USB_ARCH_HAS_HCD + select USB_COMMON select NLS # for UTF-8 strings ---help--- Universal Serial Bus (USB) is a specification for a serial bus diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index af5d922a8f5d..2057add439f0 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -15,6 +15,7 @@ menuconfig USB_GADGET tristate "USB Gadget Support" + select USB_COMMON select NLS help USB is a master/slave protocol, organized with one master