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=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable 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 5D972C28EB4 for ; Thu, 6 Jun 2019 15:46:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 417A72083D for ; Thu, 6 Jun 2019 15:46:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729368AbfFFPqV (ORCPT ); Thu, 6 Jun 2019 11:46:21 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:35506 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729185AbfFFPqV (ORCPT ); Thu, 6 Jun 2019 11:46:21 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4D16868F10A3783AD570; Thu, 6 Jun 2019 23:46:18 +0800 (CST) Received: from localhost (10.202.226.61) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Thu, 6 Jun 2019 23:46:14 +0800 Date: Thu, 6 Jun 2019 16:46:00 +0100 From: Jonathan Cameron To: Chun-Hung Wu CC: Matthias Brugger , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Rob Herring , Mark Rutland , , , , , , , , , , Subject: Re: [PATCH 3/4] iio: adc: mediatek: SET_LATE_SYSTEM_SLEEP_PM_OPS support Message-ID: <20190606164600.000060b3@huawei.com> In-Reply-To: <1559041196.12867.3.camel@mtkswgap22> References: <1557994247-16739-1-git-send-email-chun-hung.wu@mediatek.com> <1557994247-16739-4-git-send-email-chun-hung.wu@mediatek.com> <20190518113527.5210b0bf@archlinux> <1558332205.11080.6.camel@mtkswgap22> <7838dcae-8a69-0297-718b-a061b14a456d@gmail.com> <1559041196.12867.3.camel@mtkswgap22> Organization: Huawei X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.61] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 May 2019 18:59:56 +0800 Chun-Hung Wu wrote: > Hi Matthias: > > Thanks for your suggestion, I think device_links is a good way to > make dependency of module's suspend/resume order. > > Hi Jonathan: > > Is it ok to keep using late_suspend and early_resume, or do you think > it's better to use device_links? I think device links would be preferable as the reasoning becomes explicit. As I understand them they are also a less fragile solution. Thanks, Jonathan > > Thanks, > Chun-Hung > On Wed, 2019-05-22 at 18:28 +0200, Matthias Brugger wrote: > > > > On 20/05/2019 08:03, Chun-Hung Wu wrote: > > > Hi Jonathan: > > > > > > Thanks for the prompt reply, > > > > > > On Sat, 2019-05-18 at 11:35 +0100, Jonathan Cameron wrote: > > >> On Thu, 16 May 2019 16:10:46 +0800 > > >> Chun-Hung Wu wrote: > > >> > > >>> Move suspend/resume to late_suspend and > > >>> early_resume to gurantee users can use auxadc > > >> guarantee > > >> > > > will fix it in next version. > > >>> driver at suspend/resume stage. > > >> No problem with the patch content, but we need a reason why they may > > >> want to do so? > > > Our thermal drivers uses auxadc at suspend/resume stage. > > > In order to avoid auxadc suspended prior to thermal driver, > > > we move auxadc to late_suspend and early_resume. > > > > > > > That sounds like a user of device_links [1] to me. > > > > [1] https://www.kernel.org/doc/html/latest/driver-api/device_link.html > > > > > Thanks, > > > Chun-Hung > > >> > > >> Thanks, > > >> > > >> Jonathan > > >>> > > >>> Signed-off-by: Chun-Hung Wu > > >>> --- > > >>> drivers/iio/adc/mt6577_auxadc.c | 7 ++++--- > > >>> 1 file changed, 4 insertions(+), 3 deletions(-) > > >>> > > >>> diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c > > >>> index e1bdcc0..58d7cb2 100644 > > >>> --- a/drivers/iio/adc/mt6577_auxadc.c > > >>> +++ b/drivers/iio/adc/mt6577_auxadc.c > > >>> @@ -326,9 +326,10 @@ static int mt6577_auxadc_remove(struct platform_device *pdev) > > >>> return 0; > > >>> } > > >>> > > >>> -static SIMPLE_DEV_PM_OPS(mt6577_auxadc_pm_ops, > > >>> - mt6577_auxadc_suspend, > > >>> - mt6577_auxadc_resume); > > >>> +static const struct dev_pm_ops mt6577_auxadc_pm_ops = { > > >>> + SET_LATE_SYSTEM_SLEEP_PM_OPS(mt6577_auxadc_suspend, > > >>> + mt6577_auxadc_resume) > > >>> +}; > > >>> > > >>> static const struct of_device_id mt6577_auxadc_of_match[] = { > > >>> { .compatible = "mediatek,mt2701-auxadc", .data = &mt8173_compat}, > > >> > > > > > > > >