RE: Re: [PATCH v35 3/4] scsi: ufs: Prepare HPB read for cached sub-region

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> +/*
>>>> + * 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.
>> 
>> Before entering the function, ufshpb_is_supported_chunk() checks whether
>> transfer_len <= hpb->pre_req_max_tr_len which is set to
>> HPB_MULTI_CHUNK_HIGH (128) on initalization.
> 
>How about adding a WARN_ON_ONCE() in ufshpb_prep() that verifies that
>transfer_len is <= HPB_MULTI_CHUNK_HIGH?

Sure, I will add WARN_ON_ONCE() just after calling ufshpb_is_supported_chunk().

Thanks

> 
>Thanks,
> 
>Bart.
> 
> 
>  



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux