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: 9490781 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 CF33362AB0 for ; Wed, 28 Dec 2016 23:02:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA36A26242 for ; Wed, 28 Dec 2016 23:02:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEF9526419; Wed, 28 Dec 2016 23:02:59 +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 4BD9E26242 for ; Wed, 28 Dec 2016 23:02:59 +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 1cMNDy-0004LR-8R; Wed, 28 Dec 2016 23:01:34 +0000 Received: from mail-pf0-x235.google.com ([2607:f8b0:400e:c00::235]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cMNAB-00011F-Pe for linux-arm-kernel@lists.infradead.org; Wed, 28 Dec 2016 22:57:43 +0000 Received: by mail-pf0-x235.google.com with SMTP id 189so60099752pfz.3 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=n6omqDihwtoCxiu2nDU8INtv4EFu54mu+MTrIqZYYyXSd/GoRwnZsMHx89uOw6PLKX YrOCpDnzt8vyqcl3U0PXyAzETP7VYVX1P9PG3J5wSPQVim3v9KSRkfGY0f/lQnCWyoOp v0yB43aV2+VR43NgGbqHAFAXKUq1U9XuQArwUExs/xDXffXjdjYXjJyv88LjrVjFyilM UHA/qsI5qsDxPEy909Wyur68t5ur6KSqRIcW/C0GLiBqi2V/Jdcg0Coo8BLoIM1fykwg iMFA7gQQnUTj6p4XbBaEnULU/ZGL3FcUEVvQtEVl+V7AEkCcn5qBv3I4k0CIQiB1uM/q N1aw== X-Gm-Message-State: AIkVDXLs+Oa/TB/cktYX4sNjjbJrBs3pf4W3fcHajzKfbHrS63mm1z2+ESg3loGQYXxXkFsM 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161228_145739_976079_89287058 X-CRM114-Status: GOOD ( 10.57 ) 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 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);