# \[PATCH v11 10/12\] backlight: pwm\_bl: Use 64-bit division function

- Subsystems: FRAMEBUFFER LAYER, BACKLIGHT CLASS/SUBSYSTEM, THE REST
- Maintainers: Helge Deller, Lee Jones, Daniel Thompson, Jingoo Han, Linus Torvalds
- Status: SUPERSEDED · 1 review, 1 by a maintainer (Superseded by v16 posted 2020-06-02 M Daniel Thompson)
- Superseded by v16 (posted 2020-06-02).
- Revision v11 (9 revisions archived); 1 review trailer.
- List: linux-fbdev
- 8 messages, 4 authors
- Page: https://ratatoskr.run/linux-fbdev/2020/03/5901456/t

## \[PATCH v11 10/12\] backlight: pwm\_bl: Use 64-bit division function

- From: Guru Das Srinagesh \<hidden\>
- Date: 2020-03-20 01:41:43 
- Message: https://ratatoskr.run/linux-fbdev/2020/03/5901456.md

```text
Since the PWM framework is switching struct pwm_state.period's datatype
to u64, prepare for this transition by using div_u64 to handle a 64-bit
dividend instead of a straight division operation.

Cc: Lee Jones <redacted>
Cc: Daniel Thompson <redacted>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Bartlomiej Zolnierkiewicz <redacted>
Cc: <redacted>
Cc: <redacted>
Cc: <redacted>

Signed-off-by: Guru Das Srinagesh <redacted>
Reviewed-by: Daniel Thompson <redacted>
---
 drivers/video/backlight/pwm_bl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index efb4efc..3e5dbcf 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -625,7 +625,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 		pb->scale = data->max_brightness;
 	}
 
-	pb->lth_brightness = data->lth_brightness * (state.period / pb->scale);
+	pb->lth_brightness = data->lth_brightness * (div_u64(state.period,
+				pb->scale));
 
 	props.type = BACKLIGHT_RAW;
 	props.max_brightness = data->max_brightness;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
```

## Re: \[PATCH v11 10/12\] backlight: pwm\_bl: Use 64-bit division function

- From: Lee Jones \<hidden\>
- Date: 2020-03-20 13:30:43 
- Message: https://ratatoskr.run/linux-fbdev/2020/03/5901971.md

```text
On Thu, 19 Mar 2020, Guru Das Srinagesh wrote:

> Since the PWM framework is switching struct pwm_state.period's datatype
> to u64, prepare for this transition by using div_u64 to handle a 64-bit
> dividend instead of a straight division operation.
> 
> Cc: Lee Jones <redacted>
> Cc: Daniel Thompson <redacted>
> Cc: Jingoo Han <jingoohan1@gmail.com>
> Cc: Bartlomiej Zolnierkiewicz <redacted>
> Cc: <redacted>
> Cc: <redacted>
> Cc: <redacted>
> 
> Signed-off-by: Guru Das Srinagesh <redacted>
> Reviewed-by: Daniel Thompson <redacted>
> ---
>  drivers/video/backlight/pwm_bl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Can this patch be taken on its own?

> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index efb4efc..3e5dbcf 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -625,7 +625,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>  		pb->scale = data->max_brightness;
>  	}
>  
> -	pb->lth_brightness = data->lth_brightness * (state.period / pb->scale);
> +	pb->lth_brightness = data->lth_brightness * (div_u64(state.period,
> +				pb->scale));
>  
>  	props.type = BACKLIGHT_RAW;
>  	props.max_brightness = data->max_brightness;

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
```

## Re: \[PATCH v11 10/12\] backlight: pwm\_bl: Use 64-bit division function

- From: Lee Jones \<hidden\>
- Date: 2020-03-24 11:06:25 
- Message: https://ratatoskr.run/linux-fbdev/2020/03/5905342.md

