Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Mar 2019 18:09:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 236513] AMD Jaguar: Only CPU core 0 detects C2 state
Message-ID:  <bug-236513-227-g4z2qfj5Yv@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-236513-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-236513-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236513

--- Comment #24 from stockhausen@collogia.de ---
One step further:

The wrong ACPI definitions are indeed the culprit of the wrong C2 state
registration. I implemented a lousy patch in acpi.c:

/*
 * Pre-allocate/manage all memory and IO resources.  Since rman can't handle
 * duplicates, we merge any in the sysresource attach routine.
 */
static int
acpi_sysres_alloc(device_t dev)
{
  ...
    rl =3D BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev);
    STAILQ_FOREACH(rle, rl, link) {
        if (rle->res !=3D NULL) {
            device_printf(dev, "duplicate resource for %jx\n", rle->start);
            continue;
        }

        if (rle->start =3D=3D 0x40b=20
         && rle->count =3D=3D 1=20
         && rle->type =3D=3D SYS_RES_IOPORT) {
          printf("ACPI: fake IO port range 0x40b/1 -> 0x400/32\n");
          rle->start =3D 0x400;
          rle->count =3D 32;
        }

So when ACPI wants to register a single port 0x40b we expand the range to
0x400-0x420.=20

With that devinfo -rv shows:

nexus0
  ...
  acpi0
      Interrupt request lines:
          0x9
      I/O ports:
          ...
          0x400-0x41f
          ...
    cpu0 pnpinfo _HID=3Dnone _UID=3D0 at handle=3D\_PR_.P000
        ACPI I/O ports:
            0x414
      acpi_perf0
      acpi_throttle0
      hwpstate0
      cpufreq0
    cpu1 pnpinfo _HID=3Dnone _UID=3D0 at handle=3D\_PR_.P001
        ACPI I/O ports:
            0x414
      acpi_perf1
      acpi_throttle1
      hwpstate1

Yeah! The second and following cores can register I/O port 0x414. And final=
ly
sysctl shows all C2 states:

# sysctl -a | grep cx_suppo
dev.cpu.3.cx_supported: C1/1/0 C2/2/400
dev.cpu.2.cx_supported: C1/1/0 C2/2/400
dev.cpu.1.cx_supported: C1/1/0 C2/2/400
dev.cpu.0.cx_supported: C1/1/0 C2/2/400

Now I need some assistance:

1. Either patch the BIOS. But how?

2. Implement a workaround in CPU registration if port is not yet registered.
But how?

Thanks in advance.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-236513-227-g4z2qfj5Yv>