All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Konrad Dybcio" <konradybcio@kernel.org>
Cc: linux-phy@lists.infradead.org, neil.armstrong@linaro.org,
	robh@kernel.org, vkoul@kernel.org, olteanv@gmail.com,
	conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 4/5] phy: qualcomm: qmp-combo: Add USB4/TBT3 configuration data for Hamoa
Date: Tue, 08 Sep 2026 08:14:39 +0000	[thread overview]
Message-ID: <20260908081439.92D371F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260908-topic-usb4phy-v5-4-73aac69578ef@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:

New issues:
- [Low] Incorrect prefix for RX UCDR FASTLOCK_COUNTER registers.
- [Low] Typo in USB4 LFPS register name (written as LPFS).
- [Low] Register sort order violation in header file.

Pre-existing issues:
- [Critical] Unclocked and unpowered register access in qmp_combo_com_init when in USB4 mode.
--

commit dbef849ad62b34a45390169ec84b4136bf981184
Author: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

phy: qualcomm: qmp-combo: Add USB4/TBT3 configuration data for Hamoa

Add the offsets and configuration tables to support USB4 and
Thunderbolt 3 operation on the USB4-capable PHYs found on Hamoa chips.

> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> index a4f130fc33e39..284efc3f23d42 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> @@ -240,6 +240,7 @@ static const unsigned int qmp_v6_n4_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = {
>  	[QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = QPHY_V6_PCS_USB3_LFPS_RXTERM_IRQ_CLEAR,
>  
>  	[QPHY_PCS_CLAMP_ENABLE]		= QPHY_V6_PCS_AON_CLAMP_ENABLE,
> +	[QPHY_PCS_USB4_CLAMP_ENABLE]	= QPHY_V6_PCS_AON_USB4_CLAMP_ENABLE,

[Severity: Critical]
This is a pre-existing issue, but providing this layout entry exposes
qmp_combo_com_init() to an unclocked and unpowered register access in
USB4 mode.

When qmp->qmpphy_mode == QMPPHY_MODE_USB4, qmp_combo_com_init() immediately
executes qphy_setbits() using QPHY_PCS_USB4_CLAMP_ENABLE. This occurs before
regulator_bulk_enable() and clk_bulk_prepare_enable() are called later in
the function.

Accessing unclocked and unpowered APB/AHB mapped registers can cause a
synchronous external abort (bus hang). Could this access be deferred until
after the clocks and regulators are enabled?

[ ... ]
> @@ -2028,6 +2107,68 @@ static const struct qmp_phy_init_tbl x1e80100_usb43dp_tx_tbl[] = {
[ ... ]
> +static const struct qmp_phy_init_tbl x1e80100_usb4_rx_tbl[] = {
[ ... ]
> +	QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE2, 0x30),
> +	QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE2, 0x14),
> +	QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE3, 0xff),
> +	QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE3, 0x3f),

[Severity: Low]
Are these TX macros intentionally placed in the rx_tbl, or do they refer to
RX UCDR FASTLOCK_COUNTER registers?

If they are UCDR registers mapping into the RX hardware block, should they
have the QSERDES_V6_N4_RX_ prefix instead to prevent confusion?

> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> index df670143feb1e..30fdb437146c4 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> @@ -14,4 +14,19 @@
[ ... ]
> +#define QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG3		0x210
> +#define QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG5		0x218
> +#define QPHY_V6_PCS_USB4_LPFS_TX_ECSTART		0x220

[Severity: Low]
Is this intended to be LFPS (Low Frequency Periodic Signaling) instead of
LPFS? It might be clearer to name it QPHY_V6_PCS_USB4_LFPS_TX_ECSTART to
match standard USB protocol terminology.

> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h
> index d37cc0d4fd365..e72ae2cb460ac 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h
> @@ -23,27 +23,63 @@
[ ... ]
>  #define QSERDES_V6_N4_RX_UCDR_FO_GAIN_RATE2		0x8
> +#define QSERDES_V6_N4_RX_UCDR_FO_GAIN_RATE3		0xc
> +#define QSERDES_V6_N4_RX_UCDR_SO_GAIN_RATE3		0x1c
>  #define QSERDES_V6_N4_RX_UCDR_SO_GAIN_RATE2		0x18

[Severity: Low]
Does this break the numerical sort order of the register offsets? Offset
0x1c is defined here before 0x18.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260908-topic-usb4phy-v5-0-73aac69578ef@oss.qualcomm.com?part=4

WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Konrad Dybcio" <konradybcio@kernel.org>
Cc: linux-phy@lists.infradead.org, neil.armstrong@linaro.org,
	robh@kernel.org, vkoul@kernel.org, olteanv@gmail.com,
	conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 4/5] phy: qualcomm: qmp-combo: Add USB4/TBT3 configuration data for Hamoa
Date: Tue, 08 Sep 2026 08:14:39 +0000	[thread overview]
Message-ID: <20260908081439.92D371F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260908-topic-usb4phy-v5-4-73aac69578ef@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:

New issues:
- [Low] Incorrect prefix for RX UCDR FASTLOCK_COUNTER registers.
- [Low] Typo in USB4 LFPS register name (written as LPFS).
- [Low] Register sort order violation in header file.

Pre-existing issues:
- [Critical] Unclocked and unpowered register access in qmp_combo_com_init when in USB4 mode.
--

commit dbef849ad62b34a45390169ec84b4136bf981184
Author: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

