From patchwork Tue Jul 16 09:43:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 2828043 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 D671B9F7D6 for ; Tue, 16 Jul 2013 09:44:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D071620163 for ; Tue, 16 Jul 2013 09:44:42 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9118A2015F for ; Tue, 16 Jul 2013 09:44:41 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uz1oD-0002ln-FU; Tue, 16 Jul 2013 09:44:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uz1oB-0006ll-7e; Tue, 16 Jul 2013 09:44:35 +0000 Received: from mail-db8lp0185.outbound.messaging.microsoft.com ([213.199.154.185] helo=db8outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uz1o8-0006lC-Ds for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2013 09:44:33 +0000 Received: from mail150-db8-R.bigfish.com (10.174.8.250) by DB8EHSOBE025.bigfish.com (10.174.4.88) with Microsoft SMTP Server id 14.1.225.22; Tue, 16 Jul 2013 09:44:10 +0000 Received: from mail150-db8 (localhost [127.0.0.1]) by mail150-db8-R.bigfish.com (Postfix) with ESMTP id 6CD0F20230; Tue, 16 Jul 2013 09:44:10 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: -2 X-BigFish: VS-2(zz98dI1432Izz1f42h1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839h944hd25hd2bhf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1758h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1155h) Received: from mail150-db8 (localhost.localdomain [127.0.0.1]) by mail150-db8 (MessageSwitch) id 1373967813953059_4017; Tue, 16 Jul 2013 09:43:33 +0000 (UTC) Received: from DB8EHSMHS020.bigfish.com (unknown [10.174.8.230]) by mail150-db8.bigfish.com (Postfix) with ESMTP id D8F02140049; Tue, 16 Jul 2013 09:43:33 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB8EHSMHS020.bigfish.com (10.174.4.30) with Microsoft SMTP Server (TLS) id 14.16.227.3; Tue, 16 Jul 2013 09:43:33 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.3.136.1; Tue, 16 Jul 2013 09:45:47 +0000 Received: from nchen-desktop (nchen-desktop.ap.freescale.net [10.192.242.40]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r6G9hM0C008553; Tue, 16 Jul 2013 02:43:25 -0700 Date: Tue, 16 Jul 2013 17:43:21 +0800 From: Peter Chen To: Marek Vasut Subject: Re: [PATCH v12 00/13] Add tested id switch and vbus connect detect support for Chipidea Message-ID: <20130716094320.GA29679@nchen-desktop> References: <1373524041-10482-1-git-send-email-peter.chen@freescale.com> <201307120604.43642.marex@denx.de> <20130712082642.GB16202@nchen-desktop> <201307121518.31501.marex@denx.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201307121518.31501.marex@denx.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130716_054432_683039_9EFEBC7D X-CRM114-Status: GOOD ( 28.06 ) X-Spam-Score: -1.9 (-) Cc: m.grzeschik@pengutronix.de, frank.li@freescale.com, alexander.shishkin@linux.intel.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, mkl@pengutronix.de, kernel@pengutronix.de, maxime.ripard@free-electrons.com, shawn.guo@linaro.org, festevam@gmail.com, 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=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 On Fri, Jul 12, 2013 at 03:18:31PM +0200, Marek Vasut wrote: > Hi Peter, > > > On Fri, Jul 12, 2013 at 06:04:43AM +0200, Marek Vasut wrote: > > > Hi Peter, > > > > > > > On Thu, Jul 11, 2013 at 07:57:19PM +0200, Marek Vasut wrote: > > > > > Hi Peter, > > > > > > > > > > > This patchset adds tested otg id switch function and > > > > > > vbus connect and disconnect detection for chipidea driver. > > > > > > And fix kinds of bugs found at chipidea drivers after enabling > > > > > > id and vbus detection. > > > > > > > > > > > > This patch is fully tested at imx6 sabresd platform. > > > > > > My chipidea repo: https://github.com/hzpeterchen/linux-usb.git > > > > > > > > > > > > Changes for v12: > > > > > > - Rebased greg's usb-next tree (3.10.0-rc7+) > > > > > > - Split more small patches for single function and fix. > > > > > > > > > > I tested the patchset. Here are the results: > > > > > > > > > > - VBUS switching > > > > > > > > > > I'm no longer getting any ID interrupts at all when I apply the patch > > > > > below. The board stays in HOST mode all the time. If I configure it > > > > > as peripheral, it works as peripheral. Note with [1], I was able to > > > > > switch from Peripheral->Host , not the other way around. > > > > > > > > Thanks for your testing. But first, can you have me check > > > > if your ID wakeup is enabled? > > > > > > ID wakeup? How do I check? > > > > See otgsc at controller register, the ID wakeup enable is bit 24. > > Yes, ID interrupt (IDIE) is set. > > I noticed this backtrace in the kernel bootlog, but this only happens if the > dr_mode="otg" , it comes from the host-mode irq handler : > > [ 2.757563] irq 238: nobody cared (try booting with the "irqpoll" option) > [ 2.764398] CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.0- > next-20130711-00013-g011c4b3-dirty #703 > [ 2.773445] [<80013878>] (unwind_backtrace+0x0/0xe8) from [<80011644>] > (show_stack+0x10/0x14) > [ 2.782027] [<80011644>] (show_stack+0x10/0x14) from [<800659f4>] > (__report_bad_irq.isra.6+0x20/0xe0) > [ 2.791286] [<800659f4>] (__report_bad_irq.isra.6+0x20/0xe0) from > [<80065c98>] (note_interrupt+0x16c/0x230) > [ 2.801063] [<80065c98>] (note_interrupt+0x16c/0x230) from [<80064000>] > (handle_irq_event_percpu+0x10c/0x1a4) > [ 2.811010] [<80064000>] (handle_irq_event_percpu+0x10c/0x1a4) from > [<800640e8>] (handle_irq_event+0x50/0x78) > [ 2.820958] [<800640e8>] (handle_irq_event+0x50/0x78) from [<8006652c>] > (handle_level_irq+0x88/0x10c) > [ 2.830210] [<8006652c>] (handle_level_irq+0x88/0x10c) from [<800638d0>] > (generic_handle_irq+0x28/0x3c) > [ 2.839637] [<800638d0>] (generic_handle_irq+0x28/0x3c) from [<8000f84c>] > (handle_IRQ+0x30/0x84) > [ 2.848461] [<8000f84c>] (handle_IRQ+0x30/0x84) from [<80012160>] > (__irq_svc+0x40/0x6c) > [ 2.856510] [<80012160>] (__irq_svc+0x40/0x6c) from [<80022a44>] > (__do_softirq+0x90/0x1d8) > [ 2.864812] [<80022a44>] (__do_softirq+0x90/0x1d8) from [<80022edc>] > (irq_exit+0x98/0xd4) > [ 2.873025] [<80022edc>] (irq_exit+0x98/0xd4) from [<8000f850>] > (handle_IRQ+0x34/0x84) > [ 2.880980] [<8000f850>] (handle_IRQ+0x34/0x84) from [<80012160>] > (__irq_svc+0x40/0x6c) > [ 2.889020] [<80012160>] (__irq_svc+0x40/0x6c) from [<8001d724>] > (vprintk_emit+0x1bc/0x524) > [ 2.897411] [<8001d724>] (vprintk_emit+0x1bc/0x524) from [<804da5a4>] > (printk+0x30/0x40) > [ 2.905551] [<804da5a4>] (printk+0x30/0x40) from [<80630138>] > (mousedev_init+0x4c/0x60) > [ 2.913617] [<80630138>] (mousedev_init+0x4c/0x60) from [<806178fc>] > (do_one_initcall+0x94/0x14c) > [ 2.922537] [<806178fc>] (do_one_initcall+0x94/0x14c) from [<80617b20>] > (kernel_init_freeable+0x16c/0x22c) > [ 2.932230] [<80617b20>] (kernel_init_freeable+0x16c/0x22c) from [<804d8cbc>] > (kernel_init+0x8/0x150) > [ 2.941486] [<804d8cbc>] (kernel_init+0x8/0x150) from [<8000ea70>] > (ret_from_fork+0x14/0x24) > [ 2.949932] handlers: > [ 2.952227] [<8033fc58>] ci_irq > [ 2.955388] Disabling IRQ #238 > Marek, I have a test at imx28evk (Freescale imx28evk) for this patchset, it works well for dual-role switch after adding below dts change. There is a kernel dump when works at udc mode(due to enable CONFIG_LOCKUP_DETECTOR), at the first connect, but it does not affect function, it should be a common chipidea problem, I will check later. diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts index 3637bf3..e8e2f09 100644 --- a/arch/arm/boot/dts/imx28-evk.dts +++ b/arch/arm/boot/dts/imx28-evk.dts @@ -240,6 +240,8 @@ ahb@80080000 { usb0: usb@80080000 { vbus-supply = <®_usb0_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&usbphy0_pins_c>; status = "okay"; }; diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi index 600f7cb..a11e015 100644 --- a/arch/arm/boot/dts/imx28.dtsi +++ b/arch/arm/boot/dts/imx28.dtsi @@ -657,6 +657,16 @@ fsl,pull-up = <0>; }; + usbphy0_pins_c: usbphy0@2 { + reg = <2>; + fsl,pinmux-ids = < + 0x3071 /* MX28_PAD_AUART1_RTS__USB0_ID */ + >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <1>; + }; + usbphy1_pins_a: usbphy1@0 { reg = <0>; fsl,pinmux-ids = <