Theo,

Thank you for comprehensive answer.

It can be wrong and I don't know on how to do acpi things right, but three
years ago I wrote about HP-Compaq acpiec specific errors to tech@. I'm not
a guru in programming, but it is very sorrowfully having the same acpiec
errors from version to version for about of three years on all old and
newest HP Compaq laptops...

Maybe HP does something wrong for more that three years and we should point
on these things?

Denis

On Mon, Oct 8, 2012 at 9:38 PM, Theo de Raadt <[email protected]>wrote:

> That diff will not go into the tree now, for the same reason it didn't
> go in two years ago.
>
> BECAUSE IT IS WRONG.
>
> > Two years ago Marco issued a patch in order to prevent incorrect
> > reading acpitz on HP Compaq (or any HP laptops with acpiec madness) by
> > adding some delays to have data prepared to read/write.
> >
> > It has been tested and works perfectly fine on some HP laptops: 6510b,
> > 8510p/w, 8710p/w.
> >
> > Please add this patch into the source tree to have it by default.
> >
> > Index: acpiec.c
> > ===================================================================
> > RCS file: /cvs/src/sys/dev/acpi/acpiec.c,v
> > retrieving revision 1.43
> > diff -u -p -r1.43 acpiec.c
> > --- acpiec.c    8 Aug 2010 17:25:41 -0000       1.43
> > +++ acpiec.c    29 Sep 2010 04:24:13 -0000
> > @@ -92,7 +92,7 @@ void
> >  acpiec_wait(struct acpiec_softc *sc, u_int8_t mask, u_int8_t val)
> >  {
> >         static int acpiecnowait;
> > -       u_int8_t                stat;
> > +       volatile u_int8_t stat;
> >
> >         dnprintf(40, "%s: EC wait_ns for: %b == %02x\n",
> >             DEVNAME(sc), (int)mask,
> > @@ -104,8 +104,14 @@ acpiec_wait(struct acpiec_softc *sc, u_i
> >                 if (cold || (stat & EC_STAT_BURST))
> >                         delay(1);
> >                 else
> > -                       tsleep(&acpiecnowait, PWAIT, "acpiec", 1);
> > +                       tsleep(&acpiecnowait, PWAIT, "ecstat", 1);
> >         }
> > +
> > +       /* delay to make sure the data is actually ready */
> > +       if (cold)
> > +               delay(10);
> > +       else
> > +               tsleep(&acpiecnowait, PWAIT, "ecout", 1);
> >
> >         dnprintf(40, "%s: EC wait_ns, stat: %b\n", DEVNAME(sc),
> (int)stat,
> >             "\20\x8IGN\x7SMI\x6SCI\05BURST\04CMD\03IGN\02IBF\01OBF");
> >
>
>


-- 
Best regards,

-- 
Denis Lapshin
E-mail: [email protected]

Reply via email to