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: 89219 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp5739354qgi; Wed, 28 Dec 2016 14:59:31 -0800 (PST) X-Received: by 10.84.168.129 with SMTP id f1mr83227500plb.42.1482965971080; Wed, 28 Dec 2016 14:59:31 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si51321567pgw.107.2016.12.28.14.59.30; Wed, 28 Dec 2016 14:59:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752343AbcL1W5k (ORCPT + 9 others); 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 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 --- drivers/usb/chipidea/udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.10.0.297.gf6727b0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Peter Chen 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);