From: Yixun Lan <dlan@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org,
linux-scsi@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v6 2/2] scsi: ufs: spacemit: k3: Add UFS Host Controller driver
Date: Fri, 2 Oct 2026 03:06:12 +0000 [thread overview]
Message-ID: <20261002030612-GKC51329@kernel.org> (raw)
In-Reply-To: <20260921124652.AF2201F000FF@smtp.kernel.org>
Hi ALL,
On 12:46 Mon 21 Sep , sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [Medium] scsi: ufs: spacemit: missing M-PHY TX EQ configuration for lane 1
> - [Medium] scsi: ufs: spacemit: unchecked return value from quirk configuration
> --
>
> commit 16f84e82c7f6101530a90dc4cc7509a53d6ac1b4
> Author: Yixun Lan <dlan@kernel.org>
>
> scsi: ufs: spacemit: k3: Add UFS Host Controller driver
>
> This commit introduces the UFS host controller driver for the SpacemiT K3
> SoC. It implements the vendor-specific configurations and initialization
> sequences required to interact with the M-PHY and UniPro hardware.
>
> > diff --git a/drivers/ufs/host/ufs-spacemit.c b/drivers/ufs/host/ufs-spacemit.c
> > new file mode 100644
> > index 0000000000000..941506cc5ab68
> > --- /dev/null
> > +++ b/drivers/ufs/host/ufs-spacemit.c
>
> [ ... ]
>
> > @@ -211,6 +211,9 @@ static int ufs_spacemit_uniprov1p6_init(struct ufs_hba *hba)
> > + /* RX HB8_TIME CAP */
> > + { UIC_ARG_MIB_SEL(0x0092, UIC_ARG_MPHY_RX_GEN_SEL_INDEX(0)), 0x64 },
> > + { UIC_ARG_MIB_SEL(0x0092, UIC_ARG_MPHY_RX_GEN_SEL_INDEX(1)), 0x64 },
> > + /* TX EQ 3DB */
> > + { UIC_ARG_MIB_SEL(0x00CD, UIC_ARG_MPHY_TX_GEN_SEL_INDEX(0)), 0x5 },
>
> [Severity: Medium]
> The TX EQ 3DB attribute is explicitly configured for lane 0, but the
> corresponding configuration for lane 1 (UIC_ARG_MPHY_TX_GEN_SEL_INDEX(1))
> is missing in ufs_spacemit_uniprov1p6_init(), unlike other dual-lane
> attributes in this array.
>
> Can this missing equalization on lane 1 cause signal integrity issues and a
> high error rate on the second TX lane, potentially degrading performance or
> causing transmission failures unconditionally during the UniPro initialization
> sequence when the device operates in 2-lane mode?
ignore this comment, the configuration will also apply to lane 1
>
> > + /* RX garbage cnt = 32 SI */
> > + { UIC_ARG_MIB_SEL(0x00F2, UIC_ARG_MPHY_RX_GEN_SEL_INDEX(0)), 0x9F },
> > + { UIC_ARG_MIB_SEL(0x00F2, UIC_ARG_MPHY_RX_GEN_SEL_INDEX(1)), 0x9F },
> > + };
>
> [ ... ]
>
> > @@ -401,6 +401,9 @@ static int ufs_spacemit_apply_dev_quirks(struct ufs_hba *hba)
> > + int err;
> > +
> > + if (hba->dev_quirks & UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME)
> > + ufs_spacemit_quirk_host_pa_saveconfigtime(hba);
>
> [Severity: Medium]
> The return value of ufs_spacemit_quirk_host_pa_saveconfigtime() is neither
> assigned nor checked in ufs_spacemit_apply_dev_quirks(), ignoring potential
> DME access errors.
>
I will add a check and abort if it fails
> If the PA_SaveConfigTime quirk configuration fails, could the error be
> silently ignored, causing the device to operate with an invalid timing
> configuration and leading to link instability or failure when a device
> requiring UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME is initialized?
>
> > +
> > + if (hba->dev_info.wmanufacturerid == UFS_VENDOR_WDC)
> > + hba->dev_quirks |= UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE;
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260921-08-k3-ufs-support-v6-0-3479768a2299@kernel.org?part=2
--
Yixun Lan (dlan)
next prev parent reply other threads:[~2026-10-02 3:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 12:36 [PATCH v6 0/2] Add UFS Host driver support for SpacemiT K3 SoC Yixun Lan
2026-09-21 12:36 ` [PATCH v6 1/2] scsi: ufs: spacemit: dt-bindings: Add UFS controller for " Yixun Lan
2026-09-21 12:36 ` [PATCH v6 2/2] scsi: ufs: spacemit: k3: Add UFS Host Controller driver Yixun Lan
2026-09-21 12:46 ` sashiko-bot
2026-10-02 3:06 ` Yixun Lan [this message]
2026-09-22 9:25 ` Troy Mitchell
2026-10-02 2:59 ` Yixun Lan
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=20261002030612-GKC51329@kernel.org \
--to=dlan@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox