All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Cc: <jingoohan1@gmail.com>, <mani@kernel.org>,
	<lpieralisi@kernel.org>, <kwilczynski@kernel.org>,
	<bhelgaas@google.com>, <linux-pci@vger.kernel.org>,
	<robh@kernel.org>, <thierry.reding@kernel.org>,
	<jonathanh@nvidia.com>, <vidyas@nvidia.com>, <cassel@kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] PCI: tegra194: Use FIELD_*() for register fields
Date: Tue, 17 Nov 2026 22:15:31 +0000	[thread overview]
Message-ID: <20261117221531.26d6e0d2@pumpkin> (raw)
In-Reply-To: <20261102092238.3917883-2-mmaddireddy@nvidia.com>

On Mon, 2 Nov 2026 14:52:37 +0530
Manikanta Maddireddy <mmaddireddy@nvidia.com> wrote:

> Several Tegra194 APPL and DesignWare register fields are programmed
> with open-coded shifts, which makes the register programming more
> verbose than necessary.
> 
> Use FIELD_PREP(), FIELD_MODIFY() and FIELD_GET() at the Tegra call
> sites where values are shifted into fields. The LTSSM state constants
> are converted from pre-shifted register values to unshifted field
> values for FIELD_GET().
> 
> Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
> Link: https://lore.kernel.org/r/20260515070753.3852840-2-mmaddireddy@nvidia.com
> Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
> ---
>  drivers/pci/controller/dwc/pcie-tegra194.c | 137 ++++++++++-----------
>  1 file changed, 67 insertions(+), 70 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index 26e2ac5c5869..62bbfcefe6fe 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> @@ -51,8 +51,7 @@
>  #define APPL_CTRL_SYS_PRE_DET_STATE		BIT(6)
>  #define APPL_CTRL_LTSSM_EN			BIT(7)
>  #define APPL_CTRL_HW_HOT_RST_EN			BIT(20)
> -#define APPL_CTRL_HW_HOT_RST_MODE_MASK		GENMASK(1, 0)
> -#define APPL_CTRL_HW_HOT_RST_MODE_SHIFT		22
> +#define APPL_CTRL_HW_HOT_RST_MODE_MASK		GENMASK(23, 22)

Changing the value of a constant without changing its name
is heading in the direction of a a recipe for disaster.
It doesn't take much (eg a partial backport) for things to go awry.

David

  parent reply	other threads:[~2026-11-17 22:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02  9:22 [PATCH v3 0/2] PCI: dwc: Clean up RAS-DES and register field handling Manikanta Maddireddy
2026-11-02  9:22 ` [PATCH v3 1/2] PCI: tegra194: Use FIELD_*() for register fields Manikanta Maddireddy
2026-11-02  9:27   ` sashiko-bot
2026-11-09 17:19   ` Bjorn Helgaas
2026-11-16 17:01     ` Bjorn Helgaas
2026-11-17 13:33       ` Manikanta Maddireddy
2026-11-17 22:15   ` David Laight [this message]
2026-11-02  9:22 ` [PATCH v3 2/2] PCI: dwc: Consolidate RAS-DES event counter fields Manikanta Maddireddy
2026-11-02  9:27   ` sashiko-bot
2026-11-07 17:05 ` [PATCH v3 0/2] PCI: dwc: Clean up RAS-DES and register field handling Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261117221531.26d6e0d2@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=mmaddireddy@nvidia.com \
    --cc=robh@kernel.org \
    --cc=thierry.reding@kernel.org \
    --cc=vidyas@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.