Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4036336ybi; Tue, 18 Jun 2019 10:37:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0/D5xfeYSmNq47wlZNLiVAnxZ3/wHwY46kmBGYeOv7QXBTjs3AvppBu8mdIl07liVgu77 X-Received: by 2002:a17:902:9b94:: with SMTP id y20mr99808812plp.260.1560879444247; Tue, 18 Jun 2019 10:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560879444; cv=none; d=google.com; s=arc-20160816; b=G8vg3SKrPsY2Fr9fgetXQ1CHfD/UF4cbRkvWqYM3mxp8DVa6UpGaGmCpF041bNER7k rySkn4Es8YElKDDhalK3xMfq5Da+9WeVLcN1QDC+LRlN79/cUPKtjdDhJ9NUSIGWlRsC N9mlNT41ykLhZ2YEhYKqUzD7YwSLuhscxRwGuG/Dz0lvx9XWaE4Cx5FSTYmVWeqfaveC KYJn/NZPT1oSmYKalnd79AZHTUYVbXgj7zFHC2OZZAFhuurgVbBF0595vVqfOpLKurCL LT6XIoBS8qI8FK3N+oGNZnr7GU48tnVGbDVQ/DUj4bbSzxwkq/lEKnhvEQGks7BQtRIC T18w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=EtLjwWpiDtqSfPhNA/8G8Clz5OAG+A5COmGeaCrkKVg=; b=tO7mj2Lp2z+7lh82+B836RbYs2kYrf6attWsvUalZQNF0h4LpdVIOXhaTM244FO05c SsLE/fSoj/ojNn9SjnCOJi0iqV1X4+i9h3r5TAUfjnMgoLSZAKhFA9fPgb6kfy/8wahU IG0bMShPVbjyhdlnEs+sr1laoJ6xrNeJMLFpj/em9sT2a7MGRTcGUeNH6Ix3PFxfVWGZ aRw84VA7C7jE55NazIwdJsef2dUkMJXTDeSmJoPTliyeR+pwcnK1t5KUzKIelVUyOiGU U3bP41PlVsPbjG6sk7BjjysnYW6vinXKjDFjAyK0yx2l/p4ZyJEBF2Ba3KcweetjpOya ARgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=kwGAzBsQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a190si14579329pfb.122.2019.06.18.10.37.08; Tue, 18 Jun 2019 10:37:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=kwGAzBsQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730091AbfFRRfE (ORCPT + 99 others); Tue, 18 Jun 2019 13:35:04 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:10677 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729586AbfFRRfD (ORCPT ); Tue, 18 Jun 2019 13:35:03 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 18 Jun 2019 10:35:02 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 18 Jun 2019 10:35:01 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 18 Jun 2019 10:35:01 -0700 Received: from [10.2.168.217] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 18 Jun 2019 17:34:58 +0000 Subject: Re: [PATCH V3 02/17] pinctrl: tegra: add suspend and resume support From: Sowjanya Komatineni To: Stephen Warren , Dmitry Osipenko CC: , , , , , , , , , , , , , , , , , , , , , References: <1560843991-24123-1-git-send-email-skomatineni@nvidia.com> <1560843991-24123-3-git-send-email-skomatineni@nvidia.com> <7706a287-44b7-3ad6-37ff-47e97172a798@gmail.com> Message-ID: Date: Tue, 18 Jun 2019 10:34:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1560879302; bh=EtLjwWpiDtqSfPhNA/8G8Clz5OAG+A5COmGeaCrkKVg=; h=X-PGP-Universal:Subject:From:To:CC:References:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Transfer-Encoding: Content-Language; b=kwGAzBsQ1yoTWwKlo2/UOXv2gkDJ8firGCWiN14gqHzMxIIzL+NJZ9lpPELHx7++8 C93tekf3G0sFEXan2CyLBApX5uH4osQ5xuNl+ata+wnHZmNVrOtlPPhO6hhKsV/Juf bZZ27nnu7W7H0ZnSISHtqcoPE+/xNqqhYTqKlosqswoYZXizfVaeos2MrmAZ08rpAS yLrxRqjT/pGG5gMZ13xiR+i9Huo6g16m5gpObtCMD/6v8RkLqVDaMmayD+7Pe8lziR FxzKA/nr4019w/Sj8inE7uex06rlPkDCg+nyeUgJDyr2rcvucvqnbVPNXZILdkVwtR xtp0jurZ5tT0Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/18/19 9:50 AM, Sowjanya Komatineni wrote: > > On 6/18/19 8:41 AM, Stephen Warren wrote: >> On 6/18/19 3:30 AM, Dmitry Osipenko wrote: >>> 18.06.2019 12:22, Dmitry Osipenko =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>>> 18.06.2019 10:46, Sowjanya Komatineni =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>>>> This patch adds suspend and resume support for Tegra pinctrl driver >>>>> and registers them to syscore so the pinmux settings are restored >>>>> before the devices resume. >>>>> >>>>> Signed-off-by: Sowjanya Komatineni >>>>> --- >>>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra.c=C2=A0=C2=A0=C2=A0 | 62=20 >>>>> ++++++++++++++++++++++++++++++++ >>>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra.h=C2=A0=C2=A0=C2=A0 |=C2= =A0 5 +++ >>>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra114.c |=C2=A0 1 + >>>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra124.c |=C2=A0 1 + >>>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra20.c=C2=A0 |=C2=A0 1 + >>>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra210.c | 13 +++++++ >>>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra30.c=C2=A0 |=C2=A0 1 + >>>>> =C2=A0 7 files changed, 84 insertions(+) >>>>> >>>>> diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c=20 >>>>> b/drivers/pinctrl/tegra/pinctrl-tegra.c >>>>> index 34596b246578..ceced30d8bd1 100644 >>>>> --- a/drivers/pinctrl/tegra/pinctrl-tegra.c >>>>> +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c >>>>> @@ -20,11 +20,16 @@ >>>>> =C2=A0 #include >>>>> =C2=A0 #include >>>>> =C2=A0 #include >>>>> +#include >>>>> =C2=A0 =C2=A0 #include "../core.h" >>>>> =C2=A0 #include "../pinctrl-utils.h" >>>>> =C2=A0 #include "pinctrl-tegra.h" >>>>> =C2=A0 +#define EMMC2_PAD_CFGPADCTRL_0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x1c8 >>>>> +#define EMMC4_PAD_CFGPADCTRL_0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x1e0 >>>>> +#define EMMC_DPD_PARKING=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (0x1fff << 14) >>>>> + >>>>> =C2=A0 static inline u32 pmx_readl(struct tegra_pmx *pmx, u32 bank, u= 32=20 >>>>> reg) >>>>> =C2=A0 { >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return readl(pmx->regs[bank] + reg); >>>>> @@ -619,6 +624,48 @@ static void=20 >>>>> tegra_pinctrl_clear_parked_bits(struct tegra_pmx *pmx) >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 pmx_writel(pmx, val, g->mux_bank, g->mux_reg); >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0 if (pmx->soc->has_park_padcfg) { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val =3D pmx_readl(pmx, 0,= EMMC2_PAD_CFGPADCTRL_0); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val &=3D ~EMMC_DPD_PARKIN= G; >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pmx_writel(pmx, val, 0, E= MMC2_PAD_CFGPADCTRL_0); >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val =3D pmx_readl(pmx, 0,= EMMC4_PAD_CFGPADCTRL_0); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val &=3D ~EMMC_DPD_PARKIN= G; >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pmx_writel(pmx, val, 0, E= MMC4_PAD_CFGPADCTRL_0); >>>>> +=C2=A0=C2=A0=C2=A0 } >>>>> +} >>>> >>>> Is there any reason why parked_bit can't be changed to=20 >>>> parked_bitmask like I was >>>> asking in a comment to v2? >>>> >>>> I suppose that it's more preferable to keep pinctrl-tegra.c=20 >>>> platform-agnostic for >>>> consistency when possible, hence adding platform specifics here=20 >>>> should be discouraged. >>>> And then the parked_bitmask will also result in a proper hardware=20 >>>> description in the code. >>>> >>> >>> I'm now also vaguely recalling that Stephen Warren had some kind of=20 >>> a "code generator" >>> for the pinctrl drivers. So I guess all those tables were=20 >>> auto-generated initially. >>> >>> Stephen, maybe you could adjust the generator to take into account=20 >>> the bitmask (of >>> course if that's a part of the generated code) and then re-gen it=20 >>> all for Sowjanya? >> >> https://github.com/NVIDIA/tegra-pinmux-scripts holds the scripts that=20 >> generate tegra-pinctrlNNN.c. See soc-to-kernel-pinctrl-driver.py.=20 >> IIRC, tegra-pinctrl.c (the core file) isn't auto-generated. Sowjanya=20 >> is welcome to send a patch to that repo if the code needs to be updated. > > > Hi Dmitry, > > Just want to be clear on my understanding of your request. > > "change parked_bit to parked_bitmask" are you requested to change=20 > parked_bit of PINGROUP and DRV_PINGROUP to use bitmask value rather=20 > than bit position inorder to have parked bit configuration for EMMC=20 > PADs as well to happen by masking rather than checking for existence=20 > of parked_bit? > > Trying to understand the reason/benefit for changing parked_bit to=20 > parked_bitmask. Also, Park bits in CFGPAD registers are not common for all CFGPAD=20 registers. Park bits are available only for EMMC and also those bits are=20 used for something else on other CFGPAD registers so bitmask can't be=20 common and this also need an update to DRV_PINGROUP macro args just only=20 to handle EMMC parked_bitmask. So not sure of the benefit in using=20 bitmask rather than parked_bit > > thanks > > Sowjanya >