lkml.org 
[lkml]   [2021]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v35 3/4] scsi: ufs: Prepare HPB read for cached sub-region
From
Date
On 5/24/21 1:45 AM, Daejun Park wrote:
> +static void
> +ufshpb_set_hpb_read_to_upiu(struct ufshpb_lu *hpb, struct ufshcd_lrb *lrbp,
> + u32 lpn, u64 ppn, u8 transfer_len)
> +{
> + unsigned char *cdb = lrbp->cmd->cmnd;
> +
> + cdb[0] = UFSHPB_READ;
> +
> + /* ppn value is stored as big-endian in the host memory */

I think that that comment means that the type of the 'ppn' argument
should be changed from 'u64' into __be64.

> + memcpy(&cdb[6], &ppn, sizeof(__be64));
> + cdb[14] = transfer_len;
> +
> + lrbp->cmd->cmd_len = UFS_CDB_SIZE;
> +}
> +
> +/*
> + * This function will set up HPB read command using host-side L2P map data.
> + * In HPB v1.0, maximum size of HPB read command is 4KB.
> + */
> +void ufshpb_prep(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
> +{
[ ... ]
> +
> + ufshpb_set_hpb_read_to_upiu(hpb, lrbp, lpn, ppn, transfer_len);

'transfer_len' has type int and is truncated to type 'u8' when passed as
an argument to ufshpb_set_hpb_read_to_upiu(). Please handle transfer_len
values >= 256 properly.

Thanks,

Bart.

\
 
 \ /
  Last update: 2021-06-03 22:12    [W:0.072 / U:22.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site