Re: [PATCH] xhci: check device notification type before forwarding wake event
From: Mathias Nyman
Date: Wed Sep 30 2026 - 09:28:53 EST
On 9/29/26 14:28, xy521521@xxxxxxxxx wrote:
From: Hongyu Xie <xiehongyu1@xxxxxxxxxx>
The xHCI driver programs the Device Notification Control register to
only enable the Function Wake device notification (N1), so any Device
Notification Event TRB received is expected to be a function wake
notification. handle_device_notification() does however not check the
Notification Type field of the event (xHCI 1.2 section 6.4.2.7, DW0
bits 7:4), and forwards every device notification event as a function
wake.
A host controller that delivers an unexpected notification type (e.g.
due to broken firmware or emulation) would trigger a spurious wake
notification on the parent hub.
Parse the notification type and drop events other than Function Wake
with a warning, mirroring the slot ID validation in the same function.
DEV_NOTE_FWAKE is the DNCTRL register bit for notification type 1
(N1), while the event TRB carries the notification type value itself,
so add a separate DEV_NOTE_TYPE_FWAKE constant for the comparison.
Signed-off-by: Hongyu Xie <xiehongyu1@xxxxxxxxxx>
Added, but changed warning to a debug message
Thanks
Mathias