All of lore.kernel.org
 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 v8 6/9] PCI: dw-rockchip: Add helper function for DDL indicator
Date: Wed, 04 Nov 2026 23:54:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-198319@kernel.org> (raw)
In-Reply-To: <20261105-rockchip-pcie-system-suspend-v8-6-0434b4f373bc@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] PCI: dw-rockchip: rockchip_pcie_unmask_dll_indicator() naming and single use
--

commit 02422c1fdad3696875f51d4d19c596b663cc9a6c
Author: Sebastian Reichel <sebastian.reichel@collabora.com>

PCI: dw-rockchip: Add helper function for DDL indicator

This commit extracts the PCIE_CLIENT_INTR_MASK_MISC register write in
rockchip_pcie_configure_ep() into a new rockchip_pcie_unmask_dll_indicator()
helper function.

>     PCI: dw-rockchip: Add helper function for DDL indicator
>     
>     Remove code duplication and improve readability by introducing a new
>     function to setup the DLL indicator.
>     
>     Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
>     Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

> diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> index c6a4649dae2e8..0e26abc509205 100644
> --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> @@ -700,6 +700,16 @@ static void rockchip_pcie_set_controller_mode(struct rockchip_pcie *rockchip, u3
>  	rockchip_pcie_writel_apb(rockchip, PCIE_CLIENT_SET_MODE(mode), PCIE_CLIENT_GENERAL_CON);
>  }
>  
> +static void rockchip_pcie_unmask_dll_indicator(struct rockchip_pcie *rockchip)
> +{
> +	u32 val;
> +
> +	/* unmask DLL up/down indicator and hot reset/link-down reset */
> +	val = FIELD_PREP_WM16(PCIE_RDLH_LINK_UP_CHGED, 0) |
> +	      FIELD_PREP_WM16(PCIE_LINK_REQ_RST_NOT_INT, 0);
> +	rockchip_pcie_writel_apb(rockchip, val, PCIE_CLIENT_INTR_MASK_MISC);
> +}
> +
>  static int rockchip_pcie_configure_rc(struct platform_device *pdev,
>  				      struct rockchip_pcie *rockchip)
>  {
> @@ -760,7 +770,6 @@ static int rockchip_pcie_configure_ep(struct platform_device *pdev,
>  {
>  	struct device *dev = &pdev->dev;
>  	int irq, ret;
> -	u32 val;
>  
>  	if (!IS_ENABLED(CONFIG_PCIE_ROCKCHIP_DW_EP))
>  		return -ENODEV;
> @@ -800,10 +809,7 @@ static int rockchip_pcie_configure_ep(struct platform_device *pdev,
>  
>  	pci_epc_init_notify(rockchip->pci.ep.epc);
>  
> -	/* unmask DLL up/down indicator and hot reset/link-down reset */
> -	val = FIELD_PREP_WM16(PCIE_RDLH_LINK_UP_CHGED, 0) |
> -	      FIELD_PREP_WM16(PCIE_LINK_REQ_RST_NOT_INT, 0);
> -	rockchip_pcie_writel_apb(rockchip, val, PCIE_CLIENT_INTR_MASK_MISC);
> +	rockchip_pcie_unmask_dll_indicator(rockchip);

[Severity: Low]
This isn't a bug, but is the commit message description and helper naming
accurate here?

First, there is a typo in the commit subject ("DDL" instead of "DLL").

Second, the commit message states that this change removes code duplication,
but rockchip_pcie_configure_ep() in
drivers/pci/controller/dwc/pcie-dw-rockchip.c is the only caller of
rockchip_pcie_unmask_dll_indicator().

Third, rockchip_pcie_unmask_dll_indicator() unmasks both the DLL up/down
indicator (PCIE_RDLH_LINK_UP_CHGED) and the hot reset/link-down reset
interrupt (PCIE_LINK_REQ_RST_NOT_INT) in PCIE_CLIENT_INTR_MASK_MISC, which is
not reflected in the helper's name.

Meanwhile, rockchip_pcie_configure_rc() and
rockchip_pcie_rc_reset_root_port() both open-code the write to
PCIE_CLIENT_INTR_MASK_MISC to unmask PCIE_LINK_REQ_RST_NOT_INT:

	/* unmask hot reset/link-down reset */
	val = FIELD_PREP_WM16(PCIE_LINK_REQ_RST_NOT_INT, 0);
	rockchip_pcie_writel_apb(rockchip, val, PCIE_CLIENT_INTR_MASK_MISC);

Could this helper be parameterized (similar to
rockchip_pcie_enable_enhanced_ltssm_control_mode()) and named to reflect
unmasking miscellaneous interrupts so that the RC paths can also use it?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261105-rockchip-pcie-system-suspend-v8-0-0434b4f373bc@collabora.com?part=6

  reply	other threads:[~2026-11-04 23:55 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 23:47 [PATCH v8 0/9] PCI: dw-rockchip: add system suspend support Sebastian Reichel
2026-11-04 23:47 ` Sebastian Reichel
2026-11-04 23:47 ` [PATCH v8 1/9] PCI: dw-rockchip: Fix LTSSM set functions Sebastian Reichel
2026-11-04 23:47   ` Sebastian Reichel
2026-11-04 23:53   ` sashiko-bot
2026-11-04 23:47 ` [PATCH v8 2/9] PCI: dw-rockchip: Restore vpcie3v3 regulator handle Sebastian Reichel
2026-11-04 23:47   ` Sebastian Reichel
2026-11-04 23:54   ` sashiko-bot
2026-11-04 23:47 ` [PATCH v8 3/9] PCI: dw-rockchip: Move devm_phy_get out of phy_init Sebastian Reichel
2026-11-04 23:47   ` Sebastian Reichel
2026-11-04 23:55   ` sashiko-bot
2026-11-04 23:47 ` [PATCH v8 4/9] PCI: dw-rockchip: Add helper function for enhanced LTSSM control mode Sebastian Reichel
2026-11-04 23:47   ` Sebastian Reichel
2026-11-04 23:55   ` sashiko-bot
2026-11-04 23:47 ` [PATCH v8 5/9] PCI: dw-rockchip: Add helper function for controller mode Sebastian Reichel
2026-11-04 23:47   ` Sebastian Reichel
2026-11-04 23:54   ` sashiko-bot
2026-11-04 23:47 ` [PATCH v8 6/9] PCI: dw-rockchip: Add helper function for DDL indicator Sebastian Reichel
2026-11-04 23:47   ` Sebastian Reichel
2026-11-04 23:54   ` sashiko-bot [this message]
2026-11-04 23:47 ` [PATCH v8 7/9] PCI: dw-rockchip: Add pme_turn_off support Sebastian Reichel
2026-11-04 23:47   ` Sebastian Reichel
2026-11-04 23:56   ` sashiko-bot
2026-11-05  0:51   ` Shawn Lin
2026-11-05  0:51     ` Shawn Lin
2026-11-05 11:38     ` Sebastian Reichel
2026-11-05 11:38       ` Sebastian Reichel
2026-11-04 23:47 ` [PATCH v8 8/9] PCI: dw-rockchip: Set broken L1SS resume flag Sebastian Reichel
2026-11-04 23:47   ` Sebastian Reichel
2026-11-04 23:55   ` sashiko-bot
2026-11-04 23:47 ` [PATCH v8 9/9] PCI: dw-rockchip: Add system PM support Sebastian Reichel
2026-11-04 23:47   ` Sebastian Reichel
2026-11-05  3:08 ` [PATCH v8 0/9] PCI: dw-rockchip: add system suspend support Igor Velkov
2026-11-05  3:08   ` 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-198319@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 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.