[PATCH v4 1/1] scsi: ufs: core: add device level exception support

Bao D. Nguyen quic_nguyenb at quicinc.com
Tue Mar 25 15:15:47 PDT 2025


On 3/25/2025 9:33 AM, Arthur Simchaev wrote:
> Hi Bao
> 
> I think adding "struct utp_upiu_query_response_v4_0" is redundant and not correct for flags upiu response .
> You can use "struct utp_upiu_query_v4_0"
> 
Hi Arthur,
This is not a flags attribute. This is for a Query Read 64-bit Attribute 
data. In the existing code, we do not have a read 64-bit attribute, so 
adding this new code would also allow future re-use.

The new "struct utp_upiu_query_response_v4_0" would improve readability 
because it is formatted exactly as how the jedec standard defines for 
Attribute Read. We won't need to use type cast to get the 64-bit value.
There would be no issue with efficiency because the same machine code 
would be generated.

The existing "struct utp_upiu_query_v4_0" probably has a bug in it. It 
does not use the  __attribute__((__packed__)) attribute. The compiler is 
free to add padding in this structure, resulting in the read attribute 
value being incorrect. I plan to provide a separate patch to fix this issue.

Thanks, Bao



More information about the linux-arm-kernel mailing list