From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B1B9CA9EAF for ; Thu, 24 Oct 2019 12:15:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F09F2166E for ; Thu, 24 Oct 2019 12:15:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="c43rtkj3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V6MrqlY9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F09F2166E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-ID:MIME-Version:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lmKgdviJsfQH1GavQX0HA3Rb3/jfMPf3XFNuKociw0M=; b=c43rtkj3iKOORmDqFpwtAJ5ws WvivnHNU1tqsVgW3r1yFEpneRyYAL3l2VuePC/gsDfNtzp46Zthz/dp19+GGSJceW4V/M1Le46Q16 hrjKrZcw3Is+MbOB2kBg2dE8E8JOyEeoivZSqSMu6DAuUY2POF0wgRNmO7BfyDpZfZl+WGKZU4BU6 H3RXM5ot4eXbTvnFWWGvd3r5k5y86C82m7wlN+nFI4qVYqn2ndGbJ8qOQ+Wja8FYQkBRneelOVOBt gle5fFdMy546hJHKGzKZ0kvXX6bityKyjrY03b/PcytN21+3YuuwswO0AMitO29a+HnINKrl6TrKA jiXzSV+4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNc1J-000675-7A; Thu, 24 Oct 2019 12:15:13 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNc1E-0005dX-To; Thu, 24 Oct 2019 12:15:10 +0000 Received: by mail-wm1-x341.google.com with SMTP id q70so2600228wme.1; Thu, 24 Oct 2019 05:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:mime-version:message-id:in-reply-to :references:user-agent:content-transfer-encoding; bh=1HdoKxCH13MhX+wY4v0MQbEUNC0dud5C0FawbOHFKJk=; b=V6MrqlY9ozevW1R6YKVE0uuFqoLoW7t+JHkyA8dCCZbmTOR9wYzXhGRsh/4JV3TwVy OMlPAsTXhu9CsRLv5KPWjzJgV240XROTbnRLiz5zZ4gBShXdydMG9InpeypRiq5amT5D 5uG1iNdk4xPL9iNh53hLcRjMdN/helK4HcI7rWe6SHZiliQz5z9ibMe5XIFdzYbiIF0z O9cisVIeE9MXGi4ZbICOC776EclnlOhJ57GpafrIBWM+6yEtPEevYANt2deXx+O0Aeti i8soDpRzthnXF1h3+FCRd7v8XMH9eC/v8yDvd61SPUbNHy1U+7QIv8Sx1aCMIhwfPnbU QEEg== 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:mime-version:message-id :in-reply-to:references:user-agent:content-transfer-encoding; bh=1HdoKxCH13MhX+wY4v0MQbEUNC0dud5C0FawbOHFKJk=; b=ZDUnw98bS185rpkF/JRaqgZC19amMaPGg6KFWlPolhEHOprmbyvXMtPzbI666X6AlO omz3ejGu6Y0yrh6JDNhc/+spmdrIJJ6C4kvqEYDiLSHFMD/4Tfti/uS1GNcU7NPvgcpb GlF+qVj8DW6pHuAFdmGi9HwOjOL+5nc3Qt1qBf1oxgmdFC6oejqYd+HlITzmE3sqDIcU 5/yabagT3jLVwyBckUqIc7MT9LYvymtuV3aAXYPRSdJIc6AeqgtQkyIm/yDVkWv6puf2 /v7gGI9r91/SiTk8TD60rua2n+6TpnoYJJGrRQadtjYa9FKv0Q6Gu0ZLnhvThqR9Q85N QV0w== X-Gm-Message-State: APjAAAWS2XN3POJ4nMpm7E6aBfqLBRiD8W3o4fFoRmOPRx6OXGDa+Q1V tVUTtbBKm1sUJQclk/u1Y/U= X-Google-Smtp-Source: APXvYqxBcd8BLvHSAVN5kLuTz06g4yJEi0VLnAey0to6tDb8lIPP461HYyv2PaCFermlz+dFvhIOBw== X-Received: by 2002:a7b:c7d9:: with SMTP id z25mr4950200wmk.127.1571919306799; Thu, 24 Oct 2019 05:15:06 -0700 (PDT) Received: from localhost ([94.73.41.211]) by smtp.gmail.com with ESMTPSA id i1sm2679073wmb.19.2019.10.24.05.15.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 05:15:05 -0700 (PDT) From: Vicente Bergas To: Felipe Balbi Subject: Re: [PATCH] usb: dwc3: Add shutdown to =?iso-8859-1?Q?platform=5Fdriver?= Date: Thu, 24 Oct 2019 14:15:04 +0200 MIME-Version: 1.0 Message-ID: In-Reply-To: <877e4wj7ly.fsf@gmail.com> References: <4d18d4f7-a00e-bd60-6361-51054eba3bca@arm.com> <20190817174140.6394-1-vicencb@gmail.com> <8d48017a-64c5-4b25-8d85-113ffcf502c9@gmail.com> <87v9uix1sv.fsf@gmail.com> <645526b8-bfed-4cc6-9500-1843c5fe0da9@gmail.com> <0edb55d4-3bad-47ac-9d29-8d994d182e67@gmail.com> <877e4wj7ly.fsf@gmail.com> User-Agent: Trojita X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191024_051509_000066_1ED22C23 X-CRM114-Status: GOOD ( 13.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthias Brugger , Heiko Stuebner , MarcZyngier , Catalin Marinas , linux-usb@vger.kernel.org, Will Deacon , linux-rockchip@lists.infradead.org, Greg Kroah-Hartman , Robin Murphy , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wednesday, October 23, 2019 8:31:21 AM CEST, Felipe Balbi wrote: > Hi, > > (sorry for the long delay) > > Vicente Bergas writes: > >> On Tuesday, August 27, 2019 2:16:20 PM CEST, Vicente Bergas wrote: ... > > I meant something like this: > > diff --git a/drivers/usb/dwc3/dwc3-of-simple.c > b/drivers/usb/dwc3/dwc3-of-simple.c > index bdac3e7d7b18..e64754be47b4 100644 > --- a/drivers/usb/dwc3/dwc3-of-simple.c > +++ b/drivers/usb/dwc3/dwc3-of-simple.c > @@ -110,12 +110,9 @@ static int dwc3_of_simple_probe(struct > platform_device *pdev) > return ret; > } > > -static int dwc3_of_simple_remove(struct platform_device *pdev) > +static void __dwc3_of_simple_teardown(struct dwc3_of_simple *simple) > { > - struct dwc3_of_simple *simple = platform_get_drvdata(pdev); > - struct device *dev = &pdev->dev; > - > - of_platform_depopulate(dev); > + of_platform_depopulate(simple->dev); > > clk_bulk_disable_unprepare(simple->num_clocks, simple->clks); > clk_bulk_put_all(simple->num_clocks, simple->clks); > @@ -126,13 +123,27 @@ static int dwc3_of_simple_remove(struct > platform_device *pdev) > > reset_control_put(simple->resets); > > - pm_runtime_disable(dev); > - pm_runtime_put_noidle(dev); > - pm_runtime_set_suspended(dev); > + pm_runtime_disable(simple->dev); > + pm_runtime_put_noidle(simple->dev); > + pm_runtime_set_suspended(simple->dev); > +} > + > +static int dwc3_of_simple_remove(struct platform_device *pdev) > +{ > + struct dwc3_of_simple *simple = platform_get_drvdata(pdev); > + > + __dwc3_of_simple_teardown(simple); > > return 0; > } > > +static void dwc3_of_simple_shutdown(struct platform_device *pdev) > +{ > + struct dwc3_of_simple *simple = platform_get_drvdata(pdev); > + > + __dwc3_of_simple_teardown(simple); > +} > + > static int __maybe_unused > dwc3_of_simple_runtime_suspend(struct device *dev) > { > struct dwc3_of_simple *simple = dev_get_drvdata(dev); > @@ -190,6 +201,7 @@ MODULE_DEVICE_TABLE(of, of_dwc3_simple_match); > static struct platform_driver dwc3_of_simple_driver = { > .probe = dwc3_of_simple_probe, > .remove = dwc3_of_simple_remove, > + .shutdown = dwc3_of_simple_shutdown, > .driver = { > .name = "dwc3-of-simple", > .of_match_table = of_dwc3_simple_match, > > Can you make sure it works as you intended? Hi Felipe, just applied your approach to v5.3.7 and it is working properly. Thanks, Vicente. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel