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: 9381045 X-Patchwork-Delegate: agross@codeaurora.org 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 DE6496086B for ; Tue, 18 Oct 2016 01:58:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5F4B28CCF for ; Tue, 18 Oct 2016 01:58:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B478728CD7; Tue, 18 Oct 2016 01:58:09 +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 3972728CCF for ; Tue, 18 Oct 2016 01:58:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933824AbcJRB5H (ORCPT ); Mon, 17 Oct 2016 21:57:07 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35038 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934954AbcJRB4s (ORCPT ); Mon, 17 Oct 2016 21:56:48 -0400 Received: by mail-pa0-f42.google.com with SMTP id qn10so66413598pac.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=GIq53Q6piNsl2hKB5Imx4OVWIVgZUyW1cQTFpEWVYvTlzrna0OpERc5a9Vh9ibziL5 f+avajZjtVXrQ9Epgd9fqLt4u84cwBrk2m3jZ6YUP4eueypSFTmsQ8AxWAn4qm4zVY+b kw4TLHexKCoyxBuNlgjOTbKu8HJN5FBlktpEZ0XpBHenmUwVXUyGi2QCTLNAa/HdHkI2 c+QTiVuXcHuz2VEW6WvRG2upuHWYH7ZV+jhBTqPr2ReKNXcP+CPgl1XdbyZZSdUEWIAV KGKuNKlZHSTjBK2lpKKw9lWD8WoZApHycIEEPoFdoaax5N6xyvmJbhqigbpMK+93FkLI XJFw== X-Gm-Message-State: AA6/9RkZo6h25IwcM+9bzwmKe+QHLZkJgUBIvHp40uZ25Q0f9k65gAQTFuES49TGcwH4wtII 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-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 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);