From patchwork Wed Sep 7 21:35:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9320081 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 DB8D0607D3 for ; Wed, 7 Sep 2016 21:44:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E183929435 for ; Wed, 7 Sep 2016 21:44:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D61472943B; Wed, 7 Sep 2016 21:44:53 +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 8515729435 for ; Wed, 7 Sep 2016 21:44:53 +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 1bhkcp-0006vS-VZ; Wed, 07 Sep 2016 21:43:20 +0000 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bhkVc-0001Vz-KE for linux-arm-kernel@lists.infradead.org; Wed, 07 Sep 2016 21:35:55 +0000 Received: by mail-pf0-x22d.google.com with SMTP id w87so10452151pfk.2 for ; Wed, 07 Sep 2016 14:35:32 -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=htv7xPyP3gWQp7camJPi/Jifrp6QaB9jIEakhw7e+HhUpX0mrTZW9IBur1yIyRpAJ9 EVqkEe081JSvTn4oHuwzDzqmN1lwXnD/F5RYRP+HrpM0k+BKkswWTKGr4yCca7FLawFQ DXT6gn/YkYDx41E5XeQD2HYpf1+OV32qmpMNA= 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=eDnDIvJehhiJt/30aF7Ieb8c9Pk9j4oOVDyB9X5lBVh2kjYd9WafZZq82Om390soT6 yL8Asd02PV2/XZpBU8gS8gDokyrt45NqXXnYfQ9u5xngB4f2AZ+/efoOkLmyRqt28+io OdT27T97lrzoDQWM/6inGCHaBFT7XBk5WUUvLnXupzg/OItb7o+T6S44WVmnpEqe79jP JafJ62T83qIR5zBjROom9wRoPyZKJybCODnc/DnKmf4U4jNix0uS8Nn3/BD/DX3XrFbT 3KfXkOBe6eHx38dCTngDP+li+EY9bhOQnejWX1pTgQRHq4gSL2N55/zokQS0WmRSGnFa snpQ== X-Gm-Message-State: AE9vXwN7rt3zXcl0ztb0scEriC0F0JT/SAvhruzq12znuUsMxQ55oYny6kbYf9BCbkxvL6ad X-Received: by 10.98.76.220 with SMTP id e89mr45407178pfj.99.1473284131968; Wed, 07 Sep 2016 14:35:31 -0700 (PDT) Received: from localhost.localdomain (ip68-101-172-78.sd.sd.cox.net. [68.101.172.78]) by smtp.gmail.com with ESMTPSA id 75sm51015417pfw.92.2016.09.07.14.35.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Sep 2016 14:35:31 -0700 (PDT) From: Stephen Boyd To: linux-usb@vger.kernel.org Subject: [PATCH v4 08/22] usb: chipidea: Remove locking in ci_udc_start() Date: Wed, 7 Sep 2016 14:35:05 -0700 Message-Id: <20160907213519.27340-9-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0.rc2.8.ga28705d In-Reply-To: <20160907213519.27340-1-stephen.boyd@linaro.org> References: <20160907213519.27340-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160907_143552_945459_CA61321B X-CRM114-Status: GOOD ( 11.66 ) 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);