scsi: ufs: ufshpb: Add HPB 2.0 support
authorDaejun Park <daejun7.park@samsung.com>
Mon, 12 Jul 2021 09:00:25 +0000 (18:00 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 1 Aug 2021 20:05:07 +0000 (16:05 -0400)
commit41d8a9333cc96f5ad4dd7a52786585338257d9f1
tree595fc1295e8565f6220fcc7ee18bf8a400c028a5
parent2fff76f87542fae2366448ec8b01dbff415a7d22
scsi: ufs: ufshpb: Add HPB 2.0 support

Version 2.0 of HBP supports reads of varying sizes from 4KB to 1MB.

A read operation <= 32KB is supported as single HPB read. A read between
36KB and 1MB is supported by a combination of write buffer command and HPB
read command to deliver more PPN. The write buffer commands may not be
issued immediately due to busy tags. To use HPB read more aggressively, the
driver can requeue the write buffer command. The requeue threshold is
implemented as timeout and can be modified with requeue_timeout_ms entry in
sysfs.

[mkp: REQ_OP_DRV_* and blk_rq_is_passthrough()]

Link: https://lore.kernel.org/r/20210712090025epcms2p3b3d94f6f1b2cfa394e3d9ba130ca0fa7@epcms2p3
Tested-by: Can Guo <cang@codeaurora.org>
Tested-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Can Guo <cang@codeaurora.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Documentation/ABI/testing/sysfs-driver-ufs
drivers/scsi/ufs/ufs-sysfs.c
drivers/scsi/ufs/ufs.h
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h
drivers/scsi/ufs/ufshpb.c
drivers/scsi/ufs/ufshpb.h