Re: [PATCH v3 7/8] scsi: ufs: core: Toggle Write Booster during clock scaling base on gear speed

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

 





On 2/6/2025 2:09 AM, Bart Van Assche wrote:
On 2/3/25 12:11 AM, Ziqi Chen wrote:
-    /* Enable Write Booster if we have scaled up else disable it */
-    if (ufshcd_enable_wb_if_scaling_up(hba) && !err)
-        ufshcd_wb_toggle(hba, scale_up);
+    /* Enable Write Booster if current gear requires it else disable it */
+    if (ufshcd_enable_wb_if_scaling_up(hba) && !err) {
+        bool wb_en = false;
+
+        wb_en = hba->pwr_info.gear_rx >= hba->clk_scaling.wb_gear ? true : false;
+        ufshcd_wb_toggle(hba, wb_en);
+    }

Both the " = false" initialization and the "? true : false" part are
unnecessary. Please remove the "wb_en" variable entirely, e.g. as follows:

     if (ufshcd_enable_wb_if_scaling_up(hba) && !err)
         ufshcd_wb_toggle(hba, hba->pwr_info.gear_rx >=
                  hba->clk_scaling.wb_gear);

Otherwise this patch looks good to me.

Thanks,

Bart.

Sure , Bart. Your suggestion looks nice. let me apply it in next version, thank you~

-Ziqi





[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