From patchwork Wed Sep 17 01:13:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 37501 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B7D452057E for ; Wed, 17 Sep 2014 01:14:38 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id s18sf357714lam.1 for ; Tue, 16 Sep 2014 18:14:37 -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:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=R8CG/lbVsN0OfjxSP/j9HH2YiNxeMDBHgc5B080cpHc=; b=aExuu2WHB5flqEN/U8WQtWRIMylgKp+iwZ30jVoQhILzFB9kIVSizxbns3v4ZLkHyv U3xkQkG3NE5VQZpy3NbcY7tgUnDW9f1mzVJoU+mz63Xl0ncHM1/6qwmdkl4GS3eWnI3X G9lh0VKYyB0IaLDQ03HHdupBZBE058Luxt+FJLuAlxqaWlL9Kk6Hk6KeeG6lKcA9SwWf ASDEc0Ri9XD5Ifn3er+F/htvucYEpVjvBWT+/71ACnRmtLvIQiIgpjwVhSzjnxT2NrXE +6NaBqYhPWoB/e4I1jat5YoYSQHK4kFZ2wnhLG6sfgOYCWNvyxiiGw1e6M6lGsuNaIVP wwkQ== X-Gm-Message-State: ALoCoQlnvWOTfrC2TaGzOO7pAoooxkPNMD0LrRvsdJoBvnaHvBphKfzWUW5osYeKBglmJR7u+RjA X-Received: by 10.180.221.169 with SMTP id qf9mr304640wic.5.1410916477523; Tue, 16 Sep 2014 18:14:37 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.103 with SMTP id v7ls62029lal.32.gmail; Tue, 16 Sep 2014 18:14:37 -0700 (PDT) X-Received: by 10.152.8.9 with SMTP id n9mr40681246laa.2.1410916477312; Tue, 16 Sep 2014 18:14:37 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id ee2si26428647lbb.106.2014.09.16.18.14.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Sep 2014 18:14:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id b17so889559lan.32 for ; Tue, 16 Sep 2014 18:14:37 -0700 (PDT) X-Received: by 10.152.10.74 with SMTP id g10mr40960614lab.41.1410916477212; Tue, 16 Sep 2014 18:14:37 -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.112.130.169 with SMTP id of9csp495587lbb; Tue, 16 Sep 2014 18:14:36 -0700 (PDT) X-Received: by 10.70.9.129 with SMTP id z1mr64160195pda.37.1410916475780; Tue, 16 Sep 2014 18:14:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gz10si32246191pbd.137.2014.09.16.18.14.35 for ; Tue, 16 Sep 2014 18:14:35 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754799AbaIQBOe (ORCPT + 2 others); Tue, 16 Sep 2014 21:14:34 -0400 Received: from mail-bn1bon0135.outbound.protection.outlook.com ([157.56.111.135]:47142 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754793AbaIQBOc (ORCPT ); Tue, 16 Sep 2014 21:14:32 -0400 Received: from BN3PR0301CA0074.namprd03.prod.outlook.com (25.160.152.170) by BY2PR0301MB0775.namprd03.prod.outlook.com (25.160.64.11) with Microsoft SMTP Server (TLS) id 15.0.1024.12; Wed, 17 Sep 2014 01:14:30 +0000 Received: from BN1BFFO11FD051.protection.gbl (2a01:111:f400:7c10::1:180) by BN3PR0301CA0074.outlook.office365.com (2a01:111:e400:401e::42) with Microsoft SMTP Server (TLS) id 15.0.1029.13 via Frontend Transport; Wed, 17 Sep 2014 01:14:29 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD051.mail.protection.outlook.com (10.58.145.6) with Microsoft SMTP Server (TLS) id 15.0.1019.14 via Frontend Transport; Wed, 17 Sep 2014 01:14:29 +0000 Received: from peterchendt.ap.freescale.net ([10.192.185.57]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s8H1EDeU003539; Tue, 16 Sep 2014 18:14:22 -0700 From: Peter Chen To: CC: , , , Peter Chen Subject: [PATCH 02/17] usb: musb: gadget: use udc-core's reset notifier Date: Wed, 17 Sep 2014 09:13:55 +0800 Message-ID: <1410916450-31611-3-git-send-email-peter.chen@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1410916450-31611-1-git-send-email-peter.chen@freescale.com> References: <1410916450-31611-1-git-send-email-peter.chen@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(83322001)(110136001)(2351001)(74502003)(19580405001)(92726001)(77982003)(19580395003)(74662003)(89996001)(77156001)(76176999)(68736004)(46102003)(95666004)(85852003)(36756003)(90102001)(48376002)(80022003)(93916002)(102836001)(33646002)(88136002)(21056001)(81342003)(50466002)(81542003)(87286001)(20776003)(62966002)(76482002)(84676001)(64706001)(85306004)(106466001)(6806004)(44976005)(26826002)(104016003)(107046002)(92566001)(99396002)(97736003)(50226001)(104166001)(79102003)(31966008)(105606002)(47776003)(86362001)(4396001)(87936001)(229853001)(83072002)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0301MB0775; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 0337AFFE9A Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; X-OriginatorOrg: freescale.com 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: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) 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: , From: Felipe Balbi Replace usb_gadget_driver's disconnect with udc-core's reset notifier at bus reset handler. Signed-off-by: Felipe Balbi Signed-off-by: Peter Chen --- drivers/usb/musb/musb_gadget.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index d4aa779..542ad53 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -2090,9 +2090,12 @@ __acquires(musb->lock) : NULL ); - /* report disconnect, if we didn't already (flushing EP state) */ - if (musb->g.speed != USB_SPEED_UNKNOWN) - musb_g_disconnect(musb); + /* report reset, if we didn't already (flushing EP state) */ + if (musb->gadget_driver && musb->g.speed != USB_SPEED_UNKNOWN) { + spin_unlock(&musb->lock); + usb_gadget_udc_reset(&musb->g, musb->gadget_driver); + spin_lock(&musb->lock); + } /* clear HR */ else if (devctl & MUSB_DEVCTL_HR)