Re: [PATCH v3] scsi: ufshpb: Opt out pre-reqs from HPB2.0 flows

From: Bean Huo
Date: Sat Oct 30 2021 - 03:15:32 EST


On Sat, 2021-10-30 at 09:23 +0300, Avri Altman wrote:
> v1 -> v2:
>
> - forgot to remove ufshpb_set_write_buf_cmd
>
>
>
> v2 -> v3:
>
> - restore bMAX_ DATA_SIZE_FOR_HPB_SINGLE_CMD
>
> - remove read_id - it is now always 0
>
> - Ignore ufshpb_prep returned error - does not return -EAGAIN no
> more
>
>
>
> HPB allows its read commands to carry the physical addresses along
> with
>
> the LBAs, thus allowing less internal L2P-table switches in the
> device.
>
> HPB1.0 allowed a single LBA, while HPB2.0 increases this capacity up
> to
>
> 255 blocks.
>
>
>
> Carrying more than a single record, the read operation is no longer
>
> of type "read" per-se, but some sort of a "hybrid" command - writing
> the
>
> physical address to the device and reading the required payload.
>
>
>
> The HPB JEDEC spec came-up with a dual-command for that operation:
>
> HPB-WRITE-BUFFER (0x2) to write the physical addresses to device, and
>
> HPB-READ to read the payload.
>
>
>
> Alas, the current HPB driver design - a single-scsi-LLD-module, has
> no
>
> other alternative but to spawn the READ10 command into 2 commands:
>
> HPB-WRITE-BUFFER and HPB-READ.
>
> This causes a grat deal of aggrevation to the block layer guys, up to
> a
>
> point, in which that they were willing to revert the entire HPB
> driver,
>
> regardless of the huge amount of corporate effort already inversted
> in
>
> it.
>
>
>
> Therefore, remove the pre-req API for now, as a matter of urgency to
> get
>
> it done before the closing of the merge window.
>
>
>
> Signed-off-by: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx
> >
>
> Signed-off-by: Avri Altman <avri.altman@xxxxxxx>
>
> Tested-by: Avri Altman <avri.altman@xxxxxxx>
>
> Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>
>
> ---
>
> drivers/scsi/ufs/ufshcd.c | 7 +-
>
> drivers/scsi/ufs/ufshpb.c | 283 +-----------------------------------
> --
>
> drivers/scsi/ufs/ufshpb.h | 2 -
>
> 3 files changed, 4 insertions(+), 288 deletions(-)
>
>
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
>
> index f5ba8f953b87..470affdec426 100644
>
> --- a/drivers/scsi/ufs/ufshcd.c
>
> +++ b/drivers/scsi/ufs/ufshcd.c
>
> @@ -2767,12 +2767,7 @@ static int ufshcd_queuecommand(struct
> Scsi_Host *host, struct scsi_cmnd *cmd)
>
>
>
> lrbp->req_abort_skip = false;
>
>
>
> - err = ufshpb_prep(hba, lrbp);
>
> - if (err == -EAGAIN) {
>
> - lrbp->cmd = NULL;
>
> - ufshcd_release(hba);
>
> - goto out;
>
> - }
>
> + ufshpb_prep(hba, lrbp);


it is better to add one line comment to highlight that HPB preperation
failure will not impact original read request.

Reviewed-by: Bean Huo <beanhuo@xxxxxxxxxx>
Tested-by: Bean Huo <beanhuo@xxxxxxxxxx>


Bean