phy: qualcomm: qmp-combo: Add USB4/TBT3 configuration data for Hamoa

Add the offsets and configuration tables to support USB4 and
Thunderbolt 3 operation on the USB4-capable PHYs found on Hamoa chips.

> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> index a4f130fc33e39..284efc3f23d42 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> @@ -240,6 +240,7 @@ static const unsigned int qmp_v6_n4_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = {
>  	[QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = QPHY_V6_PCS_USB3_LFPS_RXTERM_IRQ_CLEAR,
>  
>  	[QPHY_PCS_CLAMP_ENABLE]		= QPHY_V6_PCS_AON_CLAMP_ENABLE,
> +	[QPHY_PCS_USB4_CLAMP_ENABLE]	= QPHY_V6_PCS_AON_USB4_CLAMP_ENABLE,

[Severity: Critical]
This is a pre-existing issue, but providing this layout entry exposes
qmp_combo_com_init() to an unclocked and unpowered register access in
USB4 mode.

When qmp->qmpphy_mode == QMPPHY_MODE_USB4, qmp_combo_com_init() immediately
executes qphy_setbits() using QPHY_PCS_USB4_CLAMP_ENABLE. This occurs before
regulator_bulk_enable() and clk_bulk_prepare_enable() are called later in
the function.

Accessing unclocked and unpowered APB/AHB mapped registers can cause a
synchronous external abort (bus hang). Could this access be deferred until
after the clocks and regulators are enabled?

[ ... ]
> @@ -2028,6 +2107,68 @@ static const struct qmp_phy_init_tbl x1e80100_usb43dp_tx_tbl[] = {
[ ... ]
> +static const struct qmp_phy_init_tbl x1e80100_usb4_rx_tbl[] = {
[ ... ]
> +	QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE2, 0x30),
> +	QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE2, 0x14),
> +	QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE3, 0xff),
> +	QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE3, 0x3f),

[Severity: Low]
Are these TX macros intentionally placed in the rx_tbl, or do they refer to
RX UCDR FASTLOCK_COUNTER registers?

If they are UCDR registers mapping into the RX hardware block, should they
have the QSERDES_V6_N4_RX_ prefix instead to prevent confusion?

> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> index df670143feb1e..30fdb437146c4 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> @@ -14,4 +14,19 @@
[ ... ]
> +#define QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG3		0x210
> +#define QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG5		0x218
> +#define QPHY_V6_PCS_USB4_LPFS_TX_ECSTART		0x220

[Severity: Low]
Is this intended to be LFPS (Low Frequency Periodic Signaling) instead of
LPFS? It might be clearer to name it QPHY_V6_PCS_USB4_LFPS_TX_ECSTART to
match standard USB protocol terminology.

> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h
> index d37cc0d4fd365..e72ae2cb460ac 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h
> @@ -23,27 +23,63 @@
[ ... ]
>  #define QSERDES_V6_N4_RX_UCDR_FO_GAIN_RATE2		0x8
> +#define QSERDES_V6_N4_RX_UCDR_FO_GAIN_RATE3		0xc
> +#define QSERDES_V6_N4_RX_UCDR_SO_GAIN_RATE3		0x1c
>  #define QSERDES_V6_N4_RX_UCDR_SO_GAIN_RATE2		0x18

[Severity: Low]
Does this break the numerical sort order of the register offsets? Offset
0x1c is defined here before 0x18.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260908-topic-usb4phy-v5-0-73aac69578ef@oss.qualcomm.com?part=4

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-09-08  8:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08  7:54 [PATCH v5 0/5] USB4 mode programming for QMMPHY on X1E Konrad Dybcio
2026-09-08  7:54 ` Konrad Dybcio
2026-09-08  7:54 ` [PATCH v5 1/5] dt-bindings: phy: qcom,qmp-usb3-dp: Extend X1E description for USB4 Konrad Dybcio
2026-09-08  7:54   ` Konrad Dybcio
2026-09-08  7:54 ` [PATCH v5 2/5] phy: core: Define TBT phy_mode Konrad Dybcio
2026-09-08  7:54   ` Konrad Dybcio
2026-09-08  7:54 ` [PATCH v5 3/5] phy: qualcomm: qmp-combo: Add preliminary USB4 support Konrad Dybcio
2026-09-08  7:54   ` Konrad Dybcio
2026-09-08  8:14   ` sashiko-bot
2026-09-08  8:14     ` sashiko-bot
2026-09-08  7:54 ` [PATCH v5 4/5] phy: qualcomm: qmp-combo: Add USB4/TBT3 configuration data for Hamoa Konrad Dybcio
2026-09-08  7:54   ` Konrad Dybcio
2026-09-08  8:14   ` sashiko-bot [this message]
2026-09-08  8:14     ` sashiko-bot
2026-09-08  7:54 ` [PATCH v5 5/5] arm64: dts: qcom: hamoa: Extend QMPPHY description for USB4 Konrad Dybcio
2026-09-08  7:54   ` Konrad Dybcio
2026-09-13 10:57 ` (subset) [PATCH v5 0/5] USB4 mode programming for QMMPHY on X1E Vinod Koul
2026-09-13 10:57   ` Vinod Koul
2026-09-17 11:27   ` Konrad Dybcio
2026-09-17 11:27     ` Konrad Dybcio
2026-09-18  1:49 ` Bjorn Andersson
2026-09-18  1:49   ` Bjorn Andersson

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=20260908081439.92D371F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /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.