From patchwork Tue Oct 18 01:56:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 77890 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp656676qge; Mon, 17 Oct 2016 18:57:20 -0700 (PDT) X-Received: by 10.98.87.79 with SMTP id l76mr684761pfb.174.1476755840370; Mon, 17 Oct 2016 18:57:20 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p66si21612425pfp.103.2016.10.17.18.57.20; Mon, 17 Oct 2016 18:57:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936567AbcJRB5R (ORCPT + 27 others); Mon, 17 Oct 2016 21:57:17 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35038 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934617AbcJRB4s (ORCPT ); Mon, 17 Oct 2016 21:56:48 -0400 Received: by mail-pa0-f41.google.com with SMTP id qn10so66413595pac.2 for ; Mon, 17 Oct 2016 18:56:48 -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=Zd+qfHru5uWMIb7EvePLhE75se8vT/ycZn2EdVUJTVo=; b=ZFc9r6pocfCLZ1XBidF/kM0K7wvJ8MrLTa4Y1YXYTKxkbIxiOEXMiTH6uQ7OuqaV4t TrznAsUACvUJlmXnNR8NThEPUbhuB36phHf6I02JHsWCeWqGcst/TCayg/cUuU+bRSLu Mjzrrw/kjaxBSl503ldiyEEDIvX2UwqliNZ8o= 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=Zd+qfHru5uWMIb7EvePLhE75se8vT/ycZn2EdVUJTVo=; b=fcqHT6IBcRcUjGClMdoIcyEeMFses7O9dr0Sc6c2kzNx38BMaeqdqz7e7g8qdAzraZ AkgHeUa24a2mLr4hjUBCcvJD+7pI13iQpO8oVM3PqVZdW9W8u6tZ8oTat4gFhuPZJIhu xQX1J0j9Uf8EHXZzl31CHMQeeFrNgVesmg7Tw3eF3UXkW4qQ79WGXgLBoqOJTsChTgYM M4kDrSYz+asL36Ifu+zfUwmlC4X3a/jIhtQJCaOd1dZDd2slFAF3sre71qVHfJeLOJME rhZG/ZRlxX4pRXTeaWPC/ngsZOi1ZEZrblTYKD9WJIAxBS8Om+xh7CBLAR2I+lLCD4yI XXBA== X-Gm-Message-State: AA6/9RlwCw/JSYLUIwgUiDI/RPvwp/LK5TcWZpGKaVxpzRgeT3+1yJb+C9fczn8GNYT7OgF3 X-Received: by 10.66.22.38 with SMTP id a6mr580531paf.39.1476755807746; Mon, 17 Oct 2016 18:56:47 -0700 (PDT) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id j6sm51020430paa.44.2016.10.17.18.56.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 18:56:47 -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 v5 08/23] usb: chipidea: Remove locking in ci_udc_start() Date: Mon, 17 Oct 2016 18:56:21 -0700 Message-Id: <20161018015636.11701-9-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20161018015636.11701-1-stephen.boyd@linaro.org> References: <20161018015636.11701-1-stephen.boyd@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.10.0.297.gf6727b0 diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 661f43fe0f9e..145b1fd86f58 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);