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: <20240820060946.ktiysu7sn7qgbwx4@thinkpad>
Date: Tue, 20 Aug 2024 11:39:46 +0530
From: Manivannan Sadhasivam <manisadhasivam.linux@...il.com>
To: Mary Guillemard <mary@...y.zone>
Cc: linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
	Peter Wang <peter.wang@...iatek.com>,
	Stanley Jhu <chu.stanley@...il.com>,
	"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
	"Martin K. Petersen" <martin.petersen@...cle.com>,
	Matthias Brugger <matthias.bgg@...il.com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Subject: Re: [PATCH 1/1] scsi: ufs-mediatek: Add UFSHCD_QUIRK_BROKEN_LSDBS_CAP

On Mon, Aug 19, 2024 at 08:17:10PM +0200, Mary Guillemard wrote:
> On Mon, Aug 19, 2024 at 05:38:52PM +0530, Manivannan Sadhasivam wrote:
> > On Mon, Aug 19, 2024 at 12:24:42AM +0200, Mary Guillemard wrote:
> > > MT8183 supports UFSHCI 2.1 spec, but report a bogus value of 1 in the
> > > reserved part for the Legacy Single Doorbell Support (LSDBS) capability.
> > > 
> > 
> > Wow... I never thought that this quirk will be used outside of Qcom SoCs...
> >
> 
> Yeah I found that by trial and error some weeks ago and noticed your
> serie while looking to upstream this change, quite funny to see other
> vendors having the same quirk here.
>  
> > > This set UFSHCD_QUIRK_BROKEN_LSDBS_CAP when MCQ support is explicitly
> > > disabled, allowing the device to be properly registered.
> > > 
> > > Signed-off-by: Mary Guillemard <mary@...y.zone>
> > > ---
> > >  drivers/ufs/host/ufs-mediatek.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
> > > index 02c9064284e1..9a5919434c4e 100644
> > > --- a/drivers/ufs/host/ufs-mediatek.c
> > > +++ b/drivers/ufs/host/ufs-mediatek.c
> > > @@ -1026,6 +1026,9 @@ static int ufs_mtk_init(struct ufs_hba *hba)
> > >  	if (host->caps & UFS_MTK_CAP_DISABLE_AH8)
> > >  		hba->caps |= UFSHCD_CAP_HIBERN8_WITH_CLK_GATING;
> > >  
> > > +	if (host->caps & UFS_MTK_CAP_DISABLE_MCQ)
> > 
> > How can this be the deciding factor? You said above that the issue is with
> > MT8183 SoC. So why not just use the quirk only for that platform?
> > 
> > - Mani
> >
> 
> So my current assumption is that it also affect other Mediatek SoCs
> that are also based on UFS 2.1 spec but I cannot check this.
> 
> Instead, we know that if MCQ isn't supported, we must fallback to LSDB
> as there is no other ways to drive the device.
> 
> UFS_MTK_CAP_DISABLE_MCQ (mediatek,ufs-disable-mcq) being unused upstream,
> I think that's an acceptable fix.
> 

If you use this quirk, then you need to use the corresponding DT property. But
using the 'mediatek,ufs-disable-mcq' property for 2.1 controller doesn't make
sense as MCQ is for controllers >= 4.0.

> Another way to handle this would be to add a new dt property and add it
> to ufs_mtk_host_caps but I feel that my approach should be enough. 
> 

No need to add a DT property. Just use the SoC specific compatible as I did for
SM8550 SoC.

- Mani

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