From patchwork Fri Oct 23 12:50:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 7473111 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8D5259F71A for ; Fri, 23 Oct 2015 12:52:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB723209A9 for ; Fri, 23 Oct 2015 12:52:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA06320808 for ; Fri, 23 Oct 2015 12:52:28 +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 1Zpbo5-0007aG-M7; Fri, 23 Oct 2015 12:50:53 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zpbo1-0007XW-S3 for linux-arm-kernel@lists.infradead.org; Fri, 23 Oct 2015 12:50:50 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t9NCoOnJ003316; Fri, 23 Oct 2015 07:50:24 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9NCoO3I028332; Fri, 23 Oct 2015 07:50:24 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Fri, 23 Oct 2015 07:50:24 -0500 Received: from [172.22.234.14] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9NCoLTd018068; Fri, 23 Oct 2015 07:50:22 -0500 Subject: Re: MUSB peripheral DMA regression caused by driver core runtime PM change To: Tony Lindgren , Felipe Balbi References: <20151021234134.GQ3078@atomide.com> <20151022180216.GT3078@atomide.com> <20151022230133.GV3078@atomide.com> From: Grygorii Strashko Message-ID: <562A2D0D.3060104@ti.com> Date: Fri, 23 Oct 2015 15:50:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151022230133.GV3078@atomide.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151023_055050_010636_C14EB4F5 X-CRM114-Status: GOOD ( 11.32 ) X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heikki Krogerus , "Rafael J. Wysocki" , Andy Shevchenko , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Lee Jones , Bin Liu , linux-arm-kernel@lists.infradead.org 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.2 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 10/23/2015 02:01 AM, Tony Lindgren wrote: > * Tony Lindgren [151022 11:03]: >> * Tony Lindgren [151021 16:44]: >>> Hi all, >>> >>> I noticed a regresssino in v4.3-rc series to day with MUSB gadgets >>> and DMA. Doing a git bisect between v4.2..v4.3-rc1 on it pointed to: >>> >>> ddef08dd00f5 ("Driver core: wakeup the parent device before trying probe") >>> >>> With the commit above reverted things work fine with DMA and USB gadgets. >>> >>> This is on omap3 with CONFIG_USB_INVENTRA_DMA selected. Selecting >>> CONFIG_MUSB_PIO_ONLY still works even without reverting ddef08dd00f5. >>> >>> Anybody got ideas what might be wrong? Some wrong runtime PM usage >>> under drivers/usb/musb? >> >> Here's some more debug info on where things are different initializing >> the USB gadgets. I added some printks and diffed the dmesg output. The >> added calls from commit ddef08dd00f5 start with dd: > > Well turns out the problem actually happens earlier. We end up calling > omap2430_runtime_resume with NULL struct musb while EPROBE_DEFER > probing. > > No ideas yet how it should be fixed though. > I'm not sure, but below diff might help diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 70f2b8a..aba8ca7 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -391,6 +391,8 @@ static int omap2430_musb_init(struct musb *musb) } musb->isr = omap2430_musb_interrupt; + pm_runtime_enable(glue->dev); + status = pm_runtime_get_sync(dev); if (status < 0) { dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status); @@ -626,8 +628,6 @@ static int omap2430_probe(struct platform_device *pdev) goto err2; } - pm_runtime_enable(&pdev->dev); - ret = platform_device_add(musb); if (ret) { dev_err(&pdev->dev, "failed to register musb device\n");