[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <000101d61be3$362e79f0$a28b6dd0$@samsung.com>
Date: Sun, 26 Apr 2020 21:26:08 +0530
From: "Alim Akhtar" <alim.akhtar@...sung.com>
To: "'Christoph Hellwig'" <hch@...radead.org>
Cc: <robh@...nel.org>, <devicetree@...r.kernel.org>,
<linux-scsi@...r.kernel.org>, <krzk@...nel.org>,
<avri.altman@....com>, <martin.petersen@...cle.com>,
<kwmad.kim@...sung.com>, <stanley.chu@...iatek.com>,
<cang@...eaurora.org>, <linux-samsung-soc@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v6 04/10] scsi: ufs: introduce
UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk
Hi Christoph,
> -----Original Message-----
> From: Christoph Hellwig <hch@...radead.org>
> Sent: 22 April 2020 12:24
> To: Alim Akhtar <alim.akhtar@...sung.com>
> Cc: robh@...nel.org; devicetree@...r.kernel.org;
linux-scsi@...r.kernel.org;
> krzk@...nel.org; avri.altman@....com; martin.petersen@...cle.com;
> kwmad.kim@...sung.com; stanley.chu@...iatek.com;
> cang@...eaurora.org; linux-samsung-soc@...r.kernel.org; linux-arm-
> kernel@...ts.infradead.org; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH v6 04/10] scsi: ufs: introduce
> UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk
>
> On Fri, Apr 17, 2020 at 11:29:38PM +0530, Alim Akhtar wrote:
> > Some UFS host controllers may think granularities of PRDT length and
> > offset as bytes, not double words.
> >
> > Signed-off-by: Kiwoong Kim <kwmad.kim@...sung.com>
> > Signed-off-by: Alim Akhtar <alim.akhtar@...sung.com>
> > ---
> > drivers/scsi/ufs/ufshcd.c | 30 +++++++++++++++++++++++-------
> > drivers/scsi/ufs/ufshcd.h | 6 ++++++
> > 2 files changed, 29 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> > index ee30ed6cc805..b32fcedcdcb9 100644
> > --- a/drivers/scsi/ufs/ufshcd.c
> > +++ b/drivers/scsi/ufs/ufshcd.c
> > @@ -2151,8 +2151,14 @@ static int ufshcd_map_sg(struct ufs_hba *hba,
> struct ufshcd_lrb *lrbp)
> > return sg_segments;
> >
> > if (sg_segments) {
> > - lrbp->utr_descriptor_ptr->prd_table_length =
> > - cpu_to_le16((u16)sg_segments);
> > +
> > + if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN)
> > + lrbp->utr_descriptor_ptr->prd_table_length =
> > + cpu_to_le16((u16)(sg_segments *
> > + sizeof(struct ufshcd_sg_entry)));
> > + else
> > + lrbp->utr_descriptor_ptr->prd_table_length =
> > + cpu_to_le16((u16) (sg_segments));
>
> No double words here. "Normal" UFS uses the actual segment count, while
> Samsumg uses bytes. Also no need fo the u16 count in either the old or
new
> version.
Ok, will update the commit message and take your suggestion in the next
version.
Powered by blists - more mailing lists