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: 75697 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp526050qgf; Wed, 7 Sep 2016 14:36:12 -0700 (PDT) X-Received: by 10.98.103.213 with SMTP id t82mr28627444pfj.158.1473284170174; Wed, 07 Sep 2016 14:36:10 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xn1si40335838pab.38.2016.09.07.14.36.09; Wed, 07 Sep 2016 14:36:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933364AbcIGVf5 (ORCPT + 4 others); Wed, 7 Sep 2016 17:35:57 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:34617 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757283AbcIGVfc (ORCPT ); Wed, 7 Sep 2016 17:35:32 -0400 Received: by mail-pf0-f178.google.com with SMTP id p64so10489114pfb.1 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=UaHgPIiSKNHK6RWpBGHLVdyYErKQnNB3+aeela/DtCzK2PEFQ0W2z5+kIJeDKrAIKy kuuczXRSfThOxBJYw+y0RyecnZ9R3ezuXmcWCa2plZL8k4qlT25pUVt0NFA3vt6I44XH O36A0kewD7/7IFUY17lHDY9h8cETBkpPhGtTmva6njCG4Tmcp7yfmz+6a2LI4RTtDV+H 3oNINZIPAVgnb+QIWCs9TbHf+zVtcRjyqI3wiciOGu1O8B6L+MGvdjBPyRJ1wMoy5KxV +ziUnvpdVzqGcdKyY1T6R+WH7g2f4pzEdflhWI2FZ7J83gBewF6wXK4IzvaGLa6jg07R xatA== X-Gm-Message-State: AE9vXwPLmY3Ozh4XbLIuPeoHtZcnivA81eRzBnxx3TVJ13F17jCcZnnRRKT6zZQfyGt37+Ws 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-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);