您尚未登录。

#1 2023-02-14 06:20:09

cybird
会员
注册时间: 2023-02-14
帖子: 16

在插拔电源时内核不发送任何事件,电池电量变化时也不发送任何事件。

在HP笔记本上,当我运行udevadm monitor后,没有任何电源有关的事件被打印出来,插拔电源后也是没有任何输出。
编写的与电源有关的udev规则也不会被触发。

笔记本型号:HP RMN: TPN-C141
CPU: Intel i7-9750H

> journalctl -p err -b0 
eb 14 05:45:47 FlyArch kernel: x86/cpu: SGX disabled by BIOS.
Feb 14 05:45:48 FlyArch kernel: iwlwifi 0000:00:14.3: BIOS contains WGDS but no WRDS
Feb 14 05:45:49 FlyArch kernel: nvidia-gpu 0000:01:00.3: i2c timeout error e0000000
Feb 14 05:45:49 FlyArch kernel: ucsi_ccg 6-0008: i2c_transfer failed -110
Feb 14 05:45:49 FlyArch kernel: ucsi_ccg 6-0008: ucsi_ccg_init failed - -110
Feb 14 05:45:53 FlyArch kernel:
> grep . /sys/firmware/acpi/interrupts/*
/sys/firmware/acpi/interrupts/error:       0
/sys/firmware/acpi/interrupts/ff_gbl_lock:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/ff_pmtimer:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/ff_pwr_btn:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/ff_rt_clk:       0         disabled     unmasked
/sys/firmware/acpi/interrupts/ff_slp_btn:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe00:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe01:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe02:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe03:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe04:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe05:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe06:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe07:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe08:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe09:       0         disabled     unmasked
/sys/firmware/acpi/interrupts/gpe0A:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe0B:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe0C:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe0D:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe0E:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe0F:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe10:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe11:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe12:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe13:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe14:       0     STS invalid      unmasked
/sys/firmware/acpi/interrupts/gpe15:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe16:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe17:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe18:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe19:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe1A:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe1B:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe1C:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe1D:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe1E:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe1F:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe20:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe21:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe22:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe23:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe24:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe25:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe26:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe27:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe28:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe29:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe2A:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe2B:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe2C:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe2D:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe2E:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe2F:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe30:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe31:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe32:       0         disabled     unmasked
/sys/firmware/acpi/interrupts/gpe33:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe34:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe35:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe36:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe37:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe38:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe39:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe3A:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe3B:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe3C:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe3D:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe3E:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe3F:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe40:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe41:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe42:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe43:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe44:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe45:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe46:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe47:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe48:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe49:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe4A:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe4B:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe4C:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe4D:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe4E:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe4F:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe50:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe51:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe52:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe53:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe54:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe55:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe56:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe57:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe58:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe59:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe5A:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe5B:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe5C:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe5D:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe5E:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe5F:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe60:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe61:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe62:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe63:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe64:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe65:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe66:       5  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe67:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe68:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe69:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe6A:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe6B:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe6C:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe6D:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe6E:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe6F:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe70:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe71:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe72:       0  EN     enabled      unmasked
/sys/firmware/acpi/interrupts/gpe73:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe74:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe75:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe76:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe77:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe78:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe79:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe7A:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe7B:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe7C:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe7D:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe7E:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe7F:       0         invalid      unmasked
/sys/firmware/acpi/interrupts/gpe_all:       5
/sys/firmware/acpi/interrupts/sci:       5
/sys/firmware/acpi/interrupts/sci_not:       0

dmesg的输出:

 sudo dmesg | grep -i acpi 
[    0.006777] ACPI: SSDT 0x0000000079B96000 002592 (v01 HPQOEM 85FB     00001000 ACPI 00040000)
[    0.006779] ACPI: UEFI 0x0000000079B95000 00063A (v01 HPQOEM 85FB     00000000 HP   00040000)
[    0.006781] ACPI: UEFI 0x0000000079B94000 00005C (v01 HPQOEM 85FB     00000000 HP   00040000)
[    0.006783] ACPI: SSDT 0x0000000079B93000 000161 (v02 HPQOEM 85FB     00001000 ACPI 00040000)
[    0.006785] ACPI: FPDT 0x0000000079B92000 000044 (v01 HPQOEM 85FB     00000002 HP   00040000)
[    0.006787] ACPI: BGRT 0x0000000079B91000 000038 (v01 HPQOEM 85FB     00000001 HP   00040000)
[    0.006789] ACPI: Reserving FACP table memory at [mem 0x79be1000-0x79be110b]
[    0.006790] ACPI: Reserving DSDT table memory at [mem 0x79b9c000-0x79bdd203]
[    0.006790] ACPI: Reserving FACS table memory at [mem 0x79ab9000-0x79ab903f]
[    0.006791] ACPI: Reserving UEFI table memory at [mem 0x79c0c000-0x79c0c235]
[    0.006792] ACPI: Reserving SSDT table memory at [mem 0x79c08000-0x79c0b1c5]
[    0.006792] ACPI: Reserving SSDT table memory at [mem 0x79c05000-0x79c07743]
[    0.006793] ACPI: Reserving SSDT table memory at [mem 0x79c03000-0x79c04b5e]
[    0.006793] ACPI: Reserving SSDT table memory at [mem 0x79c02000-0x79c020f4]
[    0.006794] ACPI: Reserving UEFI table memory at [mem 0x79c01000-0x79c01041]
[    0.006794] ACPI: Reserving IHIS table memory at [mem 0x79c00000-0x79c00037]
[    0.006795] ACPI: Reserving SSDT table memory at [mem 0x79bff000-0x79bff459]
[    0.006795] ACPI: Reserving SSDT table memory at [mem 0x79bfe000-0x79bfe045]
[    0.006796] ACPI: Reserving TPM2 table memory at [mem 0x79bfd000-0x79bfd033]
[    0.006797] ACPI: Reserving SSDT table memory at [mem 0x79bfc000-0x79bfc168]
[    0.006797] ACPI: Reserving SSDT table memory at [mem 0x79bf4000-0x79bfb10f]
[    0.006798] ACPI: Reserving MSDM table memory at [mem 0x79bf3000-0x79bf3054]
[    0.006798] ACPI: Reserving SSDT table memory at [mem 0x79bee000-0x79bf20ff]
[    0.006799] ACPI: Reserving LPIT table memory at [mem 0x79bed000-0x79bed093]
[    0.006799] ACPI: Reserving WSMT table memory at [mem 0x79bec000-0x79bec027]
[    0.006800] ACPI: Reserving SSDT table memory at [mem 0x79beb000-0x79bebc2e]
[    0.006801] ACPI: Reserving SSDT table memory at [mem 0x79be9000-0x79bea49e]
[    0.006801] ACPI: Reserving DBGP table memory at [mem 0x79be8000-0x79be8033]
[    0.006802] ACPI: Reserving DBG2 table memory at [mem 0x79be6000-0x79be6053]
[    0.006802] ACPI: Reserving SSDT table memory at [mem 0x79be4000-0x79be59ca]
[    0.006803] ACPI: Reserving ASF! table memory at [mem 0x79be3000-0x79be30a4]
[    0.006804] ACPI: Reserving ECDT table memory at [mem 0x79be2000-0x79be2068]
[    0.006804] ACPI: Reserving HPET table memory at [mem 0x79be0000-0x79be0037]
[    0.006805] ACPI: Reserving APIC table memory at [mem 0x79bdf000-0x79bdf12b]
[    0.006805] ACPI: Reserving MCFG table memory at [mem 0x79bde000-0x79bde03b]
[    0.006806] ACPI: Reserving SSDT table memory at [mem 0x79b9b000-0x79b9b189]
[    0.006807] ACPI: Reserving SSDT table memory at [mem 0x79b9a000-0x79b9af3d]
[    0.006807] ACPI: Reserving DMAR table memory at [mem 0x79b99000-0x79b990a7]
[    0.006808] ACPI: Reserving SSDT table memory at [mem 0x79b96000-0x79b98591]
[    0.006808] ACPI: Reserving UEFI table memory at [mem 0x79b95000-0x79b95639]
[    0.006809] ACPI: Reserving UEFI table memory at [mem 0x79b94000-0x79b9405b]
[    0.006810] ACPI: Reserving SSDT table memory at [mem 0x79b93000-0x79b93160]
[    0.006810] ACPI: Reserving FPDT table memory at [mem 0x79b92000-0x79b92043]
[    0.006811] ACPI: Reserving BGRT table memory at [mem 0x79b91000-0x79b91037]
[    0.027895] ACPI: PM-Timer IO Port: 0x1808
[    0.027901] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
[    0.027902] ACPI: LAPIC_NMI (acpi_id[0x02] high edge lint[0x1])
[    0.027903] ACPI: LAPIC_NMI (acpi_id[0x03] high edge lint[0x1])
[    0.027903] ACPI: LAPIC_NMI (acpi_id[0x04] high edge lint[0x1])
[    0.027904] ACPI: LAPIC_NMI (acpi_id[0x05] high edge lint[0x1])
[    0.027904] ACPI: LAPIC_NMI (acpi_id[0x06] high edge lint[0x1])
[    0.027904] ACPI: LAPIC_NMI (acpi_id[0x07] high edge lint[0x1])
[    0.027905] ACPI: LAPIC_NMI (acpi_id[0x08] high edge lint[0x1])
[    0.027905] ACPI: LAPIC_NMI (acpi_id[0x09] high edge lint[0x1])
[    0.027906] ACPI: LAPIC_NMI (acpi_id[0x0a] high edge lint[0x1])
[    0.027906] ACPI: LAPIC_NMI (acpi_id[0x0b] high edge lint[0x1])
[    0.027907] ACPI: LAPIC_NMI (acpi_id[0x0c] high edge lint[0x1])
[    0.027907] ACPI: LAPIC_NMI (acpi_id[0x0d] high edge lint[0x1])
[    0.027908] ACPI: LAPIC_NMI (acpi_id[0x0e] high edge lint[0x1])
[    0.027908] ACPI: LAPIC_NMI (acpi_id[0x0f] high edge lint[0x1])
[    0.027909] ACPI: LAPIC_NMI (acpi_id[0x10] high edge lint[0x1])
[    0.027969] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.027970] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.027973] ACPI: Using ACPI (MADT) for SMP configuration information
[    0.027975] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.076027] ACPI: Core revision 20220331
[    0.102670] ACPI: PM: Registering ACPI NVS region [mem 0x78eae000-0x79b3dfff] (13172736 bytes)
[    0.103121] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
[    0.103121] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.110946] ACPI: Added _OSI(Module Device)
[    0.110946] ACPI: Added _OSI(Processor Device)
[    0.110946] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.110946] ACPI: Added _OSI(Processor Aggregator Device)
[    0.165919] ACPI: 17 ACPI AML tables successfully acquired and loaded
[    0.167721] ACPI: EC: EC started
[    0.167722] ACPI: EC: interrupt blocked
[    0.169501] ACPI: EC: EC_CMD/EC_SC=0x66, EC_DATA=0x62
[    0.169503] ACPI: EC: Boot ECDT EC used to handle transactions
[    0.177360] ACPI: Dynamic OEM Table Load:
[    0.177371] ACPI: SSDT 0xFFFF95E580F8F000 0000F4 (v02 PmRef  Cpu0Psd  00003000 INTL 20160422)
[    0.178662] ACPI: \_SB_.PR00: _OSC native thermal LVT Acked
[    0.182281] ACPI: Dynamic OEM Table Load:
[    0.182288] ACPI: SSDT 0xFFFF95E580FD0000 000400 (v02 PmRef  Cpu0Cst  00003001 INTL 20160422)
[    0.183713] ACPI: Dynamic OEM Table Load:
[    0.183719] ACPI: SSDT 0xFFFF95E580FF6800 000581 (v02 PmRef  Cpu0Ist  00003000 INTL 20160422)
[    0.185227] ACPI: Dynamic OEM Table Load:
[    0.185233] ACPI: SSDT 0xFFFF95E5812F4C00 000149 (v02 PmRef  Cpu0Hwp  00003000 INTL 20160422)
[    0.186566] ACPI: Dynamic OEM Table Load:
[    0.186573] ACPI: SSDT 0xFFFF95E580FF0000 000724 (v02 PmRef  HwpLvt   00003000 INTL 20160422)
[    0.188190] ACPI: Dynamic OEM Table Load:
[    0.188196] ACPI: SSDT 0xFFFF95E580FF3800 0005FC (v02 PmRef  ApIst    00003000 INTL 20160422)
[    0.189705] ACPI: Dynamic OEM Table Load:
[    0.189711] ACPI: SSDT 0xFFFF95E580FD6800 000317 (v02 PmRef  ApHwp    00003000 INTL 20160422)
[    0.191249] ACPI: Dynamic OEM Table Load:
[    0.191255] ACPI: SSDT 0xFFFF95E580FEA000 000AB0 (v02 PmRef  ApPsd    00003000 INTL 20160422)
[    0.193396] ACPI: Dynamic OEM Table Load:
[    0.193402] ACPI: SSDT 0xFFFF95E580FD6400 00030A (v02 PmRef  ApCst    00003000 INTL 20160422)
[    0.201713] ACPI: Interpreter enabled
[    0.201753] ACPI: PM: (supports S0 S3 S4 S5)
[    0.201753] ACPI: Using IOAPIC for interrupt routing
[    0.201784] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.204946] ACPI: Enabled 10 GPEs in block 00 to 7F
[    0.205666] ACPI: PM: Power Resource [PG00]
[    0.232330] ACPI: PM: Power Resource [USBC]
[    0.243386] ACPI: PM: Power Resource [V0PR]
[    0.243588] ACPI: PM: Power Resource [V1PR]
[    0.243787] ACPI: PM: Power Resource [V2PR]
[    0.251011] ACPI: PM: Power Resource [WRST]
[    0.251291] acpi ABCD0000:00: ACPI dock station (docks/bays count: 1)
[    0.254430] ACPI: PM: Power Resource [FN00]
[    0.254509] ACPI: PM: Power Resource [FN01]
[    0.254586] ACPI: PM: Power Resource [FN02]
[    0.254661] ACPI: PM: Power Resource [FN03]
[    0.254736] ACPI: PM: Power Resource [FN04]
[    0.255369] ACPI: PM: Power Resource [PIN]
[    0.255797] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-fe])
[    0.255803] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]
[    0.259307] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug SHPCHotplug PME AER PCIeCapability LTR DPC]
[    0.259309] acpi PNP0A08:00: FADT indicates ASPM is unsupported, using BIOS configuration
[    0.291353] ACPI: EC: interrupt unblocked
[    0.291354] ACPI: EC: event unblocked
[    0.291382] ACPI: EC: EC_CMD/EC_SC=0x66, EC_DATA=0x62
[    0.291383] ACPI: EC: GPE=0x17
[    0.291384] ACPI: \_SB_.PCI0.LPCB.EC0_: Boot ECDT EC initialization complete
[    0.291386] ACPI: \_SB_.PCI0.LPCB.EC0_: EC: Used to handle transactions and events
[    0.291434] ACPI: bus type USB registered
[    0.293334] PCI: Using ACPI for IRQ routing
[    0.382757] pnp: PnP ACPI init
[    0.385259] pnp: PnP ACPI: found 8 devices
[    0.390547] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[    0.453882] ACPI: AC: AC Adapter [ACAD] (on-line)
[    0.453950] ACPI: button: Lid Switch [LID0]
[    0.455236] ACPI: button: Power Button [PWRB]
[    0.458558] ACPI: button: Power Button [PWRF]
[    0.461937] ACPI: thermal: [Firmware Bug]: Invalid critical threshold (0)
[    0.462124] ACPI: thermal: Thermal Zone [TZ00] (28 C)
[    0.462273] ACPI: thermal: Thermal Zone [TZ01] (30 C)
[    0.462333] ACPI: thermal: Thermal Zone [TZ02] (10 C)
[    0.463102] ACPI: battery: Slot [BAT1] (battery present)
[    0.463959] hpet_acpi_add: no address or irqs in _CRS
[    0.471561] ACPI: bus type drm_connector registered
[    0.798412] ata1.00: ACPI cmd f5/00:00:00:00:00:00(SECURITY FREEZE LOCK) filtered out
[    0.808158] ata1.00: ACPI cmd f5/00:00:00:00:00:00(SECURITY FREEZE LOCK) filtered out
[    1.370490] ACPI: video: [Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS
[    1.370502] ACPI: video: Video Device [PEGP] (multi-head: yes  rom: no  post: no)
[    1.372156] ACPI: video: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[    9.290646] ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20220331/nsarguments-61)

最近编辑记录 cybird (2023-02-14 18:19:15)

离线

#2 2023-02-14 14:04:16

Watermelon.Rei
会员
注册时间: 2021-12-29
帖子: 114

Re: 在插拔电源时内核不发送任何事件,电池电量变化时也不发送任何事件。

ACPI认到电池了

[    0.463102] ACPI: battery: Slot [BAT1] (battery present)

如果安装了upower包的话跑一下这个

upower -i /org/freedesktop/UPower/devices/battery_BAT1 

离线

#3 2023-02-14 15:37:22

cybird
会员
注册时间: 2023-02-14
帖子: 16

Re: 在插拔电源时内核不发送任何事件,电池电量变化时也不发送任何事件。

Watermelon.Rei 说:

ACPI认到电池了

[    0.463102] ACPI: battery: Slot [BAT1] (battery present)

如果安装了upower包的话跑一下这个

upower -i /org/freedesktop/UPower/devices/battery_BAT1 

感谢您的回复。
我按照您的提示使用了upower, 以下是它的输出,看起来是正常的。

 native-path:          BAT1
  vendor:               Hewlett-Packard
  model:                PABAS0241231
  serial:               41167
  power supply:         yes
  updated:              Tue 14 Feb 2023 03:24:13 PM CST (0 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               fully-charged
    warning-level:       none
    energy:              37.14 Wh
    energy-empty:        0 Wh
    energy-full:         37.14 Wh
    energy-full-design:  52.5 Wh
    energy-rate:         0 W
    voltage:             12.703 V
    charge-cycles:       N/A
    percentage:          100%
    capacity:            70.7429%
    technology:          lithium-ion
    icon-name:          'battery-full-charged-symbolic'
  History (charge):
    1676359453	100.000	fully-charged

正如您所说,我的电池能够被识别出来,AC也同样能够被识别出来,在插拔电源后运行

 udevadm info --attribute-walk --path=/sys/class/power_supply/ACAD 

时,也能够看到

ATTR{online}
POWER_SUPPLY_ONLINE

的改变,但在使用 udevadm monitor 时,却不会随着电源拔出输出任何信息,udev规则也不被触发,我想知道这是期望的行为还是一个bug,直觉上这不正常。
忘记贴udev规则了:

SUBSYSTEM=="power_supply", ACTION=="change" \
ATTR{online}=="0",\
IMPORT{program}="/usr/bin/xpub", \
RUN+="/usr/bin/touch /home/exemple/testudev"

离线

#4 2023-02-14 17:11:00

Watermelon.Rei
会员
注册时间: 2021-12-29
帖子: 114

Re: 在插拔电源时内核不发送任何事件,电池电量变化时也不发送任何事件。

我用你给的规则测试了我自己的本子,拔掉AC后能够生成文件。你的规则好像少了个逗号

SUBSYSTEM=="power_supply", ACTION=="change", \

但是我运行udevadm monitor后改变电源状态确实能够看到输出,我现在不确定是udev出现了问题还是你遇到了奇怪的状况
另外没有安装xpub,去除了IMPORT部分

最近编辑记录 Watermelon.Rei (2023-02-14 17:20:11)

离线

#5 2023-02-14 18:04:16

cybird
会员
注册时间: 2023-02-14
帖子: 16

Re: 在插拔电源时内核不发送任何事件,电池电量变化时也不发送任何事件。

规则里确实少了一个逗号,我在修改了之后使用udevadm tes测试了一遍,没有错误和警告出现。但规则仍不被触发,monitor 也仍没有输出。
难道是一个内核bug((
我在 https://bugzilla.kernel.org/show_bug.cgi?id=54621/ 看到了相似的问题,笔记本型号同样是惠普,我不清楚是不是同一个bug,而且看起来它应该已经被解决了

离线

页脚