The PC speaker beep stops working on Lenovo M90n after enabling ACPI (in QNX)
by devinsteffler@gmail.com
Hello,
I've run into a strange situation and I'm wondering if anyone can provide some insight into what might be happening. I'm using code that's basically the same as the following example to create a beep using the internal PC speaker: https://wiki.osdev.org/PC_Speaker#Sample_Code.
I'm running QNX on a Lenovo M90n (Intel i5-8365U CPU). I'm using my own ACPICA based driver to manage things like reading battery level.
Strangely though, on this machine, after ACPI is enabled then the PC speaker stops working as expected. I've narrowed it down to the following initialization code within ACPICA:
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand, // 0xB2 on this x86_64 platform (Lenovo M90n)
(UINT32) AcpiGbl_FADT.AcpiEnable, // 0xA0 on this x86_64 platform (Lenovo M90n)
8);
Before that line executes, I can generate a beep just fine. However, as soon as that line returns, then I cannot generate beeps anymore.
The speaker itself is still functional. If I toggle the in/out value of the speaker via port 0x61 then I hear an audible click. So it's almost as if the PIT itself is not generating a square wave on channel 2 when put into mode 3.
For example, for a 2 second beep:
- Before ACPI is enabled, I hear a 2 second beep at my desired frequency.
- After ACPI is enabled via the line specified above, then I hear a click, then two seconds later I hear another click. There is no beep in between the clicks.
Any ideas are appreciated. Is the SMI handler implemented in the PC's UEFI firmware? If so, does this behavior suggest that there's a bug in it (and I should be contacting Lenovo for support)? From what I found online, it looks like writing to 0xB2 should generate an SMI interrupt (handled by the SMI handler, which should process the value 0xA0 that ACPICA is sending to it).
I haven't tried to replicate the issue on any other OS yet, but maybe I should try that as well.
Thanks,
Devin
5 months, 2 weeks
[pm:bleeding-edge] BUILD SUCCESS b5d7c2d02f9915dcecf7ffa3b7d25cc01368465a
by kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
branch HEAD: b5d7c2d02f9915dcecf7ffa3b7d25cc01368465a Merge branch 'pm-cpufreq-next' into bleeding-edge
elapsed time: 723m
configs tested: 93
configs skipped: 2
The following configs have been built successfully.
More configs may be tested in the coming days.
gcc tested configs:
arm defconfig
arm64 allyesconfig
arm allyesconfig
arm allmodconfig
arm64 defconfig
arm vt8500_v6_v7_defconfig
powerpc amigaone_defconfig
arm spear6xx_defconfig
arm mmp2_defconfig
ia64 generic_defconfig
mips maltaup_xpa_defconfig
xtensa generic_kc705_defconfig
powerpc obs600_defconfig
sh sh7770_generic_defconfig
powerpc mpc837x_mds_defconfig
sh se7206_defconfig
arm tct_hammer_defconfig
m68k m5208evb_defconfig
microblaze mmu_defconfig
arm pxa3xx_defconfig
mips fuloong2e_defconfig
sh sdk7780_defconfig
arm cns3420vb_defconfig
arm colibri_pxa270_defconfig
ia64 allmodconfig
ia64 defconfig
ia64 allyesconfig
m68k allmodconfig
m68k defconfig
m68k allyesconfig
nds32 defconfig
nios2 allyesconfig
csky defconfig
alpha defconfig
alpha allyesconfig
nios2 defconfig
arc allyesconfig
nds32 allnoconfig
c6x allyesconfig
xtensa allyesconfig
h8300 allyesconfig
arc defconfig
sh allmodconfig
parisc defconfig
s390 allyesconfig
parisc allyesconfig
s390 defconfig
i386 allyesconfig
sparc allyesconfig
sparc defconfig
i386 defconfig
mips allyesconfig
mips allmodconfig
powerpc allyesconfig
powerpc allmodconfig
powerpc allnoconfig
i386 randconfig-a004-20201102
i386 randconfig-a006-20201102
i386 randconfig-a005-20201102
i386 randconfig-a001-20201102
i386 randconfig-a002-20201102
i386 randconfig-a003-20201102
x86_64 randconfig-a012-20201102
x86_64 randconfig-a015-20201102
x86_64 randconfig-a011-20201102
x86_64 randconfig-a013-20201102
x86_64 randconfig-a014-20201102
x86_64 randconfig-a016-20201102
i386 randconfig-a013-20201102
i386 randconfig-a015-20201102
i386 randconfig-a014-20201102
i386 randconfig-a016-20201102
i386 randconfig-a011-20201102
i386 randconfig-a012-20201102
riscv nommu_k210_defconfig
riscv allyesconfig
riscv nommu_virt_defconfig
riscv allnoconfig
riscv defconfig
riscv rv32_defconfig
riscv allmodconfig
x86_64 rhel
x86_64 allyesconfig
x86_64 rhel-7.6-kselftests
x86_64 defconfig
x86_64 rhel-8.3
x86_64 kexec
clang tested configs:
x86_64 randconfig-a004-20201102
x86_64 randconfig-a005-20201102
x86_64 randconfig-a003-20201102
x86_64 randconfig-a002-20201102
x86_64 randconfig-a006-20201102
x86_64 randconfig-a001-20201102
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
5 months, 2 weeks