Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

acpiec on acer aspire S7 with CURRENT

17 views
Skip to first unread message

Ilya Kaliman

unread,
Oct 10, 2016, 6:05:47 PM10/10/16
to te...@openbsd.org
Hi tech,

while trying the latest snapshot I've noticed that the following
warning is printed to a console several times a second (this does not
happen in 6.0):

acpi0: WARNING EC not initialized

The investigation shows that the acpiec initialization fails in
acpiec.c line 484:

if (size != 2 || *buf != RES_TYPE_ENDTAG)

On my system at this point the size value is 22 and the *buf is 0x47
(RES_TYPE_IOPORT).

I am not sure what the proper fix is, but removing the whole _CRS
ENDTAG check solves the problem (see attached patch).

Thanks,
Ilya

===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpiec.c,v
retrieving revision 1.54
diff -u -p -r1.54 acpiec.c
--- acpiec.c 23 Aug 2016 18:26:21 -0000 1.54
+++ acpiec.c 10 Oct 2016 21:55:59 -0000
@@ -477,15 +477,6 @@ acpiec_getcrs(struct acpiec_softc *sc, s
aml_freevalue(&res);
return (1);
}
-
- buf += ret;
- size -= ret;
-
- if (size != 2 || *buf != RES_TYPE_ENDTAG) {
- dnprintf(10, "%s: no _CRS end tag\n", DEVNAME(sc));
- aml_freevalue(&res);
- return (1);
- }
aml_freevalue(&res);

Paul Irofti

unread,
Oct 13, 2016, 3:50:07 AM10/13/16
to Ilya Kaliman, te...@openbsd.org
On Mon, Oct 10, 2016 at 03:04:33PM -0700, Ilya Kaliman wrote:
> Hi tech,
>
> while trying the latest snapshot I've noticed that the following
> warning is printed to a console several times a second (this does not
> happen in 6.0):
>
> acpi0: WARNING EC not initialized
>
> The investigation shows that the acpiec initialization fails in
> acpiec.c line 484:
>
> if (size != 2 || *buf != RES_TYPE_ENDTAG)
>
> On my system at this point the size value is 22 and the *buf is 0x47
> (RES_TYPE_IOPORT).
>
> I am not sure what the proper fix is, but removing the whole _CRS
> ENDTAG check solves the problem (see attached patch).
>
> Thanks,
> Ilya

Hi,

I think you are running on a hardware reduced ACPI machine, but I can
not tell for sure without a proper bug report (i.e. at least acpidump).

The diff you sent simply ignores the issue which obviously can not be
used in the tree.

Paul

Paul Irofti

unread,
Oct 13, 2016, 4:19:37 AM10/13/16
to Ilya Kaliman, te...@openbsd.org
> The diff you sent simply ignores the issue which obviously can not be
> used in the tree.

The following diff starts working in the right direction, but there is
probably more to do in order to support machines like yours.

It would be interesting to see if that printf gets triggered though, so
please test and let me know. Also, send that acpidump.


