From patchwork Thu Sep 1 00:40:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9308119 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 52B9060487 for ; Thu, 1 Sep 2016 00:44:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4358528C53 for ; Thu, 1 Sep 2016 00:44:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3709829150; Thu, 1 Sep 2016 00:44:32 +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 C091228C53 for ; Thu, 1 Sep 2016 00:44:31 +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 1bfG5v-0000DW-1L; Thu, 01 Sep 2016 00:43:03 +0000 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bfG43-0007YU-OH for linux-arm-kernel@lists.infradead.org; Thu, 01 Sep 2016 00:41:09 +0000 Received: by mail-pa0-x235.google.com with SMTP id cy9so23604976pac.0 for ; Wed, 31 Aug 2016 17:40:47 -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=0/Iaew1/ky2IYuWTz1YJBnWiphMoX1vsCSe0p8OWbuc=; b=bODg4EBuAh9joBUSltyra+4H5CZdL++n/oRSMLnR+4wqY7/InGLObTQZgBrwoMubvW CXYdzkjH4RXbutmF0peP238A+UceHDdyo6vVYm+7Z/RJGgCW0XpvHNPN5Z9/e+RC/KHt OZgWTEAniFTso6iMBMRjys053WG47QolLZlxE= 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=0/Iaew1/ky2IYuWTz1YJBnWiphMoX1vsCSe0p8OWbuc=; b=dFvZSck/yYdJ1Bwq6hhQ9vCszExJbeAqI2IGpsVipcjIfEg0fhNJg9LOFc9uek2Iov q71rhyfuBGZ7LRW+od+QtUaXEl1Wq1ouLf7wBHnD4r9xgwOHnizqMQXwIvK7LwC9qjIZ TecHGYNePYNfiIF/kA+CNGuH/21eS4KhHal8G18iGPTBRHNN1GJ3RTWbvCXZi3o/V3uQ v1+0gAOfDlPHkYLfuv+DuzCBn3qtcrCsSn37znP3uNVgqxlpZsqL8DKmmJ0ehOAfuwFO kaLZzk0UufSeYzjv8ZtRoaui3q9O/UscyccenVBWrLyOcolWEg/KRuiqQdWi8JmGwH5C dD3g== X-Gm-Message-State: AE9vXwPkljmhTtuLjRpOYlQl2NRlcOcOZNCNbX/WtVn512xyvLP6SJ3mbQUV9tjJxaFsVZNk X-Received: by 10.66.156.72 with SMTP id wc8mr21812129pab.53.1472690446893; Wed, 31 Aug 2016 17:40:46 -0700 (PDT) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id m5sm2292303paw.40.2016.08.31.17.40.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Aug 2016 17:40:46 -0700 (PDT) From: Stephen Boyd To: linux-usb@vger.kernel.org Subject: [PATCH v3 08/22] usb: chipidea: Remove locking in ci_udc_start() Date: Wed, 31 Aug 2016 17:40:22 -0700 Message-Id: <20160901004036.23936-9-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0.rc2.8.ga28705d In-Reply-To: <20160901004036.23936-1-stephen.boyd@linaro.org> References: <20160901004036.23936-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160831_174108_057313_A75373E7 X-CRM114-Status: GOOD ( 11.37 ) 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 065f5d97aa67..f16be4710cdb 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -1719,7 +1719,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) @@ -1746,7 +1745,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); @@ -1755,7 +1753,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);