Re: [PATCH] scsi: ufs: Fix registers dump vops caused scheduling while atomic

From: Bart Van Assche
Date: Wed Feb 05 2020 - 01:21:22 EST


On 2020-02-04 22:06, Can Guo wrote:
> @@ -5617,7 +5622,7 @@ static irqreturn_t ufshcd_check_errors(struct
>
> __func__, hba->saved_err,
> hba->saved_uic_err);
>
> - ufshcd_print_host_regs(hba);
> + __ufshcd_print_host_regs(hba, true);
> ufshcd_print_pwr_info(hba);
> ufshcd_print_tmrs(hba,
> hba->outstanding_tasks);
> ufshcd_print_trs(hba,
> hba->outstanding_reqs,

Hi Can,

Please fix this by splitting ufs_qcom_dump_dbg_regs() into two
functions: one function that doesn't sleep and a second function that
behaves identically to the current function. If the function names will
make it clear which function sleeps and which function doesn't that will
result in code that is much easier to read than the above code. For the
above code it is namely impossible to figure out what will happen
without looking up the caller.

Thanks,

Bart.