Index: acpiec.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpiec.c,v
retrieving revision 1.54
diff -u -p -u -p -r1.54 acpiec.c
--- acpiec.c 23 Aug 2016 18:26:21 -0000 1.54
+++ acpiec.c 13 Oct 2016 08:16:52 -0000
@@ -410,8 +410,8 @@ int
acpiec_getcrs(struct acpiec_softc *sc, struct acpi_attach_args *aa)
{
struct aml_value res;
- bus_size_t ec_sc, ec_data;
- int dtype, ctype;
+ bus_size_t ec_sc, ec_data, ec_gpio;
+ int dtype, ctype, iotype;
char *buf;
int size, ret;
int64_t gpe;
@@ -480,6 +480,20 @@ acpiec_getcrs(struct acpiec_softc *sc, s

buf += ret;
size -= ret;
+
+ if (sc->sc_acpi->sc_hw_reduced) {
+ ret = acpiec_getregister(buf, size, &iotype, &ec_gpio);
+ if (ret <= 0) {
+ dnprintf(10, "%s: failed to read GPIO from _CRS\n",
+ DEVNAME(sc));
+ aml_freevalue(&res);
+ return (1);
+ }
+ printf("%s: found GPIO port\n", DEVNAME(sc));
+
+ buf += ret;
+ size -= ret;
+ }

if (size != 2 || *buf != RES_TYPE_ENDTAG) {

Ilya Kaliman

unread,
Oct 13, 2016, 6:46:24 PM10/13/16
to Paul Irofti, te...@openbsd.org
Hi!

Thanks for looking into this. I've tried the patch and the "found GPIO
port" printf is not triggered because sc->sc_acpi->sc_hw_reduced is 0
for me.

Which acpi table should I attach?

Thanks,
Ilya


RSD PTR: Checksum=188, OEMID=ACRSYS, RsdtAddress=0x9aafe124


RSDT: Length=112, Revision=1, Checksum=171,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=, Creator Revision=0x1000013


Entries={ 0x9aaf7000, 0x9aafd000, 0x9aafc000, 0x9aafa000,
0x9aaf9000, 0x9aaf8000, 0x9aaf6000, 0x9aaf5000, 0x9aaf4000,
0x9aae2000, 0x9aae0000, 0x9aade000, 0x9aadd000, 0x9aada000,
0x9aad9000, 0x9aad5000, 0x9aad4000, 0x9aad3000, 0x9aae3000 }


DSDT=0x9aae4000
INT_MODEL=APIC
SCI_INT=9
SMI_CMD=0xb2, ACPI_ENABLE=0xa0, ACPI_DISABLE=0xa1, S4BIOS_REQ=0x0
PM1a_EVT_BLK=0x1800-0x1803
PM1a_CNT_BLK=0x1804-0x1805
PM2_CNT_BLK=0x1850-0x1850
PM2_TMR_BLK=0x1808-0x180b
PM2_GPE0_BLK=0x1880-0x189f
P_LVL2_LAT=101ms, P_LVL3_LAT=57ms
FLUSH_SIZE=1024, FLUSH_STRIDE=16
DUTY_OFFSET=1, DUTY_WIDTH=3
DAY_ALRM=13, MON_ALRM=0, CENTURY=0
Flags={WBINVD,PROC_C1,SLP_BUTTON,RTC_S4}


DSDT: Length=61736, Revision=1, Checksum=95,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x0,
Creator ID=1025, Creator Revision=0x40000


TCPA: Length=50, Revision=2, Checksum=139,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x0,
Creator ID=1025, Creator Revision=0x40000


UEFI: Length=566, Revision=1, Checksum=189,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000


FPDT: Length=68, Revision=1, Checksum=181,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000


MSDM: Length=85, Revision=3, Checksum=230,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000


ASF!: Length=165, Revision=32, Checksum=231,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000


HPET: Length=56, Revision=1, Checksum=170,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000


APIC: Length=140, Revision=3, Checksum=12,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000


MCFG: Length=60, Revision=1, Checksum=210,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000


SSDT: Length=2101, Revision=1, Checksum=93,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1000,
Creator ID=1025, Creator Revision=0x40000


BOOT: Length=40, Revision=1, Checksum=106,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000


ASPT: Length=52, Revision=7, Checksum=152,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000


DBGP: Length=52, Revision=1, Checksum=172,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000


SSDT: Length=1337, Revision=1, Checksum=105,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x3000,
Creator ID=1025, Creator Revision=0x40000


SSDT: Length=2776, Revision=1, Checksum=140,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x3000,
Creator ID=1025, Creator Revision=0x40000


SSDT: Length=12958, Revision=1, Checksum=91,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x3000,
Creator ID=1025, Creator Revision=0x40000


SSDT: Length=824, Revision=1, Checksum=146,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1000,
Creator ID=1025, Creator Revision=0x40000


SSDT: Length=1593, Revision=1, Checksum=58,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1000,
Creator ID=1025, Creator Revision=0x40000


DMAR: Length=136, Revision=1, Checksum=227,
OEMID=ACRSYS, OEM Table ID=ACRPRDCT, OEM Revision=0x1,
Creator ID=1025, Creator Revision=0x40000

Paul Irofti

unread,
Oct 14, 2016, 2:27:14 AM10/14/16
to Ilya Kaliman, te...@openbsd.org
> Which acpi table should I attach?

Use sendbug(1). See also

http://www.openbsd.org/report.html#bugtypes

0 new messages