From patchwork Wed Dec 28 22:56:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9490767 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 20D8D62AB0 for ; Wed, 28 Dec 2016 23:02:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C76D26242 for ; Wed, 28 Dec 2016 23:02:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0162626490; Wed, 28 Dec 2016 23:02:18 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 914AC26242 for ; Wed, 28 Dec 2016 23:02:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752295AbcL1XBs (ORCPT ); Wed, 28 Dec 2016 18:01:48 -0500 Received: from mail-pf0-f173.google.com ([209.85.192.173]:34894 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752166AbcL1W5X (ORCPT ); Wed, 28 Dec 2016 17:57:23 -0500 Received: by mail-pf0-f173.google.com with SMTP id i88so59813948pfk.2 for ; Wed, 28 Dec 2016 14:57:23 -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=84t/k05MJpyYgwxnsn+vySfztm6q/U96zV9U0LPD2Hc=; b=HjH47+wwT9t961BObOdM66iNkVBYCxT9znX2/Cxut7s/VqdKT1lepcQRACjz2wcsyU D/CsBmPlYaVU/vF6pH798YEA5lyGKMwY5zPwoVHTUPEn2zUD2xW3geOgeT8c3oMDX7pG Ox6dcuHmEcInA3yyVsyRzAAHKQMikc19eBuVs= 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=84t/k05MJpyYgwxnsn+vySfztm6q/U96zV9U0LPD2Hc=; b=o+W0Qucdo+2Kx9+HuqdwbLbuNJQApyiEAf8jd5AC0g/pZ/tUysRjFMNajLi64DjU4c LJYbcjFegu114qud0X4vqNoENkQLDUwL/cR4cfYNZ8o9ydDSKu62M7cNb+lRpwHYIaHd Cu/hFzhCw9wDR5UQyXIfhnemb13+8/TP+iR2daK3VqOYR0gngM9ixwZn6CZiKO1+GCEX lBr0ONE3X28PaIGSMHqHUe+4PkJlTo0gm5ZmVXqNzVRjNGKyBXZYjic904QxaE6AHgCf a4FVzudsGeHNXUwS2PE6W5mhupmARmgWlDxTFm58MaXnc6EmNQ//poolCYJ59sOCTGbC bEgw== X-Gm-Message-State: AIkVDXKC/tP2YA8BYWpMwcCF91mmU9DFyfXeo7LtNCXfIQj5loV4UN2qsW5FnmF7Z2kfZZML X-Received: by 10.99.141.67 with SMTP id z64mr70493105pgd.18.1482965842938; Wed, 28 Dec 2016 14:57:22 -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.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Dec 2016 14:57:22 -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 08/25] usb: chipidea: Remove locking in ci_udc_start() Date: Wed, 28 Dec 2016 14:56:54 -0800 Message-Id: <20161228225711.698-9-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 We don't call hw_device_reset() with the ci->lock held, so it doesn't seem like this lock here is protecting anything. Let's just remove it. This allows us to call sleeping functions like phy_init() from within the CI_HDRC_CONTROLLER_RESET_EVENT hook. Acked-by: Peter Chen Cc: Greg Kroah-Hartman Signed-off-by: Stephen Boyd --- drivers/usb/chipidea/udc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index cf132f057137..732b281485de 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -1725,7 +1725,6 @@ static int ci_udc_start(struct usb_gadget *gadget, struct usb_gadget_driver *driver) { struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget); - unsigned long flags; int retval = -ENOMEM; if (driver->disconnect == NULL) @@ -1752,7 +1751,6 @@ static int ci_udc_start(struct usb_gadget *gadget, pm_runtime_get_sync(&ci->gadget.dev); if (ci->vbus_active) { - spin_lock_irqsave(&ci->lock, flags); hw_device_reset(ci); } else { usb_udc_vbus_handler(&ci->gadget, false); @@ -1761,7 +1759,6 @@ static int ci_udc_start(struct usb_gadget *gadget, } retval = hw_device_state(ci, ci->ep0out->qh.dma); - spin_unlock_irqrestore(&ci->lock, flags); if (retval) pm_runtime_put_sync(&ci->gadget.dev);