```text
On Fri, 20 Mar 2020, Lee Jones wrote:

> On Thu, 19 Mar 2020, Guru Das Srinagesh wrote:
> 
> > Since the PWM framework is switching struct pwm_state.period's datatype
> > to u64, prepare for this transition by using div_u64 to handle a 64-bit
> > dividend instead of a straight division operation.
> > 
> > Cc: Lee Jones <redacted>
> > Cc: Daniel Thompson <redacted>
> > Cc: Jingoo Han <jingoohan1@gmail.com>
> > Cc: Bartlomiej Zolnierkiewicz <redacted>
> > Cc: <redacted>
> > Cc: <redacted>
> > Cc: <redacted>
> > 
> > Signed-off-by: Guru Das Srinagesh <redacted>
> > Reviewed-by: Daniel Thompson <redacted>
> > ---
> >  drivers/video/backlight/pwm_bl.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Can this patch be taken on its own?

Hellooooo ...

> > diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> > index efb4efc..3e5dbcf 100644
> > --- a/drivers/video/backlight/pwm_bl.c
> > +++ b/drivers/video/backlight/pwm_bl.c
> > @@ -625,7 +625,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
> >  		pb->scale = data->max_brightness;
> >  	}
> >  
> > -	pb->lth_brightness = data->lth_brightness * (state.period / pb->scale);
> > +	pb->lth_brightness = data->lth_brightness * (div_u64(state.period,
> > +				pb->scale));
> >  
> >  	props.type = BACKLIGHT_RAW;
> >  	props.max_brightness = data->max_brightness;
> 

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
```

## Re: \[PATCH v11 10/12\] backlight: pwm\_bl: Use 64-bit division function

- From: Uwe Kleine-König \<hidden\>
- Date: 2020-03-24 12:57:48 
- Message: https://ratatoskr.run/linux-fbdev/2020/03/5905467.md

```text
Hello Lee,

On Tue, Mar 24, 2020 at 11:07:10AM +0000, Lee Jones wrote:
> On Fri, 20 Mar 2020, Lee Jones wrote:
> 
> > On Thu, 19 Mar 2020, Guru Das Srinagesh wrote:
> > 
> > > Since the PWM framework is switching struct pwm_state.period's datatype
> > > to u64, prepare for this transition by using div_u64 to handle a 64-bit
> > > dividend instead of a straight division operation.
> > > 
> > > Cc: Lee Jones <redacted>
> > > Cc: Daniel Thompson <redacted>
> > > Cc: Jingoo Han <jingoohan1@gmail.com>
> > > Cc: Bartlomiej Zolnierkiewicz <redacted>
> > > Cc: <redacted>
> > > Cc: <redacted>
> > > Cc: <redacted>
> > > 
> > > Signed-off-by: Guru Das Srinagesh <redacted>
> > > Reviewed-by: Daniel Thompson <redacted>
> > > ---
> > >  drivers/video/backlight/pwm_bl.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > Can this patch be taken on its own?
> 
> Hellooooo ...

Conceptually it can. As the last patch depends on this one (and the
others) some coordination might be beneficial. But that's up to Thierry
to decide how (and if) he want this series to be applied.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
```

## Re: \[PATCH v11 10/12\] backlight: pwm\_bl: Use 64-bit division function

- From: Daniel Thompson \<hidden\>
- Date: 2020-03-24 13:04:18 
- Message: https://ratatoskr.run/linux-fbdev/2020/03/5905470.md

```text
On Tue, Mar 24, 2020 at 01:57:35PM +0100, Uwe Kleine-König wrote:
> Hello Lee,
> 
> On Tue, Mar 24, 2020 at 11:07:10AM +0000, Lee Jones wrote:
> > On Fri, 20 Mar 2020, Lee Jones wrote:
> > 
> > > On Thu, 19 Mar 2020, Guru Das Srinagesh wrote:
> > > 
> > > > Since the PWM framework is switching struct pwm_state.period's datatype
> > > > to u64, prepare for this transition by using div_u64 to handle a 64-bit
> > > > dividend instead of a straight division operation.
> > > > 
> > > > Cc: Lee Jones <redacted>
> > > > Cc: Daniel Thompson <redacted>
> > > > Cc: Jingoo Han <jingoohan1@gmail.com>
> > > > Cc: Bartlomiej Zolnierkiewicz <redacted>
> > > > Cc: <redacted>
> > > > Cc: <redacted>
> > > > Cc: <redacted>
> > > > 
> > > > Signed-off-by: Guru Das Srinagesh <redacted>
> > > > Reviewed-by: Daniel Thompson <redacted>
> > > > ---
> > > >  drivers/video/backlight/pwm_bl.c | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > Can this patch be taken on its own?
> > 
> > Hellooooo ...
> 
> Conceptually it can. As the last patch depends on this one (and the
> others) some coordination might be beneficial. But that's up to Thierry
> to decide how (and if) he want this series to be applied.

... and on the backlight side we definitely need to know about the "if"
otherwise there's no point in taking it.


Daniel.
```

