scsi: ufs: ufshpb: Prepare HPB read for cached sub-region
authorDaejun Park <daejun7.park@samsung.com>
Mon, 12 Jul 2021 08:59:36 +0000 (17:59 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 1 Aug 2021 20:04:55 +0000 (16:04 -0400)
commit2fff76f87542fae2366448ec8b01dbff415a7d22
treeec7bb8732ee4e70d87717586366ac33fe91cea3d
parent4b5f49079c52a7eadd2defbd8d2a270664a881d4
scsi: ufs: ufshpb: Prepare HPB read for cached sub-region

If the logical address of a read I/O belongs to an active sub-region, the
HPB driver modifies the read I/O command to an HPB read. The driver
modifies the UFS UPIU instead of modifying the existing SCSI command.

In HPB version 1.0, the maximum read I/O size that can be converted to HPB
read is 4KB.

The dirty map of the active sub-region prevents an incorrect HPB read that
has stale physical page number which is updated by previous write I/O.

[mkp: REQ_OP_DRV_* and blk_rq_is_passthrough()]

Link: https://lore.kernel.org/r/20210712085936epcms2p4b0ec5c8cecdeea6cc043d684363842b6@epcms2p4
Tested-by: Bean Huo <beanhuo@micron.com>
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: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Acked-by: Avri Altman <Avri.Altman@wdc.com>
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshpb.c
drivers/scsi/ufs/ufshpb.h