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: <l6xao2ubcvv3ho56dv6qfr3b62ve3olfbhvywg2is2xdhod27r@2nyjfwinrxzm>
Date: Tue, 8 Apr 2025 12:53:37 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: MANISH PANDEY <quic_mapa@...cinc.com>
Cc: "James E.J. Bottomley" <James.Bottomley@...senpartnership.com>, 
	"Martin K. Petersen" <martin.petersen@...cle.com>, Alim Akhtar <alim.akhtar@...sung.com>, 
	Avri Altman <avri.altman@....com>, Bart Van Assche <bvanassche@....org>, linux-scsi@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org, quic_nitirawa@...cinc.com, 
	quic_bhaskarv@...cinc.com, quic_rampraka@...cinc.com, quic_cang@...cinc.com, 
	quic_nguyenb@...cinc.com
Subject: Re: [PATCH V2 2/2] scsi: ufs: introduce quirk to extend
 PA_HIBERN8TIME for UFS devices

On Tue, Apr 08, 2025 at 11:07:58AM +0530, MANISH PANDEY wrote:
> 
> 
> On 4/7/2025 12:05 AM, Manivannan Sadhasivam wrote:
> > On Fri, Apr 04, 2025 at 11:15:39PM +0530, Manish Pandey wrote:
> > > Some UFS devices need additional time in hibern8 mode before exiting,
> > > beyond the negotiated handshaking phase between the host and device.
> > > Introduce a quirk to increase the PA_HIBERN8TIME parameter by 100 µs
> > > to ensure proper hibernation process.
> > > 
> > 
> > This commit message didn't mention the UFS device for which this quirk is being
> > applied.
> > 
> Since it's a quirk and may be applicable to other vendors also in future, so
> i thought to keep it general.
> 

You cannot make commit message generic. It should precisely describe the change.

> Will update in next patch set if required.
>  >> Signed-off-by: Manish Pandey <quic_mapa@...cinc.com>
> > > ---
> > >   drivers/ufs/core/ufshcd.c | 31 +++++++++++++++++++++++++++++++
> > >   include/ufs/ufs_quirks.h  |  6 ++++++
> > >   2 files changed, 37 insertions(+)
> > > 
> > > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> > > index 464f13da259a..2b8203fe7b8c 100644
> > > --- a/drivers/ufs/core/ufshcd.c
> > > +++ b/drivers/ufs/core/ufshcd.c
> > > @@ -278,6 +278,7 @@ static const struct ufs_dev_quirk ufs_fixups[] = {
> > >   	  .model = UFS_ANY_MODEL,
> > >   	  .quirk = UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM |
> > >   		   UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE |
> > > +		   UFS_DEVICE_QUIRK_PA_HIBER8TIME |
> > >   		   UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS },
> > >   	{ .wmanufacturerid = UFS_VENDOR_SKHYNIX,
> > >   	  .model = UFS_ANY_MODEL,
> > > @@ -8384,6 +8385,33 @@ static int ufshcd_quirk_tune_host_pa_tactivate(struct ufs_hba *hba)
> > >   	return ret;
> > >   }
> > > +/**
> > > + * ufshcd_quirk_override_pa_h8time - Ensures proper adjustment of PA_HIBERN8TIME.
> > > + * @hba: per-adapter instance
> > > + *
> > > + * Some UFS devices require specific adjustments to the PA_HIBERN8TIME parameter
> > > + * to ensure proper hibernation timing. This function retrieves the current
> > > + * PA_HIBERN8TIME value and increments it by 100us.
> > > + */
> > > +static void ufshcd_quirk_override_pa_h8time(struct ufs_hba *hba)
> > > +{
> > > +	u32 pa_h8time = 0;
> > 
> > Why do you need to initialize it?
> > 
> Agree.. Not needed, will update.>> +	int ret;
> > > +
> > > +	ret = ufshcd_dme_get(hba, UIC_ARG_MIB(PA_HIBERN8TIME),
> > > +			&pa_h8time);
> > > +	if (ret) {
> > > +		dev_err(hba->dev, "Failed to get PA_HIBERN8TIME: %d\n", ret);
> > > +		return;
> > > +	}
> > > +
> > > +	/* Increment by 1 to increase hibernation time by 100 µs */
> > 
> >  From where the value of 100us adjustment is coming from?
> > 
> > - Mani
> > 
> These values are derived from experiments on Qualcomm SoCs.
> However this is also matching with ufs-exynos.c
> 

Okay. In that case, you should mention that the 100us value is derived from
experiments on Qcom and Samsung SoCs. Otherwise, it gives an assumption that
this value is universal.

- Mani

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