RE: [PATCH 5/7] scsi: ufs: core: Simplify ufshcd_err_handling_prepare()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Use blk_mq_quiesce_tagset() instead of ufshcd_scsi_block_requests() and
> blk_mq_wait_quiesce_done().
Maybe also add a sentence indicating that this was the last caller of scsi_block_requests hence it can be removed.

> 
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
Reviewed-by: Avri Altman <avri.altman@xxxxxxx>

> ---
>  drivers/ufs/core/ufshcd.c | 19 +++----------------
>  include/ufs/ufshcd.h      |  2 --
>  2 files changed, 3 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index
> ff1b0af74041..75e00e5b3f79 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -349,18 +349,6 @@ static void ufshcd_configure_wb(struct ufs_hba
> *hba)
>                 ufshcd_wb_toggle_buf_flush(hba, true);  }
> 
> -static void ufshcd_scsi_unblock_requests(struct ufs_hba *hba) -{
> -       if (atomic_dec_and_test(&hba->scsi_block_reqs_cnt))
> -               scsi_unblock_requests(hba->host);
> -}
> -
> -static void ufshcd_scsi_block_requests(struct ufs_hba *hba) -{
> -       if (atomic_inc_return(&hba->scsi_block_reqs_cnt) == 1)
> -               scsi_block_requests(hba->host);
> -}
> -
>  static void ufshcd_add_cmd_upiu_trace(struct ufs_hba *hba, unsigned int
> tag,
>                                       enum ufs_trace_str_t str_t)  { @@ -6379,15 +6367,14
> @@ static void ufshcd_err_handling_prepare(struct ufs_hba *hba)
>                         ufshcd_suspend_clkscaling(hba);
>                 ufshcd_clk_scaling_allow(hba, false);
>         }
> -       ufshcd_scsi_block_requests(hba);
>         /* Wait for ongoing ufshcd_queuecommand() calls to finish. */
> -       blk_mq_wait_quiesce_done(&hba->host->tag_set);
> +       blk_mq_quiesce_tagset(&hba->host->tag_set);
>         cancel_work_sync(&hba->eeh_work);  }
> 
>  static void ufshcd_err_handling_unprepare(struct ufs_hba *hba)  {
> -       ufshcd_scsi_unblock_requests(hba);
> +       blk_mq_unquiesce_tagset(&hba->host->tag_set);
>         ufshcd_release(hba);
>         if (ufshcd_is_clkscaling_supported(hba))
>                 ufshcd_clk_scaling_suspend(hba, false); @@ -10560,7 +10547,7
> @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base,
> unsigned int irq)
> 
>         /* Hold auto suspend until async scan completes */
>         pm_runtime_get_sync(dev);
> -       atomic_set(&hba->scsi_block_reqs_cnt, 0);
> +
>         /*
>          * We are assuming that device wasn't put in sleep/power-down
>          * state exclusively during the boot stage before kernel.
> diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index
> a0b325a32aca..36bd91ff3593 100644
> --- a/include/ufs/ufshcd.h
> +++ b/include/ufs/ufshcd.h
> @@ -928,7 +928,6 @@ enum ufshcd_mcq_opr {
>   * @wb_mutex: used to serialize devfreq and sysfs write booster toggling
>   * @clk_scaling_lock: used to serialize device commands and clock scaling
>   * @desc_size: descriptor sizes reported by device
> - * @scsi_block_reqs_cnt: reference counting for scsi block requests
>   * @bsg_dev: struct device associated with the BSG queue
>   * @bsg_queue: BSG queue associated with the UFS controller
>   * @rpm_dev_flush_recheck_work: used to suspend from RPM (runtime
> power @@ -1089,7 +1088,6 @@ struct ufs_hba {
> 
>         struct mutex wb_mutex;
>         struct rw_semaphore clk_scaling_lock;
> -       atomic_t scsi_block_reqs_cnt;
> 
>         struct device           bsg_dev;
>         struct request_queue    *bsg_queue;





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux