[1/2] clk: qcom: reset: Increase max reset delay

Message ID 20230726-topic-qcom_reset-v1-1-92de6d3e4c7c@linaro.org
State New
Headers
Series Fix up qcom reset controller |

Commit Message

Konrad Dybcio July 26, 2023, 1:26 p.m. UTC
  u8 limits us to 255 microseconds of delay. Promote the delay variable to
u16 to hold bigger values.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/clk/qcom/reset.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Stephan Gerhold July 26, 2023, 6:21 p.m. UTC | #1
On Wed, Jul 26, 2023 at 03:26:19PM +0200, Konrad Dybcio wrote:
> u8 limits us to 255 microseconds of delay. Promote the delay variable to
> u16 to hold bigger values.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

It would be clearer to change this together with an actual user that
needs > 255us. AFAICT atm MSM8909 is the only user of this and it has
just 15us.

Thanks,
Stephan

> ---
>  drivers/clk/qcom/reset.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/qcom/reset.h b/drivers/clk/qcom/reset.h
> index 9a47c838d9b1..fe0561bf53d4 100644
> --- a/drivers/clk/qcom/reset.h
> +++ b/drivers/clk/qcom/reset.h
> @@ -11,7 +11,7 @@
>  struct qcom_reset_map {
>  	unsigned int reg;
>  	u8 bit;
> -	u8 udelay;
> +	u16 udelay;
>  	u32 bitmask;
>  };
>  
> 
> -- 
> 2.41.0
>
  
Konrad Dybcio July 26, 2023, 6:24 p.m. UTC | #2
On 26.07.2023 20:21, Stephan Gerhold wrote:
> On Wed, Jul 26, 2023 at 03:26:19PM +0200, Konrad Dybcio wrote:
>> u8 limits us to 255 microseconds of delay. Promote the delay variable to
>> u16 to hold bigger values.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> 
> It would be clearer to change this together with an actual user that
> needs > 255us. AFAICT atm MSM8909 is the only user of this and it has
> just 15us.
Some LPASS resets ask for 500, but I'm still working on that driver.

Konrad
  
Stephan Gerhold July 26, 2023, 6:35 p.m. UTC | #3
On Wed, Jul 26, 2023 at 08:24:33PM +0200, Konrad Dybcio wrote:
> On 26.07.2023 20:21, Stephan Gerhold wrote:
> > On Wed, Jul 26, 2023 at 03:26:19PM +0200, Konrad Dybcio wrote:
> >> u8 limits us to 255 microseconds of delay. Promote the delay variable to
> >> u16 to hold bigger values.
> >>
> >> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> > 
> > It would be clearer to change this together with an actual user that
> > needs > 255us. AFAICT atm MSM8909 is the only user of this and it has
> > just 15us.
> Some LPASS resets ask for 500, but I'm still working on that driver.
> 

Maybe send it together with that driver then? This feels close to the
typical "no API changes without also adding the user" rule.

Thanks,
Stephan
  

Patch

diff --git a/drivers/clk/qcom/reset.h b/drivers/clk/qcom/reset.h
index 9a47c838d9b1..fe0561bf53d4 100644
--- a/drivers/clk/qcom/reset.h
+++ b/drivers/clk/qcom/reset.h
@@ -11,7 +11,7 @@ 
 struct qcom_reset_map {
 	unsigned int reg;
 	u8 bit;
-	u8 udelay;
+	u16 udelay;
 	u32 bitmask;
 };