From: sashiko-bot@kernel.org
To: "Geraldo Nascimento" <geraldogabriel@gmail.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v7 3/3] PCI: rockchip: drive at 2.5 GT/s, error other speeds
Date: Tue, 16 Jun 2026 15:37:48 +0000 [thread overview]
Message-ID: <20260616153748.EA2D41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <7421df7a7b7778ee99363cccfdfabbfa8aa6ab5e.1781622998.git.geraldogabriel@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Spurious warning emitted when the optional 'max-link-speed' device tree property is absent.
- [Low] The parsed `max-link-speed` value stored in `rockchip->link_gen` is dead code and entirely ignored during link initialization.
--
commit 3b268bac2a052935f203b8d3ae0eea857d63f07b
Author: Geraldo Nascimento <geraldogabriel@gmail.com>
PCI: rockchip: drive at 2.5 GT/s, error other speeds
This commit configures the Rockchip PCIe core to drive at a maximum link
speed of 2.5 GT/s to prevent potential data loss or hardware issues. It
ignores other configured speeds with a warning and removes 5.0 GT/s defines.
Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock-chips.com/
> diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c
> index 0f88da3788054..456dcfd676ed7 100644
> --- a/drivers/pci/controller/pcie-rockchip.c
> +++ b/drivers/pci/controller/pcie-rockchip.c
> @@ -66,8 +66,10 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
> }
>
> rockchip->link_gen = of_pci_get_max_link_speed(node);
> - if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
> - rockchip->link_gen = 2;
> + if (rockchip->link_gen < 0 || rockchip->link_gen >= 2) {
> + rockchip->link_gen = 1;
> + dev_warn(dev, "invalid max-link-speed, limited to 2.5 GT/s\n");
> + }
[Severity: Medium]
Since the max-link-speed device tree property is optional,
of_pci_get_max_link_speed() will return a negative error code such as -EINVAL
when it is absent. Does this mean the rockchip->link_gen < 0 check will cause
a spurious warning on every boot for perfectly valid device trees that
omit this property?
>
> for (i = 0; i < ROCKCHIP_NUM_PM_RSTS; i++)
> rockchip->pm_rsts[i].id = rockchip_pci_pm_rsts[i];
[ ... ]
> @@ -147,12 +149,8 @@ int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
> goto err_exit_phy;
> }
>
> - if (rockchip->link_gen == 2)
> - rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_2,
> - PCIE_CLIENT_CONFIG);
> - else
> - rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_1,
> - PCIE_CLIENT_CONFIG);
> + rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_1,
> + PCIE_CLIENT_CONFIG);
[Severity: Low]
Does this unconditional write make the rockchip->link_gen value parsed in
rockchip_pcie_parse_dt() obsolete? If link_gen is no longer used during link
initialization, could the device tree parsing logic and state be removed
entirely to simplify the code?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1781622998.git.geraldogabriel@gmail.com?part=3
next prev parent reply other threads:[~2026-06-16 15:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 15:24 [PATCH v7 0/3] PCI: rockchip: 5.0 GT/s speed discouraged by Rockchip Geraldo Nascimento
2026-06-16 15:24 ` Geraldo Nascimento
2026-06-16 15:25 ` [PATCH v7 1/3] PCI: rockchip-ep: do not attempt 5.0 GT/s retraining Geraldo Nascimento
2026-06-16 15:25 ` Geraldo Nascimento
2026-06-16 15:35 ` sashiko-bot
2026-06-16 19:06 ` Dragan Simic
2026-06-16 19:06 ` Dragan Simic
2026-06-16 15:25 ` [PATCH v7 2/3] PCI: rockchip-host: " Geraldo Nascimento
2026-06-16 15:25 ` Geraldo Nascimento
2026-06-16 15:35 ` sashiko-bot
2026-06-16 19:08 ` Dragan Simic
2026-06-16 19:08 ` Dragan Simic
2026-06-16 15:26 ` [PATCH v7 3/3] PCI: rockchip: drive at 2.5 GT/s, error other speeds Geraldo Nascimento
2026-06-16 15:26 ` Geraldo Nascimento
2026-06-16 15:37 ` sashiko-bot [this message]
2026-06-16 19:10 ` Dragan Simic
2026-06-16 19:10 ` Dragan Simic
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=20260616153748.EA2D41F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=geraldogabriel@gmail.com \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.