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: 9320047 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 F05D1607D3 for ; Wed, 7 Sep 2016 21:40:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03568292CF for ; Wed, 7 Sep 2016 21:40:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBE9B2931F; Wed, 7 Sep 2016 21:40:11 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 808A3292CF for ; Wed, 7 Sep 2016 21:40:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932593AbcIGVji (ORCPT ); Wed, 7 Sep 2016 17:39:38 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:35983 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757282AbcIGVfc (ORCPT ); Wed, 7 Sep 2016 17:35:32 -0400 Received: by mail-pf0-f172.google.com with SMTP id 128so10400844pfb.3 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=jQTxud0VxmRCawQXSvuxYwANK1bWxbJxcaBe8nN1HRFT3TeDMySTp+GymkXr1Izwi/ qOZhhG+p6JgmAysUGb+X/R5Ihx7BDnAD7oZZ4iVcI0VXRdwipRgLCSn57oX0cP2WRE65 SOfPxFW3H/VWUjrk1tR94wZZqUgE/J9b89wXeWS07FrgsTnNcuIw3hpL3aBRFVdS3nOW 8LwzZg/hiYVGBAt1/zYV8LJT3P+j0LddjcU4g5Abca7rueKAJ7E/BZfS5vqr1ak1qBxX tNgdP7jdfQsfHLZv5ZvyKJPhDtgSgGEBUaPbQ3wOQdHY5QdyOm7bwGUSbQUY3QUMa37D Oj9Q== X-Gm-Message-State: AE9vXwPWFY/hxsWZX98YgQ64NnVgxzksm8J8eCIj5VmUYnMnCu0MjYqg7j8Vuarpg9W7YVxp 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Neil Armstrong , Arnd Bergmann , Felipe Balbi , Peter Chen , Greg Kroah-Hartman 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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);