Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Mar 2008 17:14:02 -0400
From:      Anish Mistry <amistry@am-productions.biz>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-acpi@freebsd.org
Subject:   Re: kern/121504: [patch] Correctly set hw.acpi.osname on certain machines
Message-ID:  <200803101714.11219.amistry@am-productions.biz>
In-Reply-To: <200803101522.39154.jhb@freebsd.org>
References:  <200803101910.m2AJA26c037165@freefall.freebsd.org> <200803101522.39154.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart1661461.ppnLUqxQta
Content-Type: text/plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Monday 10 March 2008, John Baldwin wrote:
> On Monday 10 March 2008 03:10:02 pm Anish Mistry wrote:
> > The following reply was made to PR kern/121504; it has been noted
> > by GNATS.
> >
> > From: Anish Mistry <amistry@am-productions.biz>
> > To: John Baldwin <jhb@freebsd.org>
> > Cc: bug-followup@freebsd.org, njl@freebsd.org
> > Subject: Re: kern/121504: [patch] Correctly set hw.acpi.osname on
> > certain
>
> machines
>
> > Date: Mon, 10 Mar 2008 15:09:04 -0400
> >
> >  --nextPart11816881.8XfUQkhbdk
> >  Content-Type: text/plain;
> >    charset=3D"iso-8859-1"
> >  Content-Transfer-Encoding: quoted-printable
> >  Content-Disposition: inline
> >
> >  On Monday 10 March 2008, John Baldwin wrote:
> >  > This is not the correct patch.  The _OSI method does not
> >  > return an OS name like _OS.  Instead, it is a function that
> >  > returns a boolean (True/False) to say if a given OS name is
> >  > supported (OS name is passed as an argument).  The proper fix
> >  > is to say that the osname is supported in the
> >  > AcpiOsValidateInterface() method.  Something like this should
> >  > work:
> >  >
> >  > Index: Osd/OsdMemory.c
> >  > =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3
> >  >D=3D3D=3D3D=3D3D=3D
>
> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
>3D=3D3D=3D3D=3D
>
> >  =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=
=3D3D=3D3D=3D3D=3D3D
> >
> >  > RCS file: /usr/cvs/src/sys/dev/acpica/Osd/OsdMemory.c,v
> >  > retrieving revision 1.15
> >  > diff -u -r1.15 OsdMemory.c
> >  > --- Osd/OsdMemory.c	22 Mar 2007 18:16:41 -0000	1.15
> >  > +++ Osd/OsdMemory.c	10 Mar 2008 16:20:03 -0000
> >  > @@ -77,6 +77,9 @@
> >  >  ACPI_STATUS
> >  >  AcpiOsValidateInterface (char *Interface)
> >  >  {
> >  > +
> >  > +    if (strcmp(Interface, acpi_osname) =3D3D=3D3D 0)
> >  > +	return (AE_OK);
> >  >      return (AE_SUPPORT);
> >  >  }
> >
> >  I get acpi_osname undeclared on compile.
>
> Try this:
>
> Index: acpivar.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /usr/cvs/src/sys/dev/acpica/acpivar.h,v
> retrieving revision 1.108
> diff -u -r1.108 acpivar.h
> --- acpivar.h	9 Oct 2007 07:48:07 -0000	1.108
> +++ acpivar.h	10 Mar 2008 19:18:53 -0000
> @@ -229,6 +229,11 @@
>  #define ACPI_IVAR_FLAGS		0x103
>
>  /*
> + * Storage for hw.acpi.osname tunable to override _OS or _OSI.
> + */
> +extern char	acpi_osname[];
> +
> +/*
>   * Accessor functions for our ivars.  Default value for
> BUS_READ_IVAR is * (type) 0.  The <sys/bus.h> accessor functions
> don't check return values. */
> Index: Osd/OsdMemory.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /usr/cvs/src/sys/dev/acpica/Osd/OsdMemory.c,v
> retrieving revision 1.15
> diff -u -r1.15 OsdMemory.c
> --- Osd/OsdMemory.c	22 Mar 2007 18:16:41 -0000	1.15
> +++ Osd/OsdMemory.c	10 Mar 2008 19:21:38 -0000
> @@ -33,13 +33,17 @@
>  #include <sys/cdefs.h>
>  __FBSDID("$FreeBSD: src/sys/dev/acpica/Osd/OsdMemory.c,v 1.15
> 2007/03/22 18:16:41 jkim Exp $");
>
> -#include <contrib/dev/acpica/acpi.h>
> -
> +#include <sys/param.h>
> +#include <sys/bus.h>
>  #include <sys/kernel.h>
>  #include <sys/malloc.h>
>  #include <vm/vm.h>
>  #include <vm/pmap.h>
>
> +#include <contrib/dev/acpica/acpi.h>
> +
> +#include <dev/acpica/acpivar.h>
> +
>  MALLOC_DEFINE(M_ACPICA, "acpica", "ACPI CA memory pool");
>
>  void *
> @@ -77,6 +81,9 @@
>  ACPI_STATUS
>  AcpiOsValidateInterface (char *Interface)
>  {
> +
> +    if (strcmp(Interface, acpi_osname) =3D=3D 0)
> +	return (AE_OK);
>      return (AE_SUPPORT);
>  }
>
> Index: Osd/OsdTable.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /usr/cvs/src/sys/dev/acpica/Osd/OsdTable.c,v
> retrieving revision 1.12
> diff -u -r1.12 OsdTable.c
> --- Osd/OsdTable.c	22 Mar 2007 18:16:41 -0000	1.12
> +++ Osd/OsdTable.c	10 Mar 2008 19:20:39 -0000
> @@ -32,6 +32,7 @@
>  __FBSDID("$FreeBSD: src/sys/dev/acpica/Osd/OsdTable.c,v 1.12
> 2007/03/22 18:16:41 jkim Exp $");
>
>  #include <sys/param.h>
> +#include <sys/bus.h>
>  #include <sys/endian.h>
>  #include <sys/kernel.h>
>  #include <sys/linker.h>
> @@ -39,10 +40,12 @@
>  #include <contrib/dev/acpica/acpi.h>
>  #include <contrib/dev/acpica/actables.h>
>
> +#include <dev/acpica/acpivar.h>
> +
>  #undef _COMPONENT
>  #define	_COMPONENT      ACPI_TABLES
>
> -static char acpi_osname[128];
> +char acpi_osname[128];
>  TUNABLE_STR("hw.acpi.osname", acpi_osname, sizeof(acpi_osname));
>
>  ACPI_STATUS

Ok, this compiles, but doesn't seem to set the override correctly. =20

Here is my asl.
http://am-productions.biz/docs/smallguy.asl

Basically the entire reason for this is that the code calls the=20
external method:
External (\_SB_.PCI0.GFX0.LCD_.BLNF, MethodObj)

When I press the backlight function keys and they don't do anything=20
besides displaying a Namespace lookup error since that method is not=20
defined.  No one responded to my previous email about creating an=20
external method that would get called.  Getting the right _OSI name=20
set just allows it to go to the fallback code that works with=20
acpi_fujitsu.

ACPI Error (psargs-0459): [\_SB_.PCI0.GFX0.LCD_.BLNF] Namespace lookup=20
failure, AE_NOT_FOUND
ACPI Error (psparse-0626): Method parse/execution failed [\_GPE._L1C]=20
(Node 0xff ffff00011bd780), AE_NOT_FOUND ACPI Exception (evgpe-0687):=20
AE_NOT_FOUND, while evaluating GPE method [_L1C] [20070320]


=2D-=20
Anish Mistry
amistry@am-productions.biz
AM Productions http://am-productions.biz/

--nextPart1661461.ppnLUqxQta
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (FreeBSD)

iEYEABECAAYFAkfVpJsACgkQxqA5ziudZT0rCACff0fhtfcyV2aj1ezg2cniQbXQ
ipYAniAK+RSFfnCPh1mem8z+8/Rx63jY
=4moB
-----END PGP SIGNATURE-----

--nextPart1661461.ppnLUqxQta--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803101714.11219.amistry>