From patchwork Tue Jul 10 03:14:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 1175691 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 8A23DDFFAD for ; Tue, 10 Jul 2012 03:21:08 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SoQuo-0002V4-Ag; Tue, 10 Jul 2012 03:15:06 +0000 Received: from ch1ehsobe005.messaging.microsoft.com ([216.32.181.185] helo=ch1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SoQuW-0002Uq-UM for linux-arm-kernel@lists.infradead.org; Tue, 10 Jul 2012 03:14:50 +0000 Received: from mail39-ch1-R.bigfish.com (10.43.68.230) by CH1EHSOBE006.bigfish.com (10.43.70.56) with Microsoft SMTP Server id 14.1.225.23; Tue, 10 Jul 2012 03:12:13 +0000 Received: from mail39-ch1 (localhost [127.0.0.1]) by mail39-ch1-R.bigfish.com (Postfix) with ESMTP id 6E2DEE00F2; Tue, 10 Jul 2012 03:12:13 +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(zz98dI1432Izz1202hzz8275bhz2dh2a8h668h839h944hd25hf0ah107ah) Received: from mail39-ch1 (localhost.localdomain [127.0.0.1]) by mail39-ch1 (MessageSwitch) id 134188993258644_22475; Tue, 10 Jul 2012 03:12:12 +0000 (UTC) Received: from CH1EHSMHS025.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.252]) by mail39-ch1.bigfish.com (Postfix) with ESMTP id 0B30C4A0176; Tue, 10 Jul 2012 03:12:12 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS025.bigfish.com (10.43.70.25) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 10 Jul 2012 03:12:11 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.298.5; Mon, 9 Jul 2012 22:14:28 -0500 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id q6A3ELWs007057; Mon, 9 Jul 2012 20:14:22 -0700 Date: Tue, 10 Jul 2012 11:14:27 +0800 From: Richard Zhao To: , , Subject: Re: [PATCH v9 REBASE 6/9] USB: notify phy when root hub port connect change Message-ID: <20120710031426.GG26888@b20223-02.ap.freescale.net> References: <1341673008-29808-1-git-send-email-richard.zhao@freescale.com> <1341673008-29808-7-git-send-email-richard.zhao@freescale.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1341673008-29808-7-git-send-email-richard.zhao@freescale.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: freescale.com X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.181.185 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: marex@denx.de, B20596@freescale.com, dong.aisheng@linaro.org, fabio.estevam@freescale.com, alexander.shishkin@linux.intel.com, B29397@freescale.com, balbi@ti.com, stern@rowland.harvard.edu, kernel@pengutronix.de, gregkh@linuxfoundation.org, mkl@pengutronix.de, shawn.guo@linaro.org, linuxzsc@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Sat, Jul 07, 2012 at 10:56:45PM +0800, Richard Zhao wrote: > Phy may need to change settings when port connect change. > > Signed-off-by: Richard Zhao > Tested-by: Subodh Nijsure > --- > drivers/usb/core/hub.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index 4cc8dc9..2ba9d84 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -4037,6 +4038,13 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, > } > } > > + if (unlikely(hcd->phy && !hdev->parent)) { > + if (portstatus & USB_PORT_STAT_CONNECTION) > + usb_phy_notify_connect(hcd->phy, port1); > + else > + usb_phy_notify_disconnect(hcd->phy, port1); There's another issue. When hcd is removed, notify disconnect is not called. Is it ok, if I remove the above two line and add below patch: Thanks Richard --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1924,6 +1924,11 @@ void usb_disconnect(struct usb_device **pdev) */ device_del(&udev->dev); + if (udev->parent && !udev->parent->parent) { + struct usb_hcd *hcd = bus_to_hcd(udev->bus); + usb_phy_notify_disconnect(hcd->phy, udev->portnum); + } + /* Free the device number and delete the parent's children[] * (or root_hub) pointer. */