]> git.karo-electronics.de Git - karo-tx-linux.git/commit
scsi: ufs: fix failure to read the string descriptor
authorsubhashj@codeaurora.org <subhashj@codeaurora.org>
Thu, 24 Nov 2016 00:31:41 +0000 (16:31 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 29 Nov 2016 17:06:56 +0000 (12:06 -0500)
commitbde44bb665d049468b6a1a2fa7d666434de4f83f
tree9db028632329b36273e734839fbcdf2bd1a6ed4e
parent24d6243204633be4b710754f279b3ca57c69ceec
scsi: ufs: fix failure to read the string descriptor

While reading variable size descriptors (like string descriptor), some UFS
devices may report the "LENGTH" (field in "Transaction Specific fields" of
Query Response UPIU) same as what was requested in Query Request UPIU
instead of reporting the actual size of the variable size descriptor.
Although it's safe to ignore the "LENGTH" field for variable size
descriptors as we can always derive the length of the descriptor from
the descriptor header fields. Hence this change impose the length match
check only for fixed size descriptors (for which we always request the
correct size as part of Query Request UPIU).

Reviewed-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c