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: 9490703 X-Patchwork-Delegate: agross@codeaurora.org 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 5E94B62AB0 for ; Wed, 28 Dec 2016 22:59:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AFD02623D for ; Wed, 28 Dec 2016 22:59:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F64526490; Wed, 28 Dec 2016 22:59:27 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9CB92623D for ; Wed, 28 Dec 2016 22:59:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752343AbcL1W5k (ORCPT ); Wed, 28 Dec 2016 17:57:40 -0500 Received: from mail-pg0-f49.google.com ([74.125.83.49]:36103 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752243AbcL1W5j (ORCPT ); Wed, 28 Dec 2016 17:57:39 -0500 Received: by mail-pg0-f49.google.com with SMTP id f188so159840954pgc.3 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=mtjSsAuhFaHKhkunn166+V+W6RDsCGvKivyj8MIBR0laq8iXA8pgJrYROdtD8VlCLO zWjY7KiYO3MQ+78NpzFgazh0wNyHtOnxJSgpLjy90ZWoY/PqVYhWR3bQGh1tipb94mOz 4uBLlnV5POHhsr4xm1CcebBI/7AF5ym3viUiBeFHzFsvF5ENilni8l8tMREOx7S0S5xU BKhuti2IHnUwzi+BcDQF8OQhcjZ71F7q/7ffuiWwayk2Zu1iSoiFZgmd9vkv59qP/Njq xm5rAf8O4faK8wGn+MhtrB50o0jcJeX9rlq61g6kz5HyEKo2rFexwgCj0GbAlPoa0tkM NQSQ== X-Gm-Message-State: AIkVDXLmazhW01xAcv3mwPIL/29VrdPR68NB1lOYR0LaZ9ZRPXHwIjw2om0pFs57+SHEmULh 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Neil Armstrong , Arnd Bergmann , Felipe Balbi , Peter Chen , Greg Kroah-Hartman 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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);