From patchwork Mon Mar 18 15:48:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 15408 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8D32423E3E for ; Mon, 18 Mar 2013 15:49:06 +0000 (UTC) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by fiordland.canonical.com (Postfix) with ESMTP id 0C8E6A18135 for ; Mon, 18 Mar 2013 15:49:05 +0000 (UTC) Received: by mail-vb0-f51.google.com with SMTP id fq11so3399376vbb.24 for ; Mon, 18 Mar 2013 08:49:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id:x-provags-id:x-gm-message-state; bh=F+N4+Qx5qih46/SvUpKCcXOXfO/d9YyFPbEmnBt77Ok=; b=DR9/nhnnKh0j2L4Aq3jzHCSKRqyhFo0sSHT/jZuscjljOfTiO88cZxxZsPviYdf+QL yC72N1dmidwK3AR5HUYjmJHQqXGsuUN4FK8BpsqRakhuRDgjJQtwahdukJxBD2NY4uaH LoETbVV3tVgycnfDemQczW5llh6fo7FvehN+pP1PNhhhCmECMI55+2NSVg6AK9FVAAIX ws2wchz0uK103xfqFYSNCPMgka5XhPtjBalJxdaAj9uZagRCRdMCjWD/jTXmbMOc9Naz cm+MkktjLlE5udx6My3of+YwdVdK+3rB+Cz8EyfgoSIK9zig4AYSn7yF37Sa4y563k6N BXHQ== X-Received: by 10.52.177.163 with SMTP id cr3mr17728369vdc.94.1363621745494; Mon, 18 Mar 2013 08:49:05 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp30763veb; Mon, 18 Mar 2013 08:49:04 -0700 (PDT) X-Received: by 10.14.5.6 with SMTP id 6mr50197078eek.42.1363621743894; Mon, 18 Mar 2013 08:49:03 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.9]) by mx.google.com with ESMTPS id t43si29298547eeg.196.2013.03.18.08.49.03 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Mar 2013 08:49:03 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.17.9 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.9; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.9 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from klappe2.localnet (HSI-KBW-46-223-90-92.hsi.kabel-badenwuerttemberg.de [46.223.90.92]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Lfps2-1V5kwR3d98-00pGoQ; Mon, 18 Mar 2013 16:48:14 +0100 From: Arnd Bergmann To: "Greg Kroah-Hartman" Subject: [PATCH v2] USB: EHCI: hot-fix OMAP and Orion multiplatform config Date: Mon, 18 Mar 2013 15:48:09 +0000 User-Agent: KMail/1.12.2 (Linux/3.8.0-8-generic; KDE/4.3.2; x86_64; ; ) Cc: Mike Frysinger , andrew.wafaa@opensuse.org, debian-arm@lists.debian.org, Alan Stern , Manjunath Goudar , USB list , linux-arm-kernel@lists.infradead.org, patches@linaro.org, Roger Quadros , Andrew Lunn , Jason Cooper , Alexey Charkov , Peter Robinson References: <201303151700.27231.arnd@arndb.de> <20130316000936.GB10166@kroah.com> <201303181545.18083.arnd@arndb.de> In-Reply-To: <201303181545.18083.arnd@arndb.de> MIME-Version: 1.0 Message-Id: <201303181548.10140.arnd@arndb.de> X-Provags-ID: V02:K0:3ilpnwqK9p5pinGmi63OHYnKRPOEQiiS6GSUi1n474D UB/G6NLmupOIDYI5JIbf0Vl0OOhdaavunJKyWc8srht9xhpniY ZX5m+d3b17mnBW8Ma6bT0zjweNMzK8xscFP+yspGijc0wUI0Hr 1Qtwf+FTWIXJ8B7Ff5Wsq+67j2Ai2p5uPJ79WisuQ0qGvsEIuV zLdu/kQIEBjRfY33q3KmNt51Oz1XBPJwRac+se+Gd3ToLohm22 jNM7c0ceESoTwmmY4KbH44CTziewhkmL5hrcy1k99U8+IjzBwg Ksx1sAlIAP7UGL2J2TZbmfA21inY+qagE2yR4UBsNw1Mqt7yeG YM1J+282oascwkFzSKy4= X-Gm-Message-State: ALoCoQmhkt7kcCyK20PeCuABO1zPp33mmczvF61iPH/b/VHTxM2bqVsPY+7T5ddKAZsdQrLBFq0W A number of ARM platforms were changed in linux-3.9 so they can be enabled at a single kernel configuration. Unfortunately, the necessary changes for the EHCI driver were not ready in time and the first attempt to split out the EHCI bus glues into separate modules had to get reverted before the merge window. This means we are still stuck with a situation where enabling any combination of more than one of the OMAP, MVEBU/Orion and VT8500/WM8x50 platforms at the same time leaves us with an EHCI driver that does not work properly and spits out this build warning: ehci-hcd.c:1277:0: warning: "PLATFORM_DRIVER" redefined [enabled by default] ehci-hcd.c:1257:0: note: this is the location of the previous definition ehci-hcd.c:1297:0: warning: "PLATFORM_DRIVER" redefined [enabled by default] ehci-hcd.c:1277:0: note: this is the location of the previous definition In file included from ehci-hcd.c:1256:0: ehci-omap.c:311:31: warning: 'ehci_hcd_omap_driver' defined but not used [-Wunused-variable] In file included from ehci-hcd.c:1276:0: ehci-orion.c:334:31: warning: 'ehci_orion_driver' defined but not used [-Wunused-variable] ehci-hcd.c:1277:0: warning: "PLATFORM_DRIVER" redefined [enabled by default] ehci-hcd.c:1257:0: note: this is the location of the previous definition ehci-hcd.c:1297:0: warning: "PLATFORM_DRIVER" redefined [enabled by default] ehci-hcd.c:1277:0: note: this is the location of the previous definition This is the simplest patch I could come up with that will restore some sanity in multiplatform configuration and allow us to build an ARM allyesconfig kernel. Disallowing the broken configuration in Kconfig would actually end up in a larger patch and more regression potential than this one. We had a similar situation in 3.8 with a conflict between Orion and MXC, and Alan Stern objected to the simple hack back then and instead provided a better full conversion of the MXC backend in patch dba63b2f7. A proper patch for OMAP was submitted in January but also did not make it into 3.9, see https://patchwork.kernel.org/patch/2055131. I expect that for 3.10 we will be able to do this correctly and turn all ARM bus glues into separate modules, ripping out the code that this patch changes. Signed-off-by: Arnd Bergmann Cc: Alan Stern Cc: Greg Kroah-Hartman Cc: Roger Quadros Cc: Andrew Lunn CC: Jason Cooper --- changes since RFC v1: * fix ORION_PLATFORM_DRIVER registration * rebase on top of usb-linus branch drivers/usb/host/ehci-hcd.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 416a6dc..f98f2a2 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -1253,7 +1253,7 @@ MODULE_LICENSE ("GPL"); #ifdef CONFIG_USB_EHCI_HCD_OMAP #include "ehci-omap.c" -#define PLATFORM_DRIVER ehci_hcd_omap_driver +#define OMAP_PLATFORM_DRIVER ehci_hcd_omap_driver #endif #ifdef CONFIG_PPC_PS3 @@ -1273,7 +1273,7 @@ MODULE_LICENSE ("GPL"); #ifdef CONFIG_PLAT_ORION #include "ehci-orion.c" -#define PLATFORM_DRIVER ehci_orion_driver +#define ORION_PLATFORM_DRIVER ehci_orion_driver #endif #ifdef CONFIG_USB_W90X900_EHCI @@ -1385,6 +1385,12 @@ static int __init ehci_hcd_init(void) goto clean0; #endif +#ifdef ORION_PLATFORM_DRIVER + retval = platform_driver_register(&ORION_PLATFORM_DRIVER); + if (retval < 0) + goto clean1; +#endif + #ifdef PS3_SYSTEM_BUS_DRIVER retval = ps3_ehci_driver_register(&PS3_SYSTEM_BUS_DRIVER); if (retval < 0) @@ -1402,10 +1408,20 @@ static int __init ehci_hcd_init(void) if (retval < 0) goto clean4; #endif + +#ifdef OMAP_PLATFORM_DRIVER + retval = platform_driver_register(&OMAP_PLATFORM_DRIVER); + if (retval < 0) + goto clean5; +#endif return retval; +#ifdef OMAP_PLATFORM_DRIVER + /* platform_driver_unregister(&OMAP_PLATFORM_DRIVER); */ +clean5: +#endif #ifdef XILINX_OF_PLATFORM_DRIVER - /* platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); */ + platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); clean4: #endif #ifdef OF_PLATFORM_DRIVER @@ -1416,6 +1432,10 @@ clean3: ps3_ehci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER); clean2: #endif +#ifdef ORION_PLATFORM_DRIVER + platform_driver_unregister(&ORION_PLATFORM_DRIVER); +clean1: +#endif #ifdef PLATFORM_DRIVER platform_driver_unregister(&PLATFORM_DRIVER); clean0: @@ -1432,12 +1452,18 @@ module_init(ehci_hcd_init); static void __exit ehci_hcd_cleanup(void) { +#ifdef OMAP_PLATFORM_DRIVER + platform_driver_unregister(&OMAP_PLATFORM_DRIVER); +#endif #ifdef XILINX_OF_PLATFORM_DRIVER platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); #endif #ifdef OF_PLATFORM_DRIVER platform_driver_unregister(&OF_PLATFORM_DRIVER); #endif +#ifdef ORION_PLATFORM_DRIVER + platform_driver_unregister(&ORION_PLATFORM_DRIVER); +#endif #ifdef PLATFORM_DRIVER platform_driver_unregister(&PLATFORM_DRIVER); #endif