From patchwork Sat May 10 13:18:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4148271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E4C469F23C for ; Sat, 10 May 2014 13:22:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 197B0201E7 for ; Sat, 10 May 2014 13:22:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E915D2012B for ; Sat, 10 May 2014 13:22:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wj7BL-0005pe-7v; Sat, 10 May 2014 13:19:15 +0000 Received: from mail-bn1lp0141.outbound.protection.outlook.com ([207.46.163.141] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wj7BI-0005oU-H3 for linux-arm-kernel@lists.infradead.org; Sat, 10 May 2014 13:19:13 +0000 Received: from DM2PR03CA010.namprd03.prod.outlook.com (10.141.52.158) by BL2PR03MB178.namprd03.prod.outlook.com (10.255.230.150) with Microsoft SMTP Server (TLS) id 15.0.939.12; Sat, 10 May 2014 13:18:48 +0000 Received: from BL2FFO11FD011.protection.gbl (2a01:111:f400:7c09::188) by DM2PR03CA010.outlook.office365.com (2a01:111:e400:2414::30) with Microsoft SMTP Server (TLS) id 15.0.939.12 via Frontend Transport; Sat, 10 May 2014 13:18:48 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD011.mail.protection.outlook.com (10.173.161.17) with Microsoft SMTP Server (TLS) id 15.0.939.9 via Frontend Transport; Sat, 10 May 2014 13:18:47 +0000 Received: from dragon ([10.192.185.51]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s4ADIaCw018170; Sat, 10 May 2014 06:18:37 -0700 Date: Sat, 10 May 2014 21:18:36 +0800 From: Shawn Guo To: Peter Chen Subject: Re: i.MX6 USB OTG support is broken on linux-next Message-ID: <20140510131815.GT2794@dragon> References: <20140509130046.GP2794@dragon> <20140510111003.GA1593@shlinux1.ap.freescale.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140510111003.GA1593@shlinux1.ap.freescale.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009001)(6009001)(51704005)(189002)(199002)(51914003)(24454002)(69596002)(46406003)(68736004)(54356999)(84676001)(77096999)(83506001)(76176999)(50986999)(4396001)(76482001)(33656001)(64706001)(77982001)(46102001)(81156002)(21056001)(33716001)(87936001)(97736001)(97756001)(83322001)(83072002)(86362001)(20776003)(99396002)(80022001)(81542001)(2009001)(74502001)(85852003)(57986002)(50466002)(23726002)(44976005)(92566001)(81342001)(79102001)(6806004)(31966008)(92726001)(47776003)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB178; H:az84smr01.freescale.net; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Forefront-PRVS: 02070414A1 Received-SPF: Fail (: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=Shawn.Guo@freescale.com; X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140510_061912_726435_06B48658 X-CRM114-Status: GOOD ( 24.00 ) X-Spam-Score: -0.0 (/) Cc: Fabio Estevam , David Brownell , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Felipe Balbi , Denis Carikli , Li Jun , Robin Getz , kernel@pengutronix.de, 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 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP + Robin and David, On Sat, May 10, 2014 at 07:10:05PM +0800, Peter Chen wrote: > On Fri, May 09, 2014 at 09:00:47PM +0800, Shawn Guo wrote: > > I'm running next-20140508 kernel on imx6q-sabresd board with USB > > mouse/keyboard connected to OTG port. It works well on 3.15-rc but > > is broken on recent linux-next kernel with the message like below. > > > > ... > > usb 1-1: device v413c p2107 is not supported > > hub 1-0:1.0: unable to enumerate USB device on port 1 > > > > With the help from Peter, I found that the issue shows up only when > > CONFIG_USB_OTG_FSM is enabled. The option is enabled by commit 8fd2f1f > > (ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support.) > > from IMX tree. > > > > I guess this is a sign that chipidea otg_fsm driver is buggy? I do not > > think dropping CONFIG_USB_OTG_FSM selection from imx_v6_v7_defconfig is > > a solution, and we need to fix the issue in usb driver, right? > > > > No, Shawn. The solution of this problem is drop CONFIG_USB_OTG_FSM, I > guess Denis added it wrongly. > > According to Embedded Hosts & OTG spec, OTG devices and Embedded Hosts > both have Targeted Host functionality, and each Targeted Host has > its TPL (Targeted Peripheral List), only the devices are at TPL > are supported by Targeted Host. > > Current Linux TPL only contains limited devices, each Targeted Host > needs to update its TPL when it makes product, (The comments at > otg_whitelist.h also mention it), and the devices are not at TPL > will not be supported, and will report to user as "an unsupported > device" error, at current Linux configuration, once the CONFIG_USB_OTG_FSM > and CONFIG_USB_OTG are chosen, the host will be Targeted Host. > > The reason why Shawn met this problem is: the imx_v6_v7_defconfig set > CONFIG_USB_OTG_FSM, so the CONFIG_USB_OTG and CONFIG_USB_OTG_WHITELIST > are set according to dependency, it makes imx6 device as Targeted Host, > but the devices connected at Shawn's board are not at TPL, so they are > not be supported. > > In a word the CONFIG_USB_OTG_FSM should not be chosen for > defauly kernel configuration. The CONFIG_USB_OTG_FSM should only be chosen > by default when this device goes to make product and the TPL is updated > accordingly. Thanks for the explanation, Peter. So this is what I see from USB Kconfig. config USB_OTG_FSM tristate "USB 2.0 OTG FSM implementation" depends on USB select USB_OTG select USB_PHY config USB_OTG_WHITELIST bool "Rely on OTG Targeted Peripherals List" depends on USB_OTG || EXPERT default y if USB_OTG I see that USB_OTG_FSM has a dependency on USB_OTG, and USB_OTG_WHITELIST depends on USB_OTG, but USB_OTG does *not* depends on USB_OTG_WHITELIST. I'm not sure why we have 'default y if USB_OTG' for USB_OTG_WHITELIST, when this option only makes sense for product producers per your explanation. So maybe dropping the 'default y' is the right fix? Shawn diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index cb8e991..9081757 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig @@ -65,7 +65,6 @@ config USB_OTG config USB_OTG_WHITELIST bool "Rely on OTG Targeted Peripherals List" depends on USB_OTG || EXPERT - default y if USB_OTG help If you say Y here, the "otg_whitelist.h" file will be used as a product whitelist, so USB peripherals not listed there will be