Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2014 18:14:34 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        "freebsd-acpi@freebsd.org" <freebsd-acpi@freebsd.org>
Subject:   Re: Investigating failed suspend/resume T61
Message-ID:  <53865FCA.6080407@FreeBSD.org>
In-Reply-To: <201405281729.35703.jhb@freebsd.org>
References:  <1400861698.1126.0.camel@bruno> <201405281556.37651.jhb@freebsd.org> <538641DE.5030309@FreeBSD.org> <201405281729.35703.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2014-05-28 17:29:35 -0400, John Baldwin wrote:
> Err, I think it enables GPE1 as otherwise ACPICA assumes GPE1 has a
> length of zero (and is thus invalid)?  Perhaps _PTS wants to frob
> something that uses GPE1 that this fixes?

static void
AcpiTbValidateFadt (
    void)
{
...
    UINT8                   Length;
...
    for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++)
    {
...
        Length = *ACPI_ADD_PTR (UINT8,
                        &AcpiGbl_FADT, FadtInfoTable[i].Length);
...

Note the Length is read from the internal FADT and it is NOT a pointer.

...
        if (Address64->Address &&
           (ACPI_MUL_8 (Length) <= ACPI_UINT8_MAX) &&
           (Address64->BitWidth != ACPI_MUL_8 (Length)))
        {
            ACPI_BIOS_WARNING ((AE_INFO,
                "32/64X length mismatch in FADT/%s: %u/%u",
                Name, ACPI_MUL_8 (Length), Address64->BitWidth));
+	    if (Length == 0)
+	    {
+		Length = ACPI_DIV_8 (Address64->BitWidth);
+	    }
	}
...
    }
}

AFAICT, it does change anything in AcpiGbl_FADT.  If you really wanted
to "patch" it, you had to do something like this:

+	    if (Length == 0)
+	    {
+		Length = ACPI_DIV_8 (Address64->BitWidth);
+		*ACPI_ADD_PTR (UINT8,
+		    &AcpiGbl_FADT, FadtInfoTable[i].Length) = Length;
+	    }

However, it had to be done from AcpiEvGpeInitialize() in
sys/contrib/dev/acpica/components/events/evgpeinit.c, IMHO.

ACPI_STATUS
AcpiEvGpeInitialize (
    void)
{
...
    if (AcpiGbl_FADT.Gpe1BlockLength &&
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                   HERE!!!
        AcpiGbl_FADT.XGpe1Block.Address)
    {
...

What did I miss?

Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iQEcBAEBAgAGBQJThl/KAAoJEHyflib82/FGessH+gOcPzgbg8/kPbpkHl6y6n1n
1vMgky6TB1v5ul48YEtnHQybK0pFm/9UVaxOnJFEAKmDzVyr739xFnveht3g1otQ
LLM0vDh6dLNV2qlmLSVNQQm3Fsvu0NdF737dsSNyksi6vvKAjb7o45nn1UmkQmv/
lqNjSEaSuW8dLR9xuvvQvUUFgxGyGM3UuAk7tHOF7PQo/EwRvbkc2W0cOfRLPXqP
Se+B/8kggxSoV+yj/kHdoYm5wb/dsVfudkh7grKtm/C2iH/PqAhnYDLWEfbSZbpz
Vy3C+r4/uz4I3CaV7Txz13plbYqIJ1oo3sdUxUdLH+SfbaY16+adHJZFfagVyOU=
=n4SF
-----END PGP SIGNATURE-----



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