Message ID | 20240304092346.654-1-avri.altman@wdc.com |
---|---|
Headers | show |
Series | Re-use device management code fragments | expand |
On 3/4/24 01:23, Avri Altman wrote: > /** > * ufshcd_exec_dev_cmd - API for sending device management requests > * @hba: UFS hba > @@ -3291,11 +3305,6 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, > struct ufshcd_lrb *lrbp; > int err; > > - /* Protects use of hba->reserved_slot. */ > - lockdep_assert_held(&hba->dev_cmd.lock); > - > - down_read(&hba->clk_scaling_lock); > - > lrbp = &hba->lrb[tag]; > lrbp->cmd = NULL; > err = ufshcd_compose_dev_cmd(hba, lrbp, cmd_type, tag); Please restore the lockdep_assert_held() call. > - /* Protects use of hba->reserved_slot. */ > - lockdep_assert_held(&hba->dev_cmd.lock); > - > - down_read(&hba->clk_scaling_lock); > - > lrbp = &hba->lrb[tag]; > lrbp->cmd = NULL; > lrbp->task_tag = tag; Same comment here - please restore the lockdep_assert_held() call. Otherwise this patch looks good to me. Thanks, Bart.
On 3/4/24 01:23, Avri Altman wrote: > -static int ufshcd_compose_dev_cmd(struct ufs_hba *hba, > - struct ufshcd_lrb *lrbp, enum dev_cmd_type cmd_type, int tag) > +static void __compose_dev_cmd(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, > + enum dev_cmd_type cmd_type, u8 lun, int tag) > { > lrbp->cmd = NULL; > lrbp->task_tag = tag; > - lrbp->lun = 0; /* device management cmd is not specific to any LUN */ > + lrbp->lun = lun; > lrbp->intr_cmd = true; /* No interrupt aggregation */ > ufshcd_prepare_lrbp_crypto(NULL, lrbp); > hba->dev_cmd.type = cmd_type; > +} Please chose a better function name than __compose_dev_cmd() and please make sure that the function name starts with the ufshcd_ prefix. Thanks, Bart.