lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ju2shpvxlc5tkazvclggdrqtfxa2r7yqdz7i5lc4hpjlfw7wvg@fp34s6mvncm3>
Date: Wed, 3 Apr 2024 09:12:02 -0500
From: Andrew Halaney <ahalaney@...hat.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Cc: Bjorn Andersson <andersson@...nel.org>, 
	Konrad Dybcio <konrad.dybcio@...aro.org>, "James E.J. Bottomley" <jejb@...ux.ibm.com>, 
	"Martin K. Petersen" <martin.petersen@...cle.com>, linux-arm-msm@...r.kernel.org, linux-scsi@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] scsi: ufs: qcom: Add sanity checks for gear/lane
 values during ICC scaling

On Wed, Apr 03, 2024 at 06:50:04PM +0530, Manivannan Sadhasivam wrote:
> Let's add the checks to warn the user if the ICC scaling is not supported
> for the gear/lane values and also fallback to the max value if that's the
> case.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>

Reviewed-by: Andrew Halaney <ahalaney@...hat.com>

> ---
>  drivers/ufs/host/ufs-qcom.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 696540ca835e..79b4ce05f7c5 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -696,6 +696,16 @@ static struct __ufs_qcom_bw_table ufs_qcom_get_bw_table(struct ufs_qcom_host *ho
>  	int gear = max_t(u32, p->gear_rx, p->gear_tx);
>  	int lane = max_t(u32, p->lane_rx, p->lane_tx);
>  
> +	if (WARN_ONCE(gear > QCOM_UFS_MAX_GEAR,
> +		      "ICC scaling for UFS Gear (%d) not supported. Using Gear (%d) bandwidth\n",
> +		      gear, QCOM_UFS_MAX_GEAR))
> +		gear = QCOM_UFS_MAX_GEAR;
> +
> +	if (WARN_ONCE(lane > QCOM_UFS_MAX_LANE,
> +		      "ICC scaling for UFS Lane (%d) not supported. Using Lane (%d) bandwidth\n",
> +		      lane, QCOM_UFS_MAX_LANE))
> +		lane = QCOM_UFS_MAX_LANE;
> +
>  	if (ufshcd_is_hs_mode(p)) {
>  		if (p->hs_rate == PA_HS_MODE_B)
>  			return ufs_qcom_bw_table[MODE_HS_RB][gear][lane];
> 
> -- 
> 2.25.1
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