> > - down_read(&hba->clk_scaling_lock); > > + if (ufshcd_is_clkscaling_supported(hba)) > > + down_read(&hba->clk_scaling_lock); > > > > lrbp = &hba->lrb[tag]; > > WARN_ON(lrbp->cmd); > > I don't like this patch at all. This patch makes testing the UFS driver > more complicated without having any clear benefit. Additionally, adding > if-statements in front of locking makes static source code analysis harder > and is an anti-pattern. Please don't do this. > > Bart. The benefit that I think is not blocking dev cmd during submitting a scsi cmd. Rather, I don't understand why this lock is required if a SoC doesn't support clk scaling. The period of ringing doorbells has been already protected by spin lock. Thanks. Kiwoong Kim