## Re: \[PATCH v11 10/12\] backlight: pwm\_bl: Use 64-bit division function

- From: Lee Jones \<hidden\>
- Date: 2020-03-24 14:23:58 
- Message: https://ratatoskr.run/linux-fbdev/2020/03/5905915.md

```text
On Tue, 24 Mar 2020, Daniel Thompson wrote:

> On Tue, Mar 24, 2020 at 01:57:35PM +0100, Uwe Kleine-König wrote:
> > Hello Lee,
> > 
> > On Tue, Mar 24, 2020 at 11:07:10AM +0000, Lee Jones wrote:
> > > On Fri, 20 Mar 2020, Lee Jones wrote:
> > > 
> > > > On Thu, 19 Mar 2020, Guru Das Srinagesh wrote:
> > > > 
> > > > > Since the PWM framework is switching struct pwm_state.period's datatype
> > > > > to u64, prepare for this transition by using div_u64 to handle a 64-bit
> > > > > dividend instead of a straight division operation.
> > > > > 
> > > > > Cc: Lee Jones <redacted>
> > > > > Cc: Daniel Thompson <redacted>
> > > > > Cc: Jingoo Han <jingoohan1@gmail.com>
> > > > > Cc: Bartlomiej Zolnierkiewicz <redacted>
> > > > > Cc: <redacted>
> > > > > Cc: <redacted>
> > > > > Cc: <redacted>
> > > > > 
> > > > > Signed-off-by: Guru Das Srinagesh <redacted>
> > > > > Reviewed-by: Daniel Thompson <redacted>
> > > > > ---
> > > > >  drivers/video/backlight/pwm_bl.c | 3 ++-
> > > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > > 
> > > > Can this patch be taken on its own?
> > > 
> > > Hellooooo ...
> > 
> > Conceptually it can. As the last patch depends on this one (and the
> > others) some coordination might be beneficial. But that's up to Thierry
> > to decide how (and if) he want this series to be applied.
> 
> ... and on the backlight side we definitely need to know about the "if"
> otherwise there's no point in taking it.

Right.

I'm happy to wait for Thierry.  Although this isn't the only set he's
currently blocking.  Is he okay?  On holiday perhaps?

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
```

## Re: \[PATCH v11 10/12\] backlight: pwm\_bl: Use 64-bit division function

- From: Uwe Kleine-König \<hidden\>
- Date: 2020-03-24 14:43:18 
- Message: https://ratatoskr.run/linux-fbdev/2020/03/5905956.md

