Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v7 04/10] PCI: dw-rockchip: Add helper function for enhanced LTSSM control mode
Date: Wed, 04 Nov 2026 19:20:35 +0000	[thread overview]
Message-ID: <sashiko-outbox-197939@kernel.org> (raw)
In-Reply-To: <20261104-rockchip-pcie-system-suspend-v7-4-6ae6875939a2@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] PCI: dw-rockchip: missed LTSSM helper in rockchip_pcie_rc_reset_root_port()
--

commit 01b1475be69dbc97dabfa0df29b029fb455894d6
Author: Sebastian Reichel <sebastian.reichel@collabora.com>

PCI: dw-rockchip: Add helper function for enhanced LTSSM control mode

This commit introduces a rockchip_pcie_enable_enhanced_ltssm_control_mode()
helper function to deduplicate setting up the enhanced LTSSM mode in
rockchip_pcie_configure_rc() and rockchip_pcie_configure_ep().

> diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> index a3b0fb918479f..7645b0895bf91 100644
> --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> @@ -683,6 +683,18 @@ static irqreturn_t rockchip_pcie_ep_sys_irq_thread(int irq, void *arg)
>  	return IRQ_HANDLED;
>  }
>  
> +static void rockchip_pcie_enable_enhanced_ltssm_control_mode(struct rockchip_pcie *rockchip,
> +							     bool delay_link_training_after_reset)
> +{
> +	u32 val;
> +
> +	/* Enable the enhanced control mode of signal app_ltssm_enable */
> +	val = FIELD_PREP_WM16(PCIE_LTSSM_ENABLE_ENHANCE, 1);
> +	if (delay_link_training_after_reset)
> +		val |= FIELD_PREP_WM16(PCIE_LTSSM_APP_DLY2_EN, 1);
> +	rockchip_pcie_writel_apb(rockchip, val, PCIE_CLIENT_HOT_RESET_CTRL);
> +}
> +
>  static int rockchip_pcie_configure_rc(struct platform_device *pdev,
>  				      struct rockchip_pcie *rockchip)
>  {
> @@ -706,9 +718,7 @@ static int rockchip_pcie_configure_rc(struct platform_device *pdev,
>  		return ret;
>  	}
>  
> -	/* LTSSM enable control mode */
> -	val = FIELD_PREP_WM16(PCIE_LTSSM_ENABLE_ENHANCE, 1);
> -	rockchip_pcie_writel_apb(rockchip, val, PCIE_CLIENT_HOT_RESET_CTRL);
> +	rockchip_pcie_enable_enhanced_ltssm_control_mode(rockchip, false);

[Severity: Low]
As reported by Sashiko on v6 [1], rockchip_pcie_rc_reset_root_port() in
drivers/pci/controller/dwc/pcie-dw-rockchip.c still open-codes the same
PCIE_CLIENT_HOT_RESET_CTRL write:

	/* LTSSM enable control mode */
	val = FIELD_PREP_WM16(PCIE_LTSSM_ENABLE_ENHANCE, 1);
	rockchip_pcie_writel_apb(rockchip, val, PCIE_CLIENT_HOT_RESET_CTRL);

Should rockchip_pcie_rc_reset_root_port() also be converted to call
rockchip_pcie_enable_enhanced_ltssm_control_mode(rockchip, false)?

[1] https://lore.kernel.org/r/20260908-rockchip-pcie-system-suspend-v6-4-fbabcca9921b@collabora.com

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-rockchip-pcie-system-suspend-v7-0-6ae6875939a2@collabora.com?part=4

  reply	other threads:[~2026-11-04 19:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 18:56 [PATCH v7 00/10] PCI: dw-rockchip: add system suspend support Sebastian Reichel
2026-11-04 18:56 ` [PATCH v7 01/10] PCI: dw-rockchip: Fix LTSSM set functions Sebastian Reichel
2026-11-04 19:02   ` sashiko-bot
2026-11-04 18:56 ` [PATCH v7 02/10] PCI: dw-rockchip: Restore vpcie3v3 regulator handle Sebastian Reichel
2026-11-04 19:07   ` sashiko-bot
2026-11-04 18:56 ` [PATCH v7 03/10] PCI: dw-rockchip: Move devm_phy_get out of phy_init Sebastian Reichel
2026-11-04 19:15   ` sashiko-bot
2026-11-04 18:56 ` [PATCH v7 04/10] PCI: dw-rockchip: Add helper function for enhanced LTSSM control mode Sebastian Reichel
2026-11-04 19:20   ` sashiko-bot [this message]
2026-11-04 18:56 ` [PATCH v7 05/10] PCI: dw-rockchip: Add helper function for controller mode Sebastian Reichel
2026-11-04 19:24   ` sashiko-bot
2026-11-04 18:56 ` [PATCH v7 06/10] PCI: dw-rockchip: Add helper function for DDL indicator Sebastian Reichel
2026-11-04 19:31   ` sashiko-bot
2026-11-04 18:56 ` [PATCH v7 07/10] PCI: dw-rockchip: Add pme_turn_off support Sebastian Reichel
2026-11-04 19:37   ` sashiko-bot
2026-11-04 18:56 ` [PATCH v7 08/10] PCI: dw-rockchip: Set broken L1SS resume flag Sebastian Reichel
2026-11-04 19:42   ` sashiko-bot
2026-11-04 18:56 ` [PATCH v7 09/10] PCI: dw-rockchip: Add system PM support Sebastian Reichel
2026-11-04 19:57   ` sashiko-bot
2026-11-04 18:56 ` [PATCH v7 10/10] PCI: dw-rockchip: Clear debug buffer before entering L2 Sebastian Reichel
2026-11-04 20:03   ` sashiko-bot
2026-11-04 22:44 ` [PATCH v7 00/10] PCI: dw-rockchip: add system suspend support Igor Velkov

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=sashiko-outbox-197939@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sebastian.reichel@collabora.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