Public bug reported:

After upgrading from linux-image-6.8.0-149-generic to 6.8.0-151-generic
(noble-security), an APC Back-UPS BX750MI (USB 051d:0002, hid-
generic/usbhid, used by apcupsd via hiddev) is no longer read correctly.

Kernel log on 6.8.0-151, roughly 12 times per second (rate-limited, ~2.4
million in 56 h):

    hid-generic 0003:051D:0002.0001: Event data for report 22 was too
short (4 vs 2)

Rarely also "(4 vs 1)" for report 22, and single occurrences for report
122 "(4 vs 1)" and report 227 "(7 vs 0)".

Report 22 in the device's report descriptor contains nine 1-bit status
fields (Charging, Discharging, ACPresent, BatteryPresent,
ShutdownImminent, RemainingTimeLimitExpired, NeedReplacement, Overload,
VoltageNotRegulated) plus padding, i.e. 4 data bytes; the device sends 2
data bytes, which already contain all nine status bits (confirmed with
NUT usbhid-ups via libusb, which accepts the short report and reads all
bits correctly: Discharging=0, ACPresent=1, BatteryPresent=1). 6.8.0-149
accepted the short report (its hid.ko only has the debug message "report
%d is too short, (%d < %d)"); 6.8.0-151 contains the new warning "Event
data for report %d was too short (%d vs %d)" and apparently discards the
report.

Effect with apcupsd 3.14.14 (Ubuntu 3.14.14-3.1build2): apcupsd reads
Discharging and BatteryPresent from report 22 only. Since these values
are never updated, apcupsd permanently reports "ONLINE NOBATT" (STATFLAG
0x01000008 instead of 0x05000008), and according to the apcupsd source
(action.c, drivers/usb/usb.c) a power failure would never be detected
and no shutdown would be triggered. This makes the UPS useless for
automatic shutdown. (Not tested by pulling the plug.)

Reproduction / A-B test:
- Boot 6.8.0-151: permanently NOBATT (395 of 395 samples over 40 min), warnings 
as above.
- One-time boot into 6.8.0-149 (grub-reboot): status normal (0 of 462 samples 
NOBATT over 40 min), no warnings.
- Two earlier boots on 6.8.0-149 behaved normally as well.

Expected: Short input/feature reports from this device are accepted
(padded) as before, or a quirk exists for 051d:0002.

Workaround: boot 6.8.0-149.

Release: Ubuntu 24.04 (noble), x86_64. Kernel: 6.8.0-151-generic
(broken), 6.8.0-149-generic (works).

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "fehlerbericht-anhang.txt"
   
https://bugs.launchpad.net/bugs/2176158/+attachment/6021099/+files/fehlerbericht-anhang.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2176158

Title:
  HID: APC Back-UPS (051d:0002) report 22 rejected as "too short" since
  6.8.0-151 – apcupsd shows NOBATT, power failure not detected

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2176158/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to