From patchwork Thu Oct 16 12:58:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 38808 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3F41A20973 for ; Thu, 16 Oct 2014 12:58:51 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf1858608lab.7 for ; Thu, 16 Oct 2014 05:58:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=WHKOlhkssSNaL1F24raL8geI29wEhPK0kmqI5EV+G1s=; b=ev9SyjQ4obPAlXUAYU5TVYyQM3VPcQdM/lRJAaX4lZaPg2hvOH+5cfJAJPE9k5n0Kn 2jNY3z+01jAiXuv/XpoHpxc80Wb14jI3d2nxPU6RNTKFG8anzdNOeeQLLM90j9mtJmjc dcdYh3X7Sfr0IPTB7HjFBWc2UV695ZCtLD9lpwWq2khX93T88snaeVWhn8pg+yD21CC2 VaCgci8ThdcQ3R5+E3fnaO9eNibryBj+MpfewdxJzuzlDuxlFslsHTn8AyHv0MxT0OPM +egeiiKIbDR4A3CU/TMCV4cJptmkJJC7HkqaykI7ELUkY698nL807XuiixMmsTq34qxD ukXw== X-Gm-Message-State: ALoCoQkhzjHzkpB/ju14LM8RLqHC06vjlG3mxEXsJpKOzESrpVR0TQxxCZCXlpPw86ew0uaFjhti X-Received: by 10.152.3.168 with SMTP id d8mr257001lad.0.1413464329737; Thu, 16 Oct 2014 05:58:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.195 with SMTP id g3ls163203lam.59.gmail; Thu, 16 Oct 2014 05:58:49 -0700 (PDT) X-Received: by 10.152.161.195 with SMTP id xu3mr1428420lab.15.1413464329591; Thu, 16 Oct 2014 05:58:49 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx.google.com with ESMTPS id b2si34613536lbm.104.2014.10.16.05.58.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Oct 2014 05:58:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id u10so2780169lbd.1 for ; Thu, 16 Oct 2014 05:58:49 -0700 (PDT) X-Received: by 10.152.6.228 with SMTP id e4mr1379666laa.71.1413464329507; Thu, 16 Oct 2014 05:58:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp33519lbz; Thu, 16 Oct 2014 05:58:48 -0700 (PDT) X-Received: by 10.70.96.4 with SMTP id do4mr1050378pdb.133.1413464327404; Thu, 16 Oct 2014 05:58:47 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yk7si11920691pab.135.2014.10.16.05.58.46 for ; Thu, 16 Oct 2014 05:58:47 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752487AbaJPM6n (ORCPT + 3 others); Thu, 16 Oct 2014 08:58:43 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57455 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752442AbaJPM6b (ORCPT ); Thu, 16 Oct 2014 08:58:31 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NDJ00HS4G6B6G80@mailout1.w1.samsung.com>; Thu, 16 Oct 2014 14:01:23 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-c8-543fc0f47af1 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 20.75.25543.4F0CF345; Thu, 16 Oct 2014 13:58:28 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NDJ00F34G17BB00@eusync2.samsung.com>; Thu, 16 Oct 2014 13:58:28 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Kyungmin Park , Robert Baldyga , Paul Zimmerman , Krzysztof Kozlowski Subject: [PATCH 8/9] usb: dwc2/gadget: fix calls to phy control functions in suspend/resume code Date: Thu, 16 Oct 2014 14:58:04 +0200 Message-id: <1413464285-24172-9-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1413464285-24172-1-git-send-email-m.szyprowski@samsung.com> References: <1413464285-24172-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNJMWRmVeSWpSXmKPExsVy+t/xK7pfDtiHGHx9oWDx+oWhxdmmN+wW M87vY7JYtKyV2WLtkbvsFtunTGeyeHB4J7sDu0ffllWMHlv2f2b0+LxJLoA5issmJTUnsyy1 SN8ugStj6b19LAU7uCtaF0c2MN7k7GLk5JAQMJE4tuoPM4QtJnHh3nq2LkYuDiGBpYwSa+b+ ZIVw+pgktp7byQJSxSZgKNH1tosNxBYRcJBYsvQOWAezwB1GifX7PzGBJIQFkiQuLzrBCGKz CKhKNC34B2bzCnhI/FzbwgKxTk7i/8sVYPWcAp4SuzavBDtDCKjm/NXpjBMYeRcwMqxiFE0t TS4oTkrPNdQrTswtLs1L10vOz93ECAmgLzsYFx+zOsQowMGoxMOrEWwfIsSaWFZcmXuIUYKD WUmEd9EkoBBvSmJlVWpRfnxRaU5q8SFGJg5OqQbGNJGDzt5yonEWm1JLu089W2S79sGDv1/E 7woesJXxjf2Qu+gR59uzb7bJMoRVVM770mT0NO4Pb86aWz5Pcs4ITphm+TY27f4Ce8XAEs4p RTvclszRTDrMsbquP+TUk9+h6Vccr66YfpHP9bPt+Xe/PO/3Bx+ccL3BduI0s5eb/Gb92q36 o+1ZuBJLcUaioRZzUXEiAPmIxl3+AQAA Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch moves calls to phy enable/disable out of spinlock protected blocks in device suspend/resume to fix incorrect caller context. Phy related functions must not be called from atomic context. Signed-off-by: Marek Szyprowski --- drivers/usb/dwc2/gadget.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index cdf417a7ae63..052b1a857291 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3656,11 +3656,13 @@ static int s3c_hsotg_suspend(struct platform_device *pdev, pm_message_t state) hsotg->driver->driver.name); spin_lock_irqsave(&hsotg->lock, flags); + s3c_hsotg_core_disconnect(hsotg); s3c_hsotg_disconnect(hsotg); - s3c_hsotg_phy_disable(hsotg); hsotg->gadget.speed = USB_SPEED_UNKNOWN; spin_unlock_irqrestore(&hsotg->lock, flags); + s3c_hsotg_phy_disable(hsotg); + if (hsotg->driver) { int ep; for (ep = 0; ep < hsotg->num_of_eps; ep++) @@ -3689,9 +3691,10 @@ static int s3c_hsotg_resume(struct platform_device *pdev) hsotg->supplies); } - spin_lock_irqsave(&hsotg->lock, flags); s3c_hsotg_phy_enable(hsotg); - s3c_hsotg_core_init_disconnect(hsotg); + + spin_lock_irqsave(&hsotg->lock, flags); + s3c_hsotg_core_init_disconnected(hsotg); s3c_hsotg_core_connect(hsotg); spin_unlock_irqrestore(&hsotg->lock, flags);