On Sat, 2021-02-06 at 15:23 +0800, Can Guo wrote:
> > +     dev_dbg(&hpb->sdev_ufs_lu->sdev_dev, "Noti: #ACT %u #INACT
> > %u\n",
> > +             rsp_field->active_rgn_cnt, rsp_field-
> > >inactive_rgn_cnt);
> > +
> > +     queue_work(ufshpb_wq, &hpb->map_work);
> > +}
> > +
> > +/*
> > + * This function will parse recommended active subregion
> > information 
> > in sense
> > + * data field of response UPIU with SAM_STAT_GOOD state.
> > + */
> > +void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
> > +{
> > +     struct ufshpb_lu *hpb = ufshpb_get_hpb_data(lrbp->cmd-
> > >device);
> > +     struct utp_hpb_rsp *rsp_field;
> > +     int data_seg_len;
> > +
> > +     if (!hpb)
> > +             return;
> 
> You are assuming HPB recommandations only come in responses to LUs
> with HPB enabled, but the specs says the recommandations can come
> in any responses with GOOD status, meaning you should check the *hpb
> which belongs to the LUN in res_field, but not the one belongs to
> lrbp->cmd->device.
> 

correct, see here HPB driver patch :).


https://patchwork.kernel.org/project/linux-scsi/patch/20200504142032.16619-6-bean...@micron.com/

+
+#if defined(CONFIG_SCSI_UFSHPB)
+                       /*
+                        * HPB recommendations are provided in RESPONSE
UPIU
+                        * packets of successfully completed commands,
which
+                        * are commands terminated with GOOD status.
+                        */
+                       if (scsi_status == SAM_STAT_GOOD)
+                               ufshpb_rsp_handler(hba, lrbp);
+#endif
                        break;
                case UPIU_TRANSACTION_REJECT_UPIU:
                        /* TODO: handle Reject UPIU Response */

we need re-test this series patch seriously.


Thanks Can.


Bean


> Regards,
> 
> Can Guo

Reply via email to