Bug 209657

Summary: PnP unable to detect connected PS/2 mouse on Asus F2A85-M PRO
Product: ACPI Reporter: Paul Menzel (pmenzel+bugzilla.kernel.org)
Component: OtherAssignee: Zhang Rui (rui.zhang)
Status: DEFERRED UNREPRODUCIBLE    
Severity: normal CC: rui.zhang
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.9 Subsystem:
Regression: No Bisected commit-id:
Attachments: Output of `acpidump`
debug patch

Description Paul Menzel 2020-10-13 14:51:10 UTC
Created attachment 292943 [details]
Output of `acpidump`

Reference: https://lkml.org/lkml/2020/10/7/931

On the Asus F2A85-M PRO Linux 5.9-rc8 (and previous versions) does not 
recognize a plugged in PS/2 mouse using the Plug & Play method. The PS/2 
keyboard is detected fine, and using `i8042.nopnp`, the PS/2 mouse also 
works.

> [    1.035915] calling  i8042_init+0x0/0x42d @ 1
> [    1.035947] i8042: PNP: PS/2 Controller [PNP0303:PS2K] at 0x60,0x64 irq 1
> [    1.035948] i8042: PNP: PS/2 appears to have AUX port disabled, if this is
> incorrect please boot with i8042.nopnp
> [    1.036589] serio: i8042 KBD port at 0x60,0x64 irq 1
> [    1.036621] initcall i8042_init+0x0/0x42d returned 0 after 687 usecs

Dmitry’s answer was:

> My guess is that _STA returns 0 indicating that the device is not
> present. I would try tracking where IOST is being set and figuring out
> why it does not have mouse bit enabled

Unfortunately, I do not know how, so I attach the output of `acpidump`.
Comment 1 Paul Menzel 2020-10-13 14:56:26 UTC
The disassembled DSDT has:

```
[…]
    Name (IOST, 0x0401)

[…]
                Device (PS2K)
                {
                    Name (_HID, EisaId ("PNP0303") /* IBM Enhanced Keyboard (101/102-key, PS/2 Mouse) */)
  // _HID: Hardware ID
                    Name (_CID, EisaId ("PNP030B"))  // _CID: Compatible ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If ((IOST & 0x0400))
                        {
                            Return (0x0F)
                        }
                        Else
                        {
                            Return (Zero)
                        }
                    }
[…]
                Device (PS2M)
                {
                    Name (_HID, EisaId ("PNP0F03") /* Microsoft PS/2-style Mouse */)  // _HID: Hardware ID
                    Name (_CID, EisaId ("PNP0F13") /* PS/2 Mouse */)  // _CID: Compatible ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If ((IOST & 0x4000))
                        {
                            Return (0x0F)
                        }
                        Else
                        {
                            Return (Zero)
                        }
                    }
[…]
                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        If ((IOST & 0x0400))
                        {
                            Return (CRS1) /* \_SB_.PCI0.SBRG.PS2M.CRS1 */
                        }
                        Else
                        {
                            Return (CRS2) /* \_SB_.PCI0.SBRG.PS2M.CRS2 */
                        }
                    }
[…]
```

Is 0x0400 vs 0x4000 a typo?
Comment 2 Zhang Rui 2021-03-21 15:16:39 UTC
Are you using pnpacpi=off?
please attach the output of "grep . /sys/bus/acpi/devices/PNP0303/*" AND "grep . /sys/bus/acpi/devices/PNP0F03/*"
Comment 3 Zhang Rui 2021-03-21 15:21:01 UTC
Created attachment 295977 [details]
debug patch

please verify if this patch helps or not.
Comment 4 Paul Menzel 2021-04-14 07:38:24 UTC
The CMOS battery died, and the firmware settings were set to default.

Testing with Linux 5.12-rc6 and Debian’s Linux 5.10.28 it works fine now.

    [    0.014646] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.12.0-rc6+ root=PARTUUID=a8d3fa41-01 rw noisapnp cryptomgr.notests quiet initcall_debug init=/lib/systemd/systemd-bootchart memory_corruption_check=1 memory_corruption_check_size=512k memory_corruption_check_period=5 iomem=relaxed apparmor=0 selinux=0 kmemleak=off initcall_blacklist=serial8250_init,asus_wmi_init,wmi_bmof_driver_init udev.children_max=6 udev.log_priority=info maxcpus=4 log_buf_len=2M random.trust_cpu=on
    […]
    [    0.280539] i8042: PNP: PS/2 Controller [PNP0f03:PS2M] at 0x60,0x64 irq 12
    [    0.280541] i8042: PNP: PS/2 controller doesn't have KBD irq; using default 1
    […]
    [    0.283217] serio: i8042 KBD port at 0x60,0x64 irq 1
    [    0.283222] serio: i8042 AUX port at 0x60,0x64 irq 12
    […]
    [    1.407639] input: PS/2 Logitech Mouse as /devices/platform/i8042/serio1/input/input4

I have to do more tests, and this will take a while.
Comment 5 Paul Menzel 2021-04-30 08:17:31 UTC
Comment on attachment 295977 [details]
debug patch

`{"PNP0f03"},` is already there some lines down. Or does the case matter?
Comment 6 Zhang Rui 2021-05-06 02:25:21 UTC
Interesting that this problem is gone after a BIOS reset.

I don't think the case matters.