Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-rockchip@lists.infradead.org,
	Manivannan Sadhasivam <mani@kernel.org>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI: dw-rockchip: Change get_lttssm() to provide L1ss info
Date: Thu, 11 Dec 2025 10:29:57 -0600	[thread overview]
Message-ID: <20251211162957.GA3595695@bhelgaas> (raw)
In-Reply-To: <1764035632-180821-2-git-send-email-shawn.lin@rock-chips.com>

On Tue, Nov 25, 2025 at 09:53:52AM +0800, Shawn Lin wrote:
> This patch renames rockchip_pcie_get_ltssm() to rockchip_pcie_get_ltssm_reg()
> and adds rockchip_pcie_get_ltssm() to get_lttssm() callback to in order to
> show the proper L1 substates. The PCIE_CLIENT_LTSSM_STATUS[5:0] register returns
> the same ltssm layout as enum dw_pcie_ltssm. So we only need to tell L1ss apart
> and return the proper value defined in pcie-designware.h.
> 
> cat /sys/kernel/debug/dwc_pcie_a40000000.pcie/ltssm_status
> L1_2 (0x142)

s/get_lttssm/get_ltssm/ (subject and commit log)
s/This patch renames/Rename/ (imperative mood)
s/and adds/and add/ (imperative mood)
s/ltssm/LTSSM/
s/L1ss/L1 PM Substates/

Wrap the commit log to fit in 75 columns to allow for "git log"
indenting everything.

Indent the "cat /sys/..." example two spaces.

> +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> +static enum dw_pcie_ltssm rockchip_pcie_get_ltssm(struct dw_pcie *pci)
> +{
> +	struct rockchip_pcie *rockchip = to_rockchip_pcie(pci);
> +	u32 val = rockchip_pcie_readl_apb(rockchip, PCIE_CLIENT_CDM_RASDES_TBA_INFO_CMN);
> +

Wrap to fit in 80 columns like the rest of the file.  Or possibly
reduce the length of "PCIE_CLIENT_CDM_RASDES_TBA_INFO_CMN", which
might be excessively descriptive.

> +	if (val & PCIE_CLIENT_CDM_RASDES_TBA_L1_1)
> +		return DW_PCIE_LTSSM_L1_1;
> +	else if (val & PCIE_CLIENT_CDM_RASDES_TBA_L1_2)
> +		return DW_PCIE_LTSSM_L1_2;
> +	else
> +		return rockchip_pcie_get_ltssm_reg(rockchip) &
> +			PCIE_LTSSM_STATUS_MASK;

None of these "else" uses are needed:

  if (val & PCIE_CLIENT_CDM_RASDES_TBA_L1_1)
    return DW_PCIE_LTSSM_L1_1;

  if (val & PCIE_CLIENT_CDM_RASDES_TBA_L1_2)
    return DW_PCIE_LTSSM_L1_2;

  return rockchip_pcie_get_ltssm_reg(rockchip) & PCIE_LTSSM_STATUS_MASK;

  reply	other threads:[~2025-12-11 16:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25  1:53 [PATCH 1/2] PCI: dwc: Add L1ss context to ltssm_status of debugfs Shawn Lin
2025-11-25  1:53 ` [PATCH 2/2] PCI: dw-rockchip: Change get_lttssm() to provide L1ss info Shawn Lin
2025-12-11 16:29   ` Bjorn Helgaas [this message]
2025-12-11  1:41 ` [PATCH 1/2] PCI: dwc: Add L1ss context to ltssm_status of debugfs Shawn Lin
2025-12-11 16:29 ` Bjorn Helgaas

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=20251211162957.GA3595695@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mani@kernel.org \
    --cc=shawn.lin@rock-chips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox