From patchwork Fri Apr 4 14:34:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 27840 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B403820490 for ; Fri, 4 Apr 2014 14:36:14 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id j17sf11002048oag.6 for ; Fri, 04 Apr 2014 07:36:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=GRYpiYkTq3qYqn0YmtKFOoi2PjojX5PdBoP6/DzTQc4=; b=fEZrvytKOY76LANeyljwnA2q92S4/IIPSX/HQmmRQKgNXH7aiYpdH3djjpyz82kbEh 9vHOiaJkx0g18SWAL+kkOWS8xNUy22dlNRawmCJGuv6mjxDNl7/tg8lGLY0f7H4bahqW TjIqty2h3xUnoJ02W1OqE+yhNlkJ3h6XyOIjtDv8oSIc5qwbzBIqNl4XqiZPnTjHAoA1 19Q9RZijBqGFocRsRjR/IhPin4fWELiki1sdwzAPbweijjT9Hz7gtr54vwNWgBBjmCWO HSaIt0PWK4sNMQCZyaSmlStyN2PbLtWryDE+gN6QTK594CZrohsLXBOLt7/QjpkaycLl MEcg== X-Gm-Message-State: ALoCoQn96WrViOYNV6If70fpLhzklePq5IrRG74YDQ3SoTDyb0udXBIw2nNtDkD9edsqOAUtIohJ X-Received: by 10.43.161.202 with SMTP id mh10mr6842674icc.23.1396622174204; Fri, 04 Apr 2014 07:36:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.131 with SMTP id l3ls1080423qgf.40.gmail; Fri, 04 Apr 2014 07:36:14 -0700 (PDT) X-Received: by 10.221.34.7 with SMTP id sq7mr6064022vcb.5.1396622174060; Fri, 04 Apr 2014 07:36:14 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id vv9si1783836vcb.199.2014.04.04.07.36.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 07:36:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so1528928veb.32 for ; Fri, 04 Apr 2014 07:36:13 -0700 (PDT) X-Received: by 10.58.134.101 with SMTP id pj5mr298468veb.38.1396622173941; Fri, 04 Apr 2014 07:36:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp119123vcv; Fri, 4 Apr 2014 07:36:13 -0700 (PDT) X-Received: by 10.66.246.229 with SMTP id xz5mr15392812pac.119.1396622171768; Fri, 04 Apr 2014 07:36:11 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id td10si4669825pac.427.2014.04.04.07.36.11; Fri, 04 Apr 2014 07:36:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753398AbaDDOgJ (ORCPT + 3 others); Fri, 4 Apr 2014 10:36:09 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:33481 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752881AbaDDOgI (ORCPT ); Fri, 4 Apr 2014 10:36:08 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s34Ea6o5023305; Fri, 4 Apr 2014 09:36:06 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s34Ea68f024003; Fri, 4 Apr 2014 09:36:06 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 4 Apr 2014 09:36:06 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s34Ea5Yn010977; Fri, 4 Apr 2014 09:36:06 -0500 Date: Fri, 4 Apr 2014 09:34:04 -0500 From: Felipe Balbi To: Stefan Roese CC: Subject: Re: MUSB/OMAP: gadget does not start when cable is plugged after the driver is started Message-ID: <20140404143404.GA8026@saruman.home> Reply-To: References: <533E6302.7070904@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <533E6302.7070904@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On Fri, Apr 04, 2014 at 09:45:06AM +0200, Stefan Roese wrote: > Hi! > > I'm currently seeing a problem on an OMAP3530 based board (Technexion > TAO3530). Where the MUSB is configured as device/peripheral and the ethernet > gadget is compiled into the kernel. This works without any problems and usb0 > is available when the USB cable is connected to a PC upon startup. But when > the cable is disconnected when the driver is started (doesn't matter if the > gadget is included in the kernel or if the gadget driver module is loaded) > and the cable is plugged in later, the ethernet gadget does not start up. > This is 100% reproducible. > > Before digging deeper into this, I wanted to check here if this is a known > issue. And if anybody already has a solution/hint for it. > > FYI: I'm using v3.14 right now. Can you see if this helps ? commit e8fbe7b90021960907e885e0b7a9b52d378b0202 Author: Felipe Balbi Date: Fri Mar 28 14:31:47 2014 -0500 usb: musb: fix PHY power on/off commi 30a70b0 (usb: musb: fix obex in g_nokia.ko causing kernel panic) removed phy_power_on() and phy_power_off() calls from runtime PM callbacks but it failed to note that the driver depended on pm_runtime_get_sync() calls to power up the PHY, thus leaving some platforms without any means to have a working PHY. Fix that by enabling the phy during omap2430_musb_init() and killing it in omap2430_musb_exit(). Fixes: 30a70b0 (usb: musb: fix obex in g_nokia.ko causing kernel panic) Cc: # v3.14 Cc: Pali Rohár Cc: Ivaylo Dimitrov Reported-by: Michael Scott Tested-by: Michael Scott Reported-by: Rabin Vincent Signed-off-by: Felipe Balbi Tested-by: Stefan Roese diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index d341c14..819a7cd 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -416,6 +416,7 @@ static int omap2430_musb_init(struct musb *musb) omap_musb_set_mailbox(glue); phy_init(musb->phy); + phy_power_on(musb->phy); pm_runtime_put_noidle(musb->controller); return 0; @@ -478,6 +479,7 @@ static int omap2430_musb_exit(struct musb *musb) del_timer_sync(&musb_idle_timer); omap2430_low_level_exit(musb); + phy_power_off(musb->phy); phy_exit(musb->phy); return 0;