scsi: ufs: ufshpb: Properly handle max-single-cmd
authorAvri Altman <avri.altman@wdc.com>
Sun, 31 Oct 2021 12:36:54 +0000 (14:36 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 4 Nov 2021 01:51:56 +0000 (21:51 -0400)
commit9ec5128a8b5631d652ed06b37e0166f337802f90
tree66edc86896b3cd181005da293cc953fc3c9501db
parent6266f7df38e167a2386ee2747965c4816f32b449
scsi: ufs: ufshpb: Properly handle max-single-cmd

The spec recommends that for transfer length larger than the max-single-cmd
attribute (bMAX_DATA_SIZE_FOR_HPB_SINGLE_CMD) it is possible to couple
pre-requests with the HPB-READ command.  Being a recommendation, using
pre-requests can be perceived merely as a means of optimization.  A common
practice was to send pre-requests for chunks within some interval, and
leave the READ10 untouched if larger.

Now that the pre-request flows have been removed, all the commands are
single commands.  Properly handle this attribute and do not send HPB-READ
for transfer lengths larger than max-single-cmd.

[mkp: resolve conflict]

Fixes: 09d9e4d04187 ("scsi: ufs: ufshpb: Remove HPB2.0 flows")
Link: https://lore.kernel.org/r/20211031123654.17719-1-avri.altman@wdc.com
Reviewed-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshpb.c
drivers/scsi/ufs/ufshpb.h