From patchwork Fri Mar 15 15:44:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 15384 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 2C5CE23EA8 for ; Fri, 15 Mar 2013 15:44:39 +0000 (UTC) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by fiordland.canonical.com (Postfix) with ESMTP id 6AD7AA19031 for ; Fri, 15 Mar 2013 15:44:38 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id fr13so1962194vbb.31 for ; Fri, 15 Mar 2013 08:44:37 -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:cc:subject:date:message-id:x-mailer :x-provags-id:x-gm-message-state; bh=Kp8bEblYetVqgn19s2pGrZ87BFPOn6h9Fb8nVUiYnkQ=; b=X2I6oZ0eE/DsDZ+nH1OtwgG6tdhNHERt6uqLhfG0gON2k5kAQdGU2p41BSnd87ZO5d OXCRL6zg5dp/ghHx6/M9vbM6IKf7AWgv8nymYn8W5XwitLuUYSvBjhFU4jviya2bc79M icUr/bzuonNYbmFEQqsIYYFW0q95B0VHNsdEARZkrxgKvYHUBi2EuSnTCQKu4LrrEmDG rkzpjUfT62bOIV5kXksmQUYS93xrLC9NFuexJexgH1GDZjKFIIRp8pURVaee1GM3JJPy 3nP8P8b4gjxsGB0RGLlq8ql2t1R+l9JH7EK4cH+4P/hTnxeiwZuoyBhlGwrAbcKv29fH PBjg== X-Received: by 10.221.0.199 with SMTP id nn7mr7115078vcb.14.1363362277809; Fri, 15 Mar 2013 08:44:37 -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 nf2csp126342veb; Fri, 15 Mar 2013 08:44:37 -0700 (PDT) X-Received: by 10.15.23.193 with SMTP id h41mr19518111eeu.17.1363362276462; Fri, 15 Mar 2013 08:44:36 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.10]) by mx.google.com with ESMTPS id r7si12098338eeo.232.2013.03.15.08.44.35 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 15 Mar 2013 08:44:36 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.10; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from wuerfel.lan (HSI-KBW-46-223-90-92.hsi.kabel-badenwuerttemberg.de [46.223.90.92]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MfDvq-1U4wCR1deM-00OD0O; Fri, 15 Mar 2013 16:44:17 +0100 From: Arnd Bergmann To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, patches@linaro.org, Arnd Bergmann , Alan Stern , Greg Kroah-Hartman , Roger Quadros , Andrew Lunn , Jason Cooper Subject: [RFC] USB: EHCI: hot-fix OMAP and Orion multiplatform config Date: Fri, 15 Mar 2013 16:44:07 +0100 Message-Id: <1363362247-9542-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.1.2 X-Provags-ID: V02:K0:r7Pj2/xVvqoLdM60cmuUdvt5OnhfT3N2sRoBA4Ewu2+ MAUzg3tRxuA7O08HA2o7TUyk5IwFI0a4dUNgxtCSelrYqDJnul +zA63XqEIyoN+ctEJUv2PFYS2jaULTm/g5QxH5OWYHHGm/JZiK ezjRUOO5PAvFZyRyfBQzKuZVpQ2zNkHFBhfhSYln1ZycQPMedX 4JKHn+bDGaNHxXb8ncf5IuLH33ccvP0e9JTbk9UT7pgAqM/vpb /Nk5jYC9WJdwTpOr55AITBuZtSkvmn2lRtTNXfn68Fs15eAAI4 /CP3BRdwj4Y+5xJYz96hLSKpwfdVSX3RMkpiFIQFlm6QPuc4d0 eybGfSHQsdB8FmAKL3PdUQC9Rpf38TX1MaVwq1zs6 X-Gm-Message-State: ALoCoQlirls/Zmii4UuC4BjFYmlAKfNSw4iOh82PlYKaHTex36psde1YArHupgNyAHjCg3s1KAl9 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 --- drivers/usb/host/ehci-hcd.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index dd1d41d..c750d71 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -1254,7 +1254,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 @@ -1274,7 +1274,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 @@ -1409,10 +1409,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 @@ -1423,6 +1433,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: @@ -1439,12 +1453,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