From patchwork Tue Oct 18 01:56:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9381117 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 7911460CDC for ; Tue, 18 Oct 2016 02:01:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FD9C28CCF for ; Tue, 18 Oct 2016 02:01:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52A8328CD9; Tue, 18 Oct 2016 02:01:25 +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 D998A28CCF for ; Tue, 18 Oct 2016 02:01:24 +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 1bwJgu-0001Qv-IT; Tue, 18 Oct 2016 01:59:44 +0000 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bwJeO-0008Kx-Jl for linux-arm-kernel@lists.infradead.org; Tue, 18 Oct 2016 01:57:11 +0000 Received: by mail-pa0-x234.google.com with SMTP id vu5so66505065pab.0 for ; Mon, 17 Oct 2016 18:56:48 -0700 (PDT) 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=Zd+qfHru5uWMIb7EvePLhE75se8vT/ycZn2EdVUJTVo=; b=ZFc9r6pocfCLZ1XBidF/kM0K7wvJ8MrLTa4Y1YXYTKxkbIxiOEXMiTH6uQ7OuqaV4t TrznAsUACvUJlmXnNR8NThEPUbhuB36phHf6I02JHsWCeWqGcst/TCayg/cUuU+bRSLu Mjzrrw/kjaxBSl503ldiyEEDIvX2UwqliNZ8o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Zd+qfHru5uWMIb7EvePLhE75se8vT/ycZn2EdVUJTVo=; b=hUM++uRWyYyMqYH1PE9AFXk3qJgzSNV2rxcwk1JMb89kNKgkw002UP3pFLZtiPvjUh C7AcqW604NH2+zRWCjHpSwit8msm660qZ5+0VaCF1+fEO1zXWuudJMT+J5qfH/ti2cTV cjGiSEwCwBCMlMAjsrGMeReYTDpKtOaV2u8z4B6eoINpRWFGgd7/u+OdiqZrZKCSQj2L xT4JmA7LLxUqgOaT0G0E5C03gApmyGCA6/FoNnOp9jUFwgnalHDbx5LpO8brCIb7t/JX f5Ru7XVjdEK35HslI3DF9s1rFBRJ4yyK4FHfMNJ166lhi0bKGCcY9LUhreWEKWaTXubY jE6w== X-Gm-Message-State: AA6/9Rkb0PRz7LH8nnZqeP/oHmx5g+5xRr4p8qbsURHZLLf6ThuPQt9QvMHXYD5uQl+gvCub X-Received: by 10.66.22.38 with SMTP id a6mr580531paf.39.1476755807746; Mon, 17 Oct 2016 18:56:47 -0700 (PDT) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id j6sm51020430paa.44.2016.10.17.18.56.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 18:56:47 -0700 (PDT) From: Stephen Boyd To: linux-usb@vger.kernel.org Subject: [PATCH v5 08/23] usb: chipidea: Remove locking in ci_udc_start() Date: Mon, 17 Oct 2016 18:56:21 -0700 Message-Id: <20161018015636.11701-9-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20161018015636.11701-1-stephen.boyd@linaro.org> References: <20161018015636.11701-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161017_185708_943521_750EC3F5 X-CRM114-Status: GOOD ( 11.73 ) 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 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 661f43fe0f9e..145b1fd86f58 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);