From patchwork Thu Sep 1 00:40:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 75137 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp19979qga; Wed, 31 Aug 2016 17:41:22 -0700 (PDT) X-Received: by 10.66.66.203 with SMTP id h11mr22203263pat.5.1472690479812; Wed, 31 Aug 2016 17:41:19 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oy8si2396026pac.126.2016.08.31.17.41.19; Wed, 31 Aug 2016 17:41:19 -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 S933972AbcIAAk4 (ORCPT + 27 others); Wed, 31 Aug 2016 20:40:56 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34595 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933791AbcIAAkr (ORCPT ); Wed, 31 Aug 2016 20:40:47 -0400 Received: by mail-pa0-f47.google.com with SMTP id fi15so23550205pac.1 for ; Wed, 31 Aug 2016 17:40:47 -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=bODg4EBuAh9joBUSltyra+4H5CZdL++n/oRSMLnR+4wqY7/InGLObTQZgBrwoMubvW CXYdzkjH4RXbutmF0peP238A+UceHDdyo6vVYm+7Z/RJGgCW0XpvHNPN5Z9/e+RC/KHt OZgWTEAniFTso6iMBMRjys053WG47QolLZlxE= 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=PP7FS99J/9mDW/T3q5BpdKszxzOS3g2SpC/LJrjnY9CwGbqfLcBSOHLFbWdRnZpl0N ogS7TzlsIpEIm8SGNhP/5umsBWwtloXEXTdkKDWIVYH42/qUx75uMsbNITupPjhf1e4m CJ43MrpsacBtcqTTzTPmEtnZsQbTtMRHuNIbF4vb/1MEd3T0oqV7/VtU+hq3tR8WxoRQ 0+7Wf88K6yx1MzqtQ29+G/Mvrw8SJdaM9UZu0ic7NZ4qhwFDedUaUX62xNbTbM7blgVl 1OPCCDUj34HhPe80h7LG/Bg01tJLeQ+K3/l+Sw72ozoPvBUE9IOFncJLOJytF3mdcVo/ UZlw== X-Gm-Message-State: AE9vXwMwrPhIID1g+sUgbIRFwcDzUjl3hD5yrSPJglEisNEfjiMvZVCv/BFWCllRP6CTGnmT X-Received: by 10.66.156.72 with SMTP id wc8mr21812129pab.53.1472690446893; Wed, 31 Aug 2016 17:40:46 -0700 (PDT) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id m5sm2292303paw.40.2016.08.31.17.40.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Aug 2016 17:40:46 -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 v3 08/22] usb: chipidea: Remove locking in ci_udc_start() Date: Wed, 31 Aug 2016 17:40:22 -0700 Message-Id: <20160901004036.23936-9-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0.rc2.8.ga28705d In-Reply-To: <20160901004036.23936-1-stephen.boyd@linaro.org> References: <20160901004036.23936-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.9.0.rc2.8.ga28705d 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);