From patchwork Thu Jul 7 22:20:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9219727 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 9DBAB607D9 for ; Thu, 7 Jul 2016 22:24:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EAAE26E33 for ; Thu, 7 Jul 2016 22:24:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82E4728470; Thu, 7 Jul 2016 22:24:27 +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 1407326E33 for ; Thu, 7 Jul 2016 22:24:27 +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 1bLHhC-0000AP-F2; Thu, 07 Jul 2016 22:22:58 +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 1bLHg6-0007fF-E7 for linux-arm-kernel@lists.infradead.org; Thu, 07 Jul 2016 22:21:51 +0000 Received: by mail-pa0-x234.google.com with SMTP id b13so9533089pat.0 for ; Thu, 07 Jul 2016 15:21:30 -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=DLD+aoQQuRS/CaTkLu+DJCDMhW8MqEkp5wmTflxIMk0=; b=aFekdd4uFnJbXcFDWhEg3RCIsAuqMJ9Px8VjyZkZ8145qPTS1P8FcGffqn/LdpQZL+ i/Lz9RJAD+C6dp7WajPgsqA/g6g/3zR2EIxE94A/wHfccSdKdKeLQ/0tjeOH7NXZByU2 mmLBswoar6BZtYoMBRM+eM4lpmot208atbI5Q= 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=DLD+aoQQuRS/CaTkLu+DJCDMhW8MqEkp5wmTflxIMk0=; b=Q8mkrMutsgHQf2ZaJoWc/sSEzefzQFcARyscluV4VzjVVC8xKiZHQLAJlGdD5umqsM nt/TRSriK7EOgWmaQUMQnUvKOtQLuNzQd9xp4vBSwMztbYGnkGfuLpmLXTgAkQcDbe6e AtqtBD0C/1Blgc0TfrGOt+wQ/LHr3X2DzcewZdTlAGRdFDlo+hmakCDM73o9E9Z8NS7B eN/mmWoSPla/vsM9ZHP4p6RcI3OF7CuiJ34I4WS+YlOGgxN6wbCZHBed49qrym+oHlkY +XEwL4V8s9Vat5rRjdxTUYtI+QOorjScfObwDCQHO3gTgQ8tU7LIUSnmnPiuUn/3n1km rwDQ== X-Gm-Message-State: ALyK8tJWq9AxZvdMEggL+R860M0m+yuiNJbSJ1IaHrY6p3FwtQ8TZBNUundpBmTfHVxywaUf X-Received: by 10.66.132.7 with SMTP id oq7mr4272334pab.26.1467930089819; Thu, 07 Jul 2016 15:21:29 -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 j8sm6781807paj.22.2016.07.07.15.21.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jul 2016 15:21:29 -0700 (PDT) From: Stephen Boyd To: linux-usb@vger.kernel.org Subject: [PATCH v2 08/22] usb: chipidea: Remove locking in ci_udc_start() Date: Thu, 7 Jul 2016 15:20:59 -0700 Message-Id: <20160707222114.1673-9-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0.rc2.8.ga28705d In-Reply-To: <20160707222114.1673-1-stephen.boyd@linaro.org> References: <20160707222114.1673-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160707_152150_514004_18AB8BE5 X-CRM114-Status: GOOD ( 11.89 ) 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. Cc: Peter Chen Cc: Greg Kroah-Hartman Signed-off-by: Stephen Boyd Acked-by: Peter Chen --- 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);