Re: [PATCH 0/3] HID: Apple Magic Keyboard/Trackpad battery over Bluetooth

Alec Hall <[email protected]> Mon, 3 Aug 2026 01:17:06 -0400
Newsgroups org.kernel.vger.linux-input,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Gentle ping on this series, posted three weeks ago. No rush intended -- I
am mostly checking it has not fallen through a crack, and asking whether
anything is wanted from me before it can be looked at.

Some context that has accumulated on the list since, in case it affects
how you would like to sequence things:

Jose VillaseƱor Montfort has three fixes in flight touching the same
driver and the generic battery path. I have reviewed and tested all
three on a Magic Keyboard and a Magic Trackpad 2 over both USB and
Bluetooth:

  HID: magicmouse: prevent unbounded recursion in magicmouse_raw_event()
    https://lore.kernel.org/linux-input/[email protected]/
  HID: magicmouse: avoid NULL pointer deref when there is no input device
    https://lore.kernel.org/linux-input/[email protected]/
  HID: magicmouse: do not keep a stale msc->input if no input is claimed
    https://lore.kernel.org/linux-input/[email protected]/

Patch 3/3 of this series touches the top of magicmouse_raw_event(), which
the recursion fix splits into a wrapper and an inner function. Whichever
lands first, the other is a one-hunk rebase; I have both applied together
here and can respin this series on top of his at any point -- just say
which order you would prefer, and I will send a v2 rather than leave you
to resolve it.

There is also a generic fix from him for the battery query path:

  HID: input: read battery capacity from its actual report offset
    https://lore.kernel.org/linux-input/[email protected]/

That one is complementary to this series rather than overlapping: it
corrects where hidinput_query_battery_capacity() reads the capacity from,
while this series changes which devices get a solicited fetch at all.
Worth noting it also improves the behaviour of this series -- until the
first battery report is parsed, capacity reads go through that query
path, so on my trackpad the power supply reads the flags byte for about
a minute after a Bluetooth reconnect before settling on the real value.

Happy to send a v2 with any changes you would like. Thanks for your time.

Alec