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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <DM6PR04MB657594C85E06F458EEEDB7C0FC6D2@DM6PR04MB6575.namprd04.prod.outlook.com>
Date: Sat, 21 Sep 2024 06:30:31 +0000
From: Avri Altman <Avri.Altman@....com>
To: Bart Van Assche <bvanassche@....org>, "Martin K . Petersen"
	<martin.petersen@...cle.com>
CC: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"stable@...r.kernel.org" <stable@...r.kernel.org>, Alim Akhtar
	<alim.akhtar@...sung.com>, Daejun Park <daejun7.park@...sung.com>
Subject: RE: [PATCH v2] scsi: ufs: Use pre-calculated offsets in
 ufshcd_init_lrb

+Daejun

Thanks,
Avri 
> On 9/9/24 9:45 PM, Avri Altman wrote:
> > Replace manual offset calculations for response_upiu and prd_table in
> > ufshcd_init_lrb() with pre-calculated offsets already stored in the
> > utp_transfer_req_desc structure. The pre-calculated offsets are set
> > differently in ufshcd_host_memory_configure() based on the
> > UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk, ensuring correct alignment and
> > access.
> >
> > Fixes: 26f968d7de82 ("scsi: ufs: Introduce
> UFSHCD_QUIRK_PRDT_BYTE_GRAN
> > quirk")
> > Cc: stable@...r.kernel.org
> > Signed-off-by: Avri Altman <avri.altman@....com>
> >
> > ---
> > Changes in v2:
> >   - add Fixes: and Cc: stable tags
> >   - fix kernel test robot warning about type mismatch by using
> > le16_to_cpu
> > ---
> >   drivers/ufs/core/ufshcd.c | 5 ++---
> >   1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> > index 8ea5a82503a9..85251c176ef7 100644
> > --- a/drivers/ufs/core/ufshcd.c
> > +++ b/drivers/ufs/core/ufshcd.c
> > @@ -2919,9 +2919,8 @@ static void ufshcd_init_lrb(struct ufs_hba *hba,
> struct ufshcd_lrb *lrb, int i)
> >       struct utp_transfer_req_desc *utrdlp = hba->utrdl_base_addr;
> >       dma_addr_t cmd_desc_element_addr = hba->ucdl_dma_addr +
> >               i * ufshcd_get_ucd_size(hba);
> > -     u16 response_offset = offsetof(struct utp_transfer_cmd_desc,
> > -                                    response_upiu);
> > -     u16 prdt_offset = offsetof(struct utp_transfer_cmd_desc, prd_table);
> > +     u16 response_offset = le16_to_cpu(utrdlp[i].response_upiu_offset);
> > +     u16 prdt_offset = le16_to_cpu(utrdlp[i].prd_table_offset);
> >
> >       lrb->utr_descriptor_ptr = utrdlp + i;
> >       lrb->utrd_dma_addr = hba->utrdl_dma_addr +
> 
> Please always Cc the author of the original patch when posting a candidate fix.
> 
> Alim, since the upstream kernel code seems to work fine with Exynos UFS host
> controllers, is the description of UFSHCD_QUIRK_PRDT_BYTE_GRAN perhaps
> wrong? I'm referring to the following description:
> 
>         /*
>          * This quirk needs to be enabled if the host controller regards
>          * resolution of the values of PRDTO and PRDTL in UTRD as byte.
>          */
>         UFSHCD_QUIRK_PRDT_BYTE_GRAN                     = 1 << 9,
> 
> Thanks,
> 
> Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