From patchwork Thu May 2 17:30:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Stern X-Patchwork-Id: 2513291 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id D06963FCA5 for ; Thu, 2 May 2013 17:30:46 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXxLB-0006I6-C7; Thu, 02 May 2013 17:30:45 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXxL9-00066l-Fj; Thu, 02 May 2013 17:30:43 +0000 Received: from iolanthe.rowland.org ([192.131.102.54]) by merlin.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXxL6-00065z-Bs for linux-arm-kernel@lists.infradead.org; Thu, 02 May 2013 17:30:40 +0000 Received: (qmail 2492 invoked by uid 2102); 2 May 2013 13:30:17 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 2 May 2013 13:30:17 -0400 Date: Thu, 2 May 2013 13:30:17 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Arnd Bergmann Subject: Re: [PATCH, RFC 16/22] USB: UHCI: clarify Kconfig dependencies In-Reply-To: <1367507786-505303-17-git-send-email-arnd@arndb.de> Message-ID: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130502_133040_480553_F4806B70 X-CRM114-Status: GOOD ( 24.45 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Thu, 2 May 2013, Arnd Bergmann wrote: > The UHCI driver currently gives a build error if the base driver is > enabled but none of the three bus glues are turned on: > > drivers/usb/host/uhci-hcd.c:857:2: error: #error "missing bus glue for uhci-hcd" > > A better solution for this is to change the Kconfig statements to > prevent getting into this situation. This adds a new USB_UHCI_CORE > symbol in Kconfig, which is selected by each of the three bus glues. > This way, the driver never gets built if all three of them are disabled. I had already worked out a patch on my own for this (below). It is different from yours in several ways: It relies more on "depends" than "select". I don't know how important this is in the end. It doesn't add a new USB_UHCI_GRLIB symbol; instead it uses SPARC_LEON in several places. I tend to think the new symbol is nicer. It doesn't add a new USB_UHCI_PCI symbol. It improves the dependency list for USB_UHCI_HCD. It removes the help text for USB_UHCI_PLATFORM, thereby making that symbol not user-configurable. I don't see any reason why the user should need to worry about this -- the choice should be a very simple one: build UHCI support or don't build it. If the user chooses to build it then it should include support for all the compatible bus glues. (This last decision may need to be changed if more bus glues get added.) It prevents situations where USB_UHCI_HCD is enabled but the driver doesn't get built. It creates a bunch of USB_UHCI_* symbols even when USB_UHCI_HCD is disabled. This is a disadvantage, but I don't see any way around it. Basically, we have to consider two separate but related questions: Does the supported hardware configuration allow for UHCI? Which types of UHCI bus glue support should be included in the kernel? If the answer to the first is Yes then creating these symbols seems unavoidable, even when the answer to the second is None. Maybe the ideal solution is some sort of combination of the two patches. What do you think of my patch as compared to yours? And what do you think of the "depends" vs. "select" issue? Alan Stern Index: usb-3.9/drivers/usb/host/Kconfig =================================================================== --- usb-3.9.orig/drivers/usb/host/Kconfig +++ usb-3.9/drivers/usb/host/Kconfig @@ -507,7 +507,7 @@ endif # USB_OHCI_HCD config USB_UHCI_HCD tristate "UHCI HCD (most Intel and VIA) support" - depends on PCI || SPARC_LEON || ARCH_VT8500 + depends on PCI || USB_UHCI_SUPPORT_NON_PCI_HC ---help--- The Universal Host Controller Interface is a standard by Intel for accessing the USB hardware in the PC (which is also called the USB @@ -524,26 +524,19 @@ config USB_UHCI_HCD config USB_UHCI_SUPPORT_NON_PCI_HC bool - depends on USB_UHCI_HCD - default y if (SPARC_LEON || ARCH_VT8500) + default y if (SPARC_LEON || USB_UHCI_PLATFORM) config USB_UHCI_PLATFORM - bool "Generic UHCI Platform Driver support" - depends on USB_UHCI_SUPPORT_NON_PCI_HC + bool default y if ARCH_VT8500 - ---help--- - Enable support for generic UHCI platform devices that require no - additional configuration. config USB_UHCI_BIG_ENDIAN_MMIO bool - depends on USB_UHCI_SUPPORT_NON_PCI_HC && SPARC_LEON - default y + default y if SPARC_LEON config USB_UHCI_BIG_ENDIAN_DESC bool - depends on USB_UHCI_SUPPORT_NON_PCI_HC && SPARC_LEON - default y + default y if SPARC_LEON config USB_FHCI_HCD tristate "Freescale QE USB Host Controller support"