From patchwork Wed Dec 28 22:57:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9490771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9E69D62AB0 for ; Wed, 28 Dec 2016 23:02:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8949F26242 for ; Wed, 28 Dec 2016 23:02:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C16D26490; Wed, 28 Dec 2016 23:02:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 0784826242 for ; Wed, 28 Dec 2016 23:02:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cMNDY-00045h-Bj; Wed, 28 Dec 2016 23:01:08 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cMNAX-0001D3-3z for linux-arm-kernel@bombadil.infradead.org; Wed, 28 Dec 2016 22:58:01 +0000 Received: from mail-pg0-x22c.google.com ([2607:f8b0:400e:c05::22c]) by merlin.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cMNAW-0003lE-0T for linux-arm-kernel@lists.infradead.org; Wed, 28 Dec 2016 22:58:00 +0000 Received: by mail-pg0-x22c.google.com with SMTP id g1so120721292pgn.0 for ; Wed, 28 Dec 2016 14:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kEYRHcrR3ydAh5jRHjXhTE9NMOkTAYfYuxu+sOfdnwA=; b=YrQgV0re9BdinnMtCc28GF72rvjasoXl8uO48ooUszclFy0eIN/SJ/1CFF9/jAtmID WTjm3zrX6WMI4YPJZ/2PnsDpf6cnlQsLmVwFm0OC4Kg863KqZxNQe122wFWMXTE4To7U hyxs/INj2C0N8qvnn2VB/IwnMsKiH3KH+q3PA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kEYRHcrR3ydAh5jRHjXhTE9NMOkTAYfYuxu+sOfdnwA=; b=jNH6gWsPQML7nj+0tTksHpGVSQCG3A94hDK5qNClzUkGto0YrFvubJSnWouMyXnuv0 iVDdqrDgkGgThZ1n10DBnhvD1VEI5QEgPnjnE2yi/XHP+gsVaKhJmrI2hWiIwn0Tt7OU uY3SaTLr0RJAl/8dFakwvatWaJaS4p9n82hh2/NV3l4H1eg6s8n0FlJD3z9sJ/10nFLx KfpfPvkl5/Z+2EWAwAvXOtYZWsiQfXZQNeewtzdnTmQbTv2MySpN7jqU7Ci9RNPHy9vj lWVQgfT/cMkEiZc9V+Ztb0+wmu8nohOxgnG07xcpklV5WZx1XRlalshke95QefkzYotZ M46Q== X-Gm-Message-State: AIkVDXJdW5hpgdBcNAXYHyJZj7kzYCDpqZhbGW0yQUJzNvbkYLAC4TdoZgi376XATpGbG6cQ X-Received: by 10.84.208.102 with SMTP id f35mr82393434plh.137.1482965858666; Wed, 28 Dec 2016 14:57:38 -0800 (PST) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id x4sm100355741pgc.14.2016.12.28.14.57.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Dec 2016 14:57:38 -0800 (PST) From: Stephen Boyd To: linux-usb@vger.kernel.org Subject: [PATCH v6 22/25] usb: chipidea: Drop lock across event_notify during gadget stop Date: Wed, 28 Dec 2016 14:57:08 -0800 Message-Id: <20161228225711.698-23-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20161228225711.698-1-stephen.boyd@linaro.org> References: <20161228225711.698-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161228_175800_138560_ECF021CB X-CRM114-Status: GOOD ( 10.43 ) 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: Felipe Balbi , Arnd Bergmann , Neil Armstrong , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Peter Chen , Greg Kroah-Hartman , Andy Gross , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The CI_HDRC_CONTROLLER_STOPPED_EVENT may want to call sleeping APIs similar to how _gadget_stop_activity() may. Let's drop the lock across the event so that glue drivers can make sleeping calls. Cc: Peter Chen Cc: Greg Kroah-Hartman Signed-off-by: Stephen Boyd Acked-by: Peter Chen --- drivers/usb/chipidea/udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 0db56fb7e9e9..0d532a724d48 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -1793,10 +1793,10 @@ static int ci_udc_stop(struct usb_gadget *gadget) if (ci->vbus_active) { hw_device_state(ci, 0); + spin_unlock_irqrestore(&ci->lock, flags); if (ci->platdata->notify_event) ci->platdata->notify_event(ci, CI_HDRC_CONTROLLER_STOPPED_EVENT); - spin_unlock_irqrestore(&ci->lock, flags); _gadget_stop_activity(&ci->gadget); spin_lock_irqsave(&ci->lock, flags); pm_runtime_put(&ci->gadget.dev);