Re: [regression]: acpi_aiboost fails to attach on Asus P5Q3 Deluxe in 8.0 (Was: [regression] : 8.0-BETA3 (and BETA2?) acpi_hpet0 fails on TYAN H2000M)

From: Olivier Smedts <olivier_at_gid0.org>
Date: Tue, 22 Sep 2009 20:14:02 +0200
2009/9/22 John Baldwin <jhb_at_freebsd.org>:
> On Saturday 19 September 2009 1:09:19 pm Olivier Smedts wrote:
>> 2009/8/24 John Baldwin <jhb_at_freebsd.org>
>> >
>> > On Monday 24 August 2009 4:54:13 pm Olivier Smedts wrote:
>> > > 2009/8/24 John Baldwin <jhb_at_freebsd.org>:
>> > > > On Saturday 22 August 2009 1:20:18 pm Arno J. Klaassen wrote:
>> > > >>
>> > > >> Hello,
>> > > >>
>> > > >> I have a regression with acpi_hpet on a Tyan H2000M MB :
>> > > >>
>> > > >>   acpi_hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed03fff on
>> > acpi0
>> > > >>   acpi_hpet0: HPET never increments, disabling
>> > > >>   device_attach: acpi_hpet0 attach returned 6
>> > > >>   [twice]
>> > > >>
>> > > >> it exists at least since Aug16 sources (I just looked at
>> > > >> the 'netif' problems on this board which BTW are indeed fixed
>> > > >> by recent flowtable init changes)
>> > > >
>> > > > Perhaps the recent ACPI-CA update is when this broke?
>> > >
>> > > Sorry for hijacking the thread (and not reporting this before) but
>> > > maybe my issues with acpi_aiboost are related. It won't attach on my
>> > > ASUS P5Q3 Deluxe (latest BIOS) since the ACPICA update (which also
>> > > made "est" attach successfully on this ASUS board) :
>> > >
>> > > acpi_aiboost0: <ASUStek AIBOOSTER> on acpi0
>> > > NOREF
>> > > BAD DATA
>> > > device_attach: acpi_aiboost0 attach returned 22
>> >
>> > I would figure out what function in it's attach routine is failing with EINVAL
>> > and drill down from there.  It looks like it is dying trying to
>> > evaluate "TSIF", "VSIF", or "FSIF".  Maybe add some printfs to see which one
>> > and print out the 'elem->Type' in the "NOREF" error message.  You could also
>> > just print the 'name' there as well which would help perhaps.
>> >
>> > --
>> > John Baldwin
>
> Ok, try this.  I believe that the newer ACPI-CA is expanding the package
> inline and there is no reason the subpackages have to be external
> references rather than inline.

Well, simply said : it works ! I only had to sed 's/type/Type/'. I
still have the debugging 'printf("%s : %i\n", name, elem->Type);' in
the 'for(i = 1 ; i < o->Package.Count; i++)' loop and here are the
results :
# dmesg | tail -n 12
acpi_aiboost0: <ASUStek AIBOOSTER> on acpi0
TSIF : 4
TSIF : 4
VSIF : 4
VSIF : 4
VSIF : 4
VSIF : 4
FSIF : 4
FSIF : 4
FSIF : 4
FSIF : 4
FSIF : 4
# sysctl dev.acpi_aiboost
dev.acpi_aiboost.0.%desc: ASUStek AIBOOSTER
dev.acpi_aiboost.0.%driver: acpi_aiboost
dev.acpi_aiboost.0.%location: handle=\_SB_.PCI0.SBRG.ASOC
dev.acpi_aiboost.0.%pnpinfo: _HID=ATK0110 _UID=16843024
dev.acpi_aiboost.0.%parent: acpi0
dev.acpi_aiboost.0.temp0: 335
dev.acpi_aiboost.0.temp1: 410
dev.acpi_aiboost.0.volt0: 1080
dev.acpi_aiboost.0.volt1: 3296
dev.acpi_aiboost.0.volt2: 4944
dev.acpi_aiboost.0.volt3: 12208
dev.acpi_aiboost.0.fan0: 1506
dev.acpi_aiboost.0.fan1: 784
dev.acpi_aiboost.0.fan2: 847
dev.acpi_aiboost.0.fan3: 756
dev.acpi_aiboost.0.fan4: 0

Thanks !

>
> Index: acpi_aiboost.c
> ===================================================================
> --- acpi_aiboost.c      (revision 197402)
> +++ acpi_aiboost.c      (working copy)
> _at__at_ -46,7 +46,6 _at__at_
>
>  #define DESCSTRLEN 32
>  struct acpi_aiboost_element{
> -       ACPI_HANDLE h;
>        uint32_t id;
>        char desc[DESCSTRLEN];
>  };
> _at__at_ -127,22 +126,23 _at__at_
>
>        for(i = 1 ; i < o->Package.Count; i++){
>                elem = &o->Package.Elements[i];
> -               if(elem->Type != ACPI_TYPE_ANY){
> -                       printf("NOREF\n");
> -                       goto error;
> -               }
> -               c->elem[ i - 1].h = elem->Reference.Handle;
> +               if (elem->type == ACPI_TYPE_ANY) {
> +                       buf2.Pointer = NULL;
> +                       buf2.Length = ACPI_ALLOCATE_BUFFER;
>
> -               buf2.Pointer = NULL;
> -               buf2.Length = ACPI_ALLOCATE_BUFFER;
> -
> -               status = AcpiEvaluateObject(c->elem[i - 1].h, NULL, NULL,
> -                                           &buf2);
> -               if(ACPI_FAILURE(status)){
> -                       printf("FETCH OBJECT\n");
> +                       status = AcpiEvaluateObject(elem->Reference.Handle,
> +                           NULL, NULL, &buf2);
> +                       if (ACPI_FAILURE(status)){
> +                               printf("FETCH OBJECT\n");
> +                               goto error;
> +                       }
> +                       subobj = buf2.Pointer;
> +               } else if (elem->type == ACPI_TYPE_PACKAGE)
> +                       subobj = elem;
> +               else {
> +                       printf("NO PACKAGE\n");
>                        goto error;
>                }
> -               subobj = buf2.Pointer;
>                if(ACPI_FAILURE(acpi_PkgInt32(subobj,0, &c->elem[i -1].id))){
>                        printf("ID FAILED\n");
>                        goto error;
> _at__at_ -151,15 +151,17 _at__at_
>                                     sizeof(c->elem[i - 1].desc));
>                if(ACPI_FAILURE(status)){
>                        if(status == E2BIG){
> -                               c->elem[i-1].desc[DESCSTRLEN-1] = 0;
> +                               c->elem[i - 1].desc[DESCSTRLEN-1] = 0;
>                        }else{
>                                printf("DESC FAILED %d\n", i-1);
>                                goto error;
>                        }
>                }
>
> -               if(buf2.Pointer)
> -                 AcpiOsFree(buf2.Pointer);
> +               if (buf2.Pointer) {
> +                       AcpiOsFree(buf2.Pointer);
> +                       buf2.Pointer = NULL;
> +               }
>        }
>
>        if(buf.Pointer)
>
> --
> John Baldwin
>



-- 
Olivier Smedts                                                 _
                                        ASCII ribbon campaign ( )
e-mail: olivier_at_gid0.org        - against HTML email & vCards  X
www: http://www.gid0.org    - against proprietary attachments / \

  "Il y a seulement 10 sortes de gens dans le monde :
  ceux qui comprennent le binaire,
  et ceux qui ne le comprennent pas."
Received on Tue Sep 22 2009 - 16:14:04 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:55 UTC