Re: [PATCH v1 2/2] scsi: ufs: disable interrupt during clock-gating
From: Stanley Chu
Date: Tue Dec 17 2019 - 22:53:01 EST
Hi Asutosh,
On Tue, 2019-12-17 at 15:25 -0800, Asutosh Das (asd) wrote:
> >
>
> Hi,
> Does this save significant power? I see that gate/ungate of clocks
> happen far too frequently than suspend/resume.
>
> Have you considered how much latency this would add to the
> gating/ungating path?
>
> -asd
>
Yes, we have measured 200 times clk-gating/clk-ungating and latency data
is showed as below,
For clk-gating with interrupt disabling toggled,
Average latency of each clk-gating: 55.117 us
Average latency of irq-disabling during clk-gating: 4.2 us
For clk-ungating with interrupt enabling toggled,
Average latency of each clk-ungating: 118.324 us
Average latency of irq-enabling during clk-ungating: 2.9 us
The evaluation here is based on below Can's patch therefore the
interrupt control (enable_irq/disable_irq) latency is much shorter than
before (request_irq/free_irq).
scsi: ufs: Do not free irq in suspend
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/scsi/ufs/ufshcd.c?id=8709c1f68536e256668812788af5b2bb027f49c3
BTW, the main purpose of this patch is aimed to protect ufshcd register
from accessing while host clocks are disabled to fix potential system
hang issue. The possible scenario is mentioned in commit message of
patch "scsi: ufs: disable irq before disabling clocks" in the same
series.
Thanks
Stanley