```text
On Tue, Mar 24, 2020 at 02:24:41PM +0000, Lee Jones wrote:
> On Tue, 24 Mar 2020, Daniel Thompson wrote:
> 
> > On Tue, Mar 24, 2020 at 01:57:35PM +0100, Uwe Kleine-König wrote:
> > > Hello Lee,
> > > 
> > > On Tue, Mar 24, 2020 at 11:07:10AM +0000, Lee Jones wrote:
> > > > On Fri, 20 Mar 2020, Lee Jones wrote:
> > > > 
> > > > > On Thu, 19 Mar 2020, Guru Das Srinagesh wrote:
> > > > > 
> > > > > > Since the PWM framework is switching struct pwm_state.period's datatype
> > > > > > to u64, prepare for this transition by using div_u64 to handle a 64-bit
> > > > > > dividend instead of a straight division operation.
> > > > > > 
> > > > > > Cc: Lee Jones <redacted>
> > > > > > Cc: Daniel Thompson <redacted>
> > > > > > Cc: Jingoo Han <jingoohan1@gmail.com>
> > > > > > Cc: Bartlomiej Zolnierkiewicz <redacted>
> > > > > > Cc: <redacted>
> > > > > > Cc: <redacted>
> > > > > > Cc: <redacted>
> > > > > > 
> > > > > > Signed-off-by: Guru Das Srinagesh <redacted>
> > > > > > Reviewed-by: Daniel Thompson <redacted>
> > > > > > ---
> > > > > >  drivers/video/backlight/pwm_bl.c | 3 ++-
> > > > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > > > 
> > > > > Can this patch be taken on its own?
> > > > 
> > > > Hellooooo ...
> > > 
> > > Conceptually it can. As the last patch depends on this one (and the
> > > others) some coordination might be beneficial. But that's up to Thierry
> > > to decide how (and if) he want this series to be applied.
> > 
> > ... and on the backlight side we definitely need to know about the "if"
> > otherwise there's no point in taking it.
> 
> Right.
> 
> I'm happy to wait for Thierry.  Although this isn't the only set he's
> currently blocking.  Is he okay?  On holiday perhaps?

The newest commit by him in next is from last week. My guess is he
just didn't come around yet to care for the PWM duties.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
```

## Re: \[PATCH v11 10/12\] backlight: pwm\_bl: Use 64-bit division function

- From: Lee Jones \<hidden\>
- Date: 2020-04-15 09:25:47 
- Message: https://ratatoskr.run/linux-fbdev/2020/04/5927948.md

```text
On Tue, 24 Mar 2020, Uwe Kleine-König wrote:

> On Tue, Mar 24, 2020 at 02:24:41PM +0000, Lee Jones wrote:
> > On Tue, 24 Mar 2020, Daniel Thompson wrote:
> > 
> > > On Tue, Mar 24, 2020 at 01:57:35PM +0100, Uwe Kleine-König wrote:
> > > > Hello Lee,
> > > > 
> > > > On Tue, Mar 24, 2020 at 11:07:10AM +0000, Lee Jones wrote:
> > > > > On Fri, 20 Mar 2020, Lee Jones wrote:
> > > > > 
> > > > > > On Thu, 19 Mar 2020, Guru Das Srinagesh wrote:
> > > > > > 
> > > > > > > Since the PWM framework is switching struct pwm_state.period's datatype
> > > > > > > to u64, prepare for this transition by using div_u64 to handle a 64-bit
> > > > > > > dividend instead of a straight division operation.
> > > > > > > 
> > > > > > > Cc: Lee Jones <redacted>
> > > > > > > Cc: Daniel Thompson <redacted>
> > > > > > > Cc: Jingoo Han <jingoohan1@gmail.com>
> > > > > > > Cc: Bartlomiej Zolnierkiewicz <redacted>
> > > > > > > Cc: <redacted>
> > > > > > > Cc: <redacted>
> > > > > > > Cc: <redacted>
> > > > > > > 
> > > > > > > Signed-off-by: Guru Das Srinagesh <redacted>
> > > > > > > Reviewed-by: Daniel Thompson <redacted>
> > > > > > > ---
> > > > > > >  drivers/video/backlight/pwm_bl.c | 3 ++-
> > > > > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > > > > 
> > > > > > Can this patch be taken on its own?
> > > > > 
> > > > > Hellooooo ...
> > > > 
> > > > Conceptually it can. As the last patch depends on this one (and the
> > > > others) some coordination might be beneficial. But that's up to Thierry
> > > > to decide how (and if) he want this series to be applied.
> > > 
> > > ... and on the backlight side we definitely need to know about the "if"
> > > otherwise there's no point in taking it.
> > 
> > Right.
> > 
> > I'm happy to wait for Thierry.  Although this isn't the only set he's
> > currently blocking.  Is he okay?  On holiday perhaps?
> 
> The newest commit by him in next is from last week. My guess is he
> just didn't come around yet to care for the PWM duties.

Looks like we missed the last release.

Let's hope we don't miss the next one also.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
```
