Re: [PATCH 2/3] HID: valve-index: Reboot headset on system power transitions
From: Michal Pecio
Date: Fri Sep 11 2026 - 14:30:11 EST
On Fri, 11 Sep 2026 10:12:34 -0500, Mario Limonciello wrote:
> On 9/11/26 04:23, Greg Kroah-Hartman wrote:
> > On Fri, Sep 11, 2026 at 11:16:52AM +0200, Michal Pecio wrote:
> >> On Fri, 11 Sep 2026 07:54:12 +0200, Greg Kroah-Hartman wrote:
> > You are creating an "odd" user/kernel api that is used for
> > debugging, that's not what sysfs is for. sysfs is to show
> > attributes that a device has NOT to cause the device to go off and
> > do some random thing (yes, there are exceptions, but generally
> > that's the rule.)
> >
> > debugfs is "do whatever you want", so that's a better place for
> > this.
> >
> > thanks,
> >
> > greg k-h
>
> I suppose an alternative path we can build to all of this reset
> handling at power state transitions and sysfs/debugfs is a callback
> system for a failed EDID read.
>
> Something like DRM drivers can send a notify to a global queue when
> an EDID read failed. Other drivers could subscribe to that notify
> and react. I guess this would only work if the USB reset sequence to
> the HMD looks like an HPD event to DRM though.
>
> Also it wouldn't be perfect. If the HMD was connected and the read
> failed on an unrelated monitor on the system the HMD would reset
> needlessly.
>
> Eh, I think I'm talking myself back into this approach the patch does
> now. I have no qualms moving the on demand knob to debugfs.
Perhaps one more option is to put this in userspace, with some libusb
or HIDRAW hacking. And if it could be scripted to run on shutdown, no
kernel driver even required at all.
Regards,
Michal