Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3507955ybz; Mon, 20 Apr 2020 04:17:14 -0700 (PDT) X-Google-Smtp-Source: APiQypJUihiM/Yo9j1J36eX65FBJcMgPWMu0gmyor3YzRxR9x16H5p96Tyu1RacptfJcM9LY4p25 X-Received: by 2002:a17:907:214d:: with SMTP id rk13mr15918116ejb.220.1587381433848; Mon, 20 Apr 2020 04:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587381433; cv=none; d=google.com; s=arc-20160816; b=Gnl7OjzbO/NliYwDNUilMkubtuURdCQAmMuzEnrVSwdI3ag/nPUiYDsoQnFY8hnc96 UY7+mr3fr5YMTp7PpBqwmsoBGRN1Sue9wPYtWuvXDx+spO+unZby9jJW+nBMx8y4XV8+ kLE285IdIsUFpR3kz8QmHQgol8GmAs16+oI8JDhXbCG59NqvZwRNMqPTszrG6D1JzwKq MKdTNShDqB90pq+tDNqhyw6zInNCCXLzXTFBYEecDCmiRKNMMl5xYiVi+7vGLCtE0QJ2 nMLJLEh0ICVaxg124fs2j4Yxf9W8nA4yxQYHza6NHaNONronOfx6ylvDbTZfkBaXHW8H 3Hyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4uCgchzEKUbGCjVb5ErPQQvp7VtDEqWO3rkjRlf6Z0c=; b=cKqLxvdVDpOGNFjZXo/Zs/NRjc5OuFdCOl/rc5xxChR1b8OmfGHVxFVMRdVlQGJEnq jurYQoa9SQAA75L6/90J9V4n/kga8sZ8kyrCU1UlZo/FLWmKiTtZGUD0HN1ybO560Qo9 ayAnkfzp4ADawh+KxPjgMGC4rjJAmT38MCWkpRGxG926Qj1SXVaG39YAXIQfA2fhC0fs D3t/ChhewuzHOInamOubRF3LndIwJCHysvhqgosjfGKvqkj6vtyk47nknC7Ol89UkpmA bVFwowZmu1wQYXzDVoeomqSxe0U1CNa88V7bq93HiASbSCr1QrA1YMAkmN2N7r/qE356 j4Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z69BlBZc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si363088ejn.246.2020.04.20.04.16.49; Mon, 20 Apr 2020 04:17:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z69BlBZc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726207AbgDTLP1 (ORCPT + 99 others); Mon, 20 Apr 2020 07:15:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725994AbgDTLP0 (ORCPT ); Mon, 20 Apr 2020 07:15:26 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D26FC061A10 for ; Mon, 20 Apr 2020 04:15:26 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id i10so11596494wrv.10 for ; Mon, 20 Apr 2020 04:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=4uCgchzEKUbGCjVb5ErPQQvp7VtDEqWO3rkjRlf6Z0c=; b=Z69BlBZc3+yIjY+OiSNwt8bsyBI0gsYDwMfdiucsDa5C+MKP/wOJquAOhh0jY8LvP8 DrypNHoQ8098wugctLVFMem6rV1KysE9rL4PQbw9dgV9IX4vzDo8vaR3IolrnwdZnlue oiYWMkYalyjVcjm2bEgoiKKZoPYWWSYOSW2mlfPKPx+R10IJHuVAXZKI+CMv1NXjZwBe 4ApmE0F3A3wQai4D9aDrDuXakAc3roQsOINa7eE95IHRnzDQ2WMpJIYitHW849I7SOu2 /WgTnsClHrd3yTWNDwW+tMRpyK1PDxfZIy/Qi+no+uSblRgwH6XmDdXWWcVSG1+c8QGu WI1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=4uCgchzEKUbGCjVb5ErPQQvp7VtDEqWO3rkjRlf6Z0c=; b=spaP+7ensY1jsEWaBzs4S96Iilekps/DYnMrlHNrBoN/+Dp1UFEb8Al0krYgq0gjn2 R3hXStBoHmkkaTH+7cEi0xiYAZc8/WAxzLt9BiRQwU9+pGISU5JIKedM0hqo4AAZfgQa TO4mk8G8hTvaGhRLqeskrb93wyhhPHyczTYGb47oBDCfRZbKd6hYWcoF/kb7W7Kghl94 7aIRYaiJGeISQu4oOWeJzgPSnbh8pPgA5bkBkbgsCdfHT69RjoudFGFIMcdzSBIeb1f2 sSIP4zG8UN/N5Xw20k8KjLSehbG7hcylG1C4qijPBobCAXfe/6cwdbcWIRymtz7hsC4j FOEA== X-Gm-Message-State: AGi0Pub8L0Pb2QfW9Ii7k5SkEQpyGHUOYoR5/CUEXXOnG+6tw+HAvIpR Du43ZWVYe2VryfBsvtIM2waAWQ== X-Received: by 2002:a5d:5147:: with SMTP id u7mr17746146wrt.290.1587381324902; Mon, 20 Apr 2020 04:15:24 -0700 (PDT) Received: from dell ([95.149.164.107]) by smtp.gmail.com with ESMTPSA id q143sm969035wme.31.2020.04.20.04.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 04:15:24 -0700 (PDT) Date: Mon, 20 Apr 2020 12:15:22 +0100 From: Lee Jones To: Hsin-hsiung Wang Cc: Mark Rutland , Kate Stewart , Alexandre Belloni , linux-kernel@vger.kernel.org, Richard Fontana , linux-rtc@vger.kernel.org, Nicolas Boichat , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Frank Wunderlich , Ran Bi , Sean Wang , Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , Thomas Gleixner , Eddie Huang , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , Josef Friedl , srv_heupstream@mediatek.com, Sebastian Reichel Subject: Re: [PATCH v12 1/6] mfd: mt6397: Modify suspend/resume behavior Message-ID: <20200420111522.GB3612@dell> References: <1586333531-21641-1-git-send-email-hsin-hsiung.wang@mediatek.com> <1586333531-21641-2-git-send-email-hsin-hsiung.wang@mediatek.com> <20200416084910.GX2167633@dell> <1587379959.6297.2.camel@mtksdaap41> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1587379959.6297.2.camel@mtksdaap41> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 Apr 2020, Hsin-hsiung Wang wrote: > Hi, > > On Thu, 2020-04-16 at 09:49 +0100, Lee Jones wrote: > > On Wed, 08 Apr 2020, Hsin-Hsiung Wang wrote: > > > > > Some pmics don't need backup interrupt settings, so we change to use > > > pm notifier for the pmics which are necessary to store settings. > > > > > > Signed-off-by: Hsin-Hsiung Wang > > > --- > > > drivers/mfd/mt6397-core.c | 30 ------------------------------ > > > drivers/mfd/mt6397-irq.c | 35 ++++++++++++++++++++++++++++++++++- > > > include/linux/mfd/mt6397/core.h | 2 ++ > > > 3 files changed, 36 insertions(+), 31 deletions(-) > > > > > > diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c > > > index 0437c85..d2e70d8 100644 > > > --- a/drivers/mfd/mt6397-core.c > > > +++ b/drivers/mfd/mt6397-core.c > > > @@ -100,35 +100,6 @@ static const struct mfd_cell mt6397_devs[] = { > > > } > > > }; > > > > > > -#ifdef CONFIG_PM_SLEEP > > > -static int mt6397_irq_suspend(struct device *dev) > > > -{ > > > - struct mt6397_chip *chip = dev_get_drvdata(dev); > > > - > > > - regmap_write(chip->regmap, chip->int_con[0], chip->wake_mask[0]); > > > - regmap_write(chip->regmap, chip->int_con[1], chip->wake_mask[1]); > > > - > > > - enable_irq_wake(chip->irq); > > > - > > > - return 0; > > > -} > > > - > > > -static int mt6397_irq_resume(struct device *dev) > > > -{ > > > - struct mt6397_chip *chip = dev_get_drvdata(dev); > > > - > > > - regmap_write(chip->regmap, chip->int_con[0], chip->irq_masks_cur[0]); > > > - regmap_write(chip->regmap, chip->int_con[1], chip->irq_masks_cur[1]); > > > - > > > - disable_irq_wake(chip->irq); > > > - > > > - return 0; > > > -} > > > -#endif > > > - > > > -static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_irq_suspend, > > > - mt6397_irq_resume); > > > - > > > struct chip_data { > > > u32 cid_addr; > > > u32 cid_shift; > > > @@ -238,7 +209,6 @@ static struct platform_driver mt6397_driver = { > > > .driver = { > > > .name = "mt6397", > > > .of_match_table = of_match_ptr(mt6397_of_match), > > > - .pm = &mt6397_pm_ops, > > > }, > > > .id_table = mt6397_id, > > > }; > > > diff --git a/drivers/mfd/mt6397-irq.c b/drivers/mfd/mt6397-irq.c > > > index b2d3ce1..2924919 100644 > > > --- a/drivers/mfd/mt6397-irq.c > > > +++ b/drivers/mfd/mt6397-irq.c > > > @@ -9,6 +9,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -81,7 +82,7 @@ static struct irq_chip mt6397_irq_chip = { > > > static void mt6397_irq_handle_reg(struct mt6397_chip *mt6397, int reg, > > > int irqbase) > > > { > > > - unsigned int status; > > > + unsigned int status = 0; > > > > This looks like an unrelated change, no? > > > > It is to fix the coverity defect. Which isn't mentioned in the commit log and doesn't have anything to do with this patch. Thus it should be in a separate patch, but I'm not going to lose any sleep over it. > > > int i, irq, ret; > > > > > > ret = regmap_read(mt6397->regmap, reg, &status); > > > @@ -128,6 +129,36 @@ static const struct irq_domain_ops mt6397_irq_domain_ops = { > > > .map = mt6397_irq_domain_map, > > > }; > > > > Other than that. > > > > For my own reference: > > Acked-for-MFD-by: Lee Jones > > > Thanks for your review. I will add it in the next version. > -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog