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

From: Bart Van Assche
Date: Wed Feb 05 2020 - 17:45:28 EST


On 2/4/20 10:31 PM, Can Guo wrote:
Do you mean by splitting ufshcd_print_host_regs() into two functions?
One behaves identically same to the current function, another one called
ufshcd_print_host_regs_nosleep(). No?

Hi Can,

Not really. I had something else in mind.

Having taken a closer look at ufs_qcom_dump_dbg_regs() I started wondering why there are sleep statements in that function. Is the goal of these sleep statements perhaps to reduce how often printk() is called? Has it been considered to remove all sleep calls from ufs_qcom_dump_dbg_regs() and instead add something like the following at the start of that function:

static DEFINE_RATELIMIT_STATE(_rs,
DEFAULT_RATELIMIT_INTERVAL,
DEFAULT_RATELIMIT_BURST);

if (!__ratelimit(&_rs))
return;


Thanks,

Bart.