Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ajay Neeli" <ajay.neeli@amd.com>
Cc: linux-scsi@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 1/2] scsi: ufs: core: Support "ref" clock name
Date: Wed, 25 Nov 2026 09:32:01 +0000	[thread overview]
Message-ID: <sashiko-outbox-233012@kernel.org> (raw)
In-Reply-To: <20261125092351.2807658-2-ajay.neeli@amd.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] scsi: ufs: missing ref clock name check in ufshcd_init_clocks()
- [Medium] scsi: ufs: missing ref clock name check in
  ufshcd_parse_operating_points()
--

commit 4196a48351e8b590f1bfcc4bbd914e822554236d
Author: Ajay Neeli <ajay.neeli@amd.com>

scsi: ufs: core: Support "ref" clock name

This commit updates ufshcd_parse_clock_info() to also match the "ref"
clock name when setting keep_link_active on the reference clock.

> diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
> index 169dbc1a75fe5..947edcd886680 100644
> --- a/drivers/ufs/host/ufshcd-pltfrm.c
> +++ b/drivers/ufs/host/ufshcd-pltfrm.c
> @@ -96,7 +96,7 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba)
>  			goto out;
>  		}
>  
> -		if (!strcmp(name, "ref_clk"))
> +		if (!strcmp(name, "ref") || !strcmp(name, "ref_clk"))
>  			clki->keep_link_active = true;
>  		dev_dbg(dev, "%s: min %u max %u name %s\n", "freq-table-hz",
>  				clki->min_freq, clki->max_freq, clki->name);

[Severity: High]
Should ufshcd_init_clocks() also check for "ref" when detecting the
device reference clock frequency?

drivers/ufs/core/ufshcd.c:ufshcd_init_clocks() {
    ...
		if (!strcmp(clki->name, "ref_clk"))
			ufshcd_parse_dev_ref_clk_freq(hba, clki->clk);
    ...
}

When the clock is named "ref", ufshcd_parse_dev_ref_clk_freq() is skipped
and hba->dev_ref_clk_freq remains REF_CLK_FREQ_INVAL unless a separate
ref-clk-freq property is present, so ufshcd_set_dev_ref_clk() will not
program the UFS device bRefClkFreq attribute before switching to
High-Speed mode.

[Severity: Medium]
Does ufshcd_parse_operating_points() in this file need the same "ref"
check?

drivers/ufs/host/ufshcd-pltfrm.c:ufshcd_parse_operating_points() {
    ...
		if (!strcmp(clk_names[i], "ref_clk"))
			clki->keep_link_active = true;
    ...
}

On platforms that use operating-points-v2 instead of freq-table-hz,
ufshcd_parse_clock_info() exits early and ufshcd_parse_operating_points()
populates hba->clk_list_head, leaving keep_link_active false for a "ref"
clock and allowing __ufshcd_setup_clocks() to disable the reference clock
while the link is active.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125092351.2807658-1-ajay.neeli@amd.com?part=1

  reply	other threads:[~2026-11-25  9:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  9:23 [PATCH v2 0/2] UFS: Add reference clock support for AMD Versal2 Ajay Neeli
2026-11-25  9:23 ` [PATCH v2 1/2] scsi: ufs: core: Support "ref" clock name Ajay Neeli
2026-11-25  9:32   ` sashiko-bot [this message]
2026-11-25  9:23 ` [PATCH v2 2/2] dt-bindings: ufs: amd,versal2-ufs: Add reference clock Ajay Neeli
2026-11-25  9:35   ` sashiko-bot

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-233012@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ajay.neeli@amd.com \
    --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