lcd(4/hppa): timeout_add(9) -> timeout_add_usec(9)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

lcd(4/hppa): timeout_add(9) -> timeout_add_usec(9)

Scott Cheloha
lcd_softc.sc_delay's unit appears to be microseconds.

ok?

Index: lcd.c
===================================================================
RCS file: /cvs/src/sys/arch/hppa/dev/lcd.c,v
retrieving revision 1.4
diff -u -p -r1.4 lcd.c
--- lcd.c 11 Dec 2015 16:07:01 -0000 1.4
+++ lcd.c 22 Dec 2019 19:16:31 -0000
@@ -138,7 +138,7 @@ lcd_blink(void *v, int on)
 
  sc->sc_on = on;
  bus_space_write_1(sc->sc_iot, sc->sc_cmdh, 0, sc->sc_heartbeat[0]);
- timeout_add(&sc->sc_to, max(1, (sc->sc_delay * hz) / 1000000));
+ timeout_add_usec(&sc->sc_to, sc->sc_delay);
 }
 
 void

Reply | Threaded
Open this post in threaded view
|

Re: lcd(4/hppa): timeout_add(9) -> timeout_add_usec(9)

Scott Cheloha
On Sun, Dec 22, 2019 at 01:17:56PM -0600, Scott Cheloha wrote:
> lcd_softc.sc_delay's unit appears to be microseconds.
>
> ok?

1 month bump.

Index: dev/lcd.c
===================================================================
RCS file: /cvs/src/sys/arch/hppa/dev/lcd.c,v
retrieving revision 1.4
diff -u -p -r1.4 lcd.c
--- dev/lcd.c 11 Dec 2015 16:07:01 -0000 1.4
+++ dev/lcd.c 8 Feb 2020 19:14:08 -0000
@@ -138,7 +138,7 @@ lcd_blink(void *v, int on)
 
  sc->sc_on = on;
  bus_space_write_1(sc->sc_iot, sc->sc_cmdh, 0, sc->sc_heartbeat[0]);
- timeout_add(&sc->sc_to, max(1, (sc->sc_delay * hz) / 1000000));
+ timeout_add_usec(&sc->sc_to, sc->sc_delay);
 }
 
 void

Reply | Threaded
Open this post in threaded view
|

Re: lcd(4/hppa): timeout_add(9) -> timeout_add_usec(9)

Mark Kettenis
On 2020-02-08 20:15, Scott Cheloha wrote:
> On Sun, Dec 22, 2019 at 01:17:56PM -0600, Scott Cheloha wrote:
>> lcd_softc.sc_delay's unit appears to be microseconds.
>>
>> ok?
>
> 1 month bump.

While the diff looks ok to me, I can't test this until I have physical
access to my hppa machines.

> Index: dev/lcd.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/hppa/dev/lcd.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 lcd.c
> --- dev/lcd.c 11 Dec 2015 16:07:01 -0000 1.4
> +++ dev/lcd.c 8 Feb 2020 19:14:08 -0000
> @@ -138,7 +138,7 @@ lcd_blink(void *v, int on)
>
>   sc->sc_on = on;
>   bus_space_write_1(sc->sc_iot, sc->sc_cmdh, 0, sc->sc_heartbeat[0]);
> - timeout_add(&sc->sc_to, max(1, (sc->sc_delay * hz) / 1000000));
> + timeout_add_usec(&sc->sc_to, sc->sc_delay);
>  }
>
>  void

Reply | Threaded
Open this post in threaded view
|

Re: lcd(4/hppa): timeout_add(9) -> timeout_add_usec(9)

Scott Cheloha
On Mon, Feb 10, 2020 at 11:48:34AM +0100, Mark Kettenis wrote:

> On 2020-02-08 20:15, Scott Cheloha wrote:
> > On Sun, Dec 22, 2019 at 01:17:56PM -0600, Scott Cheloha wrote:
> > > lcd_softc.sc_delay's unit appears to be microseconds.
> > >
> > > ok?
> >
> > 1 month bump.
>
> While the diff looks ok to me, I can't test this until I have physical
> access to my hppa machines.

Alright, I'll wait for your test.

Reply | Threaded
Open this post in threaded view
|

Re: lcd(4/hppa): timeout_add(9) -> timeout_add_usec(9)

Mark Kettenis
In reply to this post by Scott Cheloha
> Date: Sat, 8 Feb 2020 13:15:47 -0600
> From: Scott Cheloha <[hidden email]>
>
> On Sun, Dec 22, 2019 at 01:17:56PM -0600, Scott Cheloha wrote:
> > lcd_softc.sc_delay's unit appears to be microseconds.
> >
> > ok?
>
> 1 month bump.

Finaly verified that it works.

ok kettenis@

> Index: dev/lcd.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/hppa/dev/lcd.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 lcd.c
> --- dev/lcd.c 11 Dec 2015 16:07:01 -0000 1.4
> +++ dev/lcd.c 8 Feb 2020 19:14:08 -0000
> @@ -138,7 +138,7 @@ lcd_blink(void *v, int on)
>  
>   sc->sc_on = on;
>   bus_space_write_1(sc->sc_iot, sc->sc_cmdh, 0, sc->sc_heartbeat[0]);
> - timeout_add(&sc->sc_to, max(1, (sc->sc_delay * hz) / 1000000));
> + timeout_add_usec(&sc->sc_to, sc->sc_delay);
>  }
>  
>  void
>