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: 89228 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp5740222qgi; Wed, 28 Dec 2016 15:01:52 -0800 (PST) X-Received: by 10.99.4.71 with SMTP id 68mr71874424pge.77.1482966112348; Wed, 28 Dec 2016 15:01:52 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z40si23540428plh.114.2016.12.28.15.01.51; Wed, 28 Dec 2016 15:01:52 -0800 (PST) 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 S1752476AbcL1XBt (ORCPT + 25 others); Wed, 28 Dec 2016 18:01:49 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:34894 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752061AbcL1W5X (ORCPT ); Wed, 28 Dec 2016 17:57:23 -0500 Received: by mail-pf0-f172.google.com with SMTP id i88so59813947pfk.2 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=M4GQ3Km9nPUtDBnvpsCqf7etqT7Bpa6K3uzqI4tIweeHMgxZxmmyNtAjLCGnBucUci LWtUVih3WBRjyvFQqkvfADEOI7yMSDQSynqAuaOy/v9ey6hvJKr66gtyh6A0u9FKmvPL LLjhjmyQ9gzRBvXw8RDQk7khq5nhLfLDjkw2FEGBOMBXBXp9xLuMMlAjbxLw91eTB4RS +jm10/AwGsYqFgg4y+EDNYXgumebY+ga/mXU1ww827qKaeOttUsuqMCEXU3fMa2Ak9P7 vSZZ+bU1IfdU6vKLkDgmoSvQnLiEvqiT9i82v3xJ94UJU7fXY4yFdU/TocLeqD2XqA9j fUxg== X-Gm-Message-State: AIkVDXJ38VP/h7LYasp7/RWlQiqcgchJCjwmT6scZdSp7lyCSs9Xmwi5CoZ20vFvn+rUSuaG 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 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 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> 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 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);