mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Ziqi Chen <quic_ziqichen@quicinc.com>,
	quic_cang@quicinc.com, bvanassche@acm.org, mani@kernel.org,
	beanhuo@micron.com, avri.altman@wdc.com,
	junwoo80.lee@samsung.com, martin.petersen@oracle.com,
	quic_nguyenb@quicinc.com, quic_nitirawa@quicinc.com,
	quic_rampraka@quicinc.com, neil.armstrong@linaro.org,
	luca.weiss@fairphone.com
Cc: linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] scsi: ufs: qcom: Check gear against max gear in vop freq_to_gear()
Date: Thu, 8 May 2025 17:30:40 +0200	[thread overview]
Message-ID: <b3c662ca-16bb-44df-ba68-faf55b1e3dfa@oss.qualcomm.com> (raw)
In-Reply-To: <20250507074415.2451940-2-quic_ziqichen@quicinc.com>

On 5/7/25 9:44 AM, Ziqi Chen wrote:
> The vop freq_to_gear() may return a gear greater than the negotiated max
> gear, return the negotiated max gear if the mapped gear is greater than it.
> 
> Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
> Signed-off-by: Ziqi Chen <quic_ziqichen@quicinc.com>
> 
> ---
> v1 - > v2:
> 1. Instead of return 'gear', return '0' directly if didn't find mapped
>    gear
> 2. Derectly return min_t(gear,max_gear) instead assign to 'gear' then
>    return it.
> ---
>  drivers/ufs/host/ufs-qcom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 790da25cbaf3..7f10926100a5 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -2105,10 +2105,10 @@ static u32 ufs_qcom_freq_to_gear_speed(struct ufs_hba *hba, unsigned long freq)
>  		break;
>  	default:
>  		dev_err(hba->dev, "%s: Unsupported clock freq : %lu\n", __func__, freq);
> -		break;
> +		return 0;

That's UFS_PWM_DONT_CHANGE, please it so that the reader can more easily
make sense of the code.. Actually, perhaps this function could be tagged
to return an entry of this enum specifically

Konrad

>  	}
>  
> -	return gear;
> +	return min_t(u32, gear, hba->max_pwr_info.info.gear_rx);
>  }
>  
>  /*

  parent reply	other threads:[~2025-05-08 15:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250507074415.2451940-1-quic_ziqichen@quicinc.com>
2025-05-07  7:44 ` Ziqi Chen
2025-05-08  9:05   ` Bean Huo
2025-05-08 15:30   ` Konrad Dybcio [this message]
2025-05-09  6:29     ` Ziqi Chen
2025-05-07  7:44 ` [PATCH v2 2/3] scsi: ufs: qcom: Map devfreq OPP freq to UniPro Core Clock freq Ziqi Chen
2025-05-07  8:19   ` Luca Weiss
2025-05-07  9:09     ` Ziqi Chen
2025-05-07  9:59       ` Luca Weiss
2025-05-08 10:39         ` Ziqi Chen
2025-05-07 11:59       ` neil.armstrong
2025-05-08 10:42         ` Ziqi Chen
2025-05-08  9:21   ` Bean Huo
2025-05-09  5:33     ` Ziqi Chen
2025-05-07  7:44 ` [PATCH v2 3/3] scsi: ufs: qcom: Call ufs_qcom_cfg_timers() in clock scaling path Ziqi Chen

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=b3c662ca-16bb-44df-ba68-faf55b1e3dfa@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=junwoo80.lee@samsung.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --cc=mani@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=martin.petersen@oracle.com \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_cang@quicinc.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=quic_nitirawa@quicinc.com \
    --cc=quic_rampraka@quicinc.com \
    --cc=quic_ziqichen@quicinc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®