linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Curtis Vogt <curtis.vogt@gmail.com>
Cc: Michal Pecio <michal.pecio@gmail.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <bentiss@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Pierre-Loup Griffais <pgriffais@valvesoftware.com>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	"open list:USB SUBSYSTEM" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH 2/3] HID: valve-index: Reboot headset on system power transitions
Date: Mon, 14 Sep 2026 09:45:23 -0500	[thread overview]
Message-ID: <ff5e3967-e753-4ab7-b310-9a741e47815d@amd.com> (raw)
In-Reply-To: <aqVcun3-ksMgzb9z@dhoja>



On 9/12/26 09:07, Curtis Vogt wrote:
> On Thu, Sep 10, 2026 at 03:58:27PM -0500, Mario Limonciello wrote:
>>
>>
>> On 9/10/26 15:52, Michal Pecio wrote:
>>> On Thu, 10 Sep 2026 15:43:18 -0500, Mario Limonciello wrote:
>>>>>> +/*
>>>>>> + * The headset's EDID service is lost when the host disables the DisplayPort
>>>>>> + * PHY during system suspend, so it needs the reboot on the way out of
>>>>>> + * suspend.  Doing it on the way in does not work: the headset dropping off
>>>>>> + * USB is a remote-wakeup event from its hub and aborts the suspend.
>>>>>> + */
>>>>>
>>>>> The internal hub which will be quirked by the next patch, or its parent?
>>>>
>>>> It has to be the internal hub if quirking it works, no?
> 
> The parent needs to be quirked: the breakout box's own hub, 28de:2613,
> sits above Microchip USB2744 (0424:2744). Only the 28de:2613 hub ever
> registered wakeup events, and quirking it alone is enough.
> 
> I also tested the quirk using a stock kernel (7.2.3) using the kernel
> param `usbcore.quirks=28de:2613:j` which stopped the headset from waking
> the host. Without that param I found that the headset would wake the
> host when healthy but not when wedged.
> 
>>> I believe there are two separate problems here:
>>>
>>> 1. resetting the device at suspend causes instant wakeup
>>> 2. a few seconds later the system wakes up anyway
>>>
>>> 1. is solved by resetting on resume rather than suspend
>>> 2. is solved by the quirk
>>>
>>> Questions:
>>>
>>> Any chance that 2 also solves 1?
> 
> It does. With the quirk from 3/3 and the driver rebooting from the suspend
> hook instead of resume the headset reboots during suspend entry and the
> host stays asleep.
> 
>>> Would resetting on suspend be preferable, as the comment suggests?
>>> Maybe it would, if the reset can race with DP seeing empty EDID?
> 
> Yes, and the log bears out the ordering concern. With the reboot on
> suspend the headset is already back and so the EDID reads cleanly the
> first time. With the headset reboot on resume a re-enumeration occurs.
> There was no "EDID err" upon resume with either variant. We can go back to
> Mario's implementation of headset reboot on suspend.
> 
>> I do think that resetting on suspend makes a lot more sense for that exact
>> reason.  That's why my original PoC did it that way.
>>
>> That's a very good idea to see if the quirk + moving it back to suspend
>> works.
> 
> I've validated this approach works. Happy to return to it.
> 
> Diff against 2/3 moving the headset reboot back to the suspend hook:
> 
> ---8<---
>   drivers/hid/hid-valve-index.c | 19 +++++++++++--------
>   1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hid/hid-valve-index.c b/drivers/hid/hid-valve-index.c
> index 43c1142b7215..f6941dd04910 100644
> --- a/drivers/hid/hid-valve-index.c
> +++ b/drivers/hid/hid-valve-index.c
> @@ -103,14 +103,18 @@ static struct attribute *valve_index_attrs[] = {
>   ATTRIBUTE_GROUPS(valve_index);
>   
>   /*
> - * The headset's EDID service is lost when the host disables the DisplayPort
> - * PHY during system suspend, so it needs the reboot on the way out of
> - * suspend.  Doing it on the way in does not work: the headset dropping off
> - * USB is a remote-wakeup event from its hub and aborts the suspend.
> + * Disabling the DisplayPort PHY during system suspend leaves the headset
> + * unable to serve its EDID until it is rebooted, so send the reboot from
> + * the suspend hook.  The headset drops off USB about a second later; that
> + * does not abort the suspend because its breakout box hub is quirked to
> + * not be a wakeup source.  On resume the hub finds the rebooted headset on
> + * the same port and resets it in place, and the connector detection reads
> + * a fresh EDID.  Runtime autosuspend is left alone.
>    */
> -static int valve_index_resume(struct hid_device *hdev)
> +static int valve_index_suspend(struct hid_device *hdev, pm_message_t message)
>   {
> -	valve_index_reboot(hdev, false);
> +	if (!PMSG_IS_AUTO(message))
> +		valve_index_reboot(hdev, false);
>   
>   	return 0;
>   }
> @@ -130,8 +134,7 @@ MODULE_DEVICE_TABLE(hid, valve_index_devices);
>   static struct hid_driver valve_index_driver = {
>   	.name = "valve-index",
>   	.id_table = valve_index_devices,
> -	.resume = valve_index_resume,
> -	.reset_resume = valve_index_resume,
> +	.suspend = valve_index_suspend,
>   	.shutdown = valve_index_shutdown,
>   	.driver.dev_groups = valve_index_groups,
>   };

Thanks for sharing that.  If we do stick to a kernel quirk we should do 
it at suspend instead of resume.

But to this audience, Curtis had some other findings that libddcutil is 
causing part of the problem on Linux.  There is still some more 
investigation to be done why (for example is it a concurrency issue for 
a shared AUX resource?).

If there is still kernel patches to be neeed, they'll be posted in a v2.

  reply	other threads:[~2026-09-14 14:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 17:02 [PATCH 0/3] Add 'hid-valve-index' reset driver Mario Limonciello
2026-09-10 17:02 ` [PATCH 1/3] HID: Add shutdown callback for device drivers Mario Limonciello
2026-09-10 17:02 ` [PATCH 2/3] HID: valve-index: Reboot headset on system power transitions Mario Limonciello
2026-09-10 17:17   ` sashiko-bot
2026-09-10 17:21     ` Mario Limonciello
2026-09-11  4:55       ` Curtis Vogt
2026-09-10 20:04   ` Michal Pecio
2026-09-10 20:43     ` Mario Limonciello
2026-09-10 20:52       ` Michal Pecio
2026-09-10 20:58         ` Mario Limonciello
2026-09-12 14:07           ` Curtis Vogt
2026-09-14 14:45             ` Mario Limonciello [this message]
2026-09-11  4:54       ` Curtis Vogt
2026-09-11  9:08         ` Michal Pecio
2026-09-11  5:54   ` Greg Kroah-Hartman
2026-09-11  6:01     ` Mario Limonciello
2026-09-11  9:16     ` Michal Pecio
2026-09-11  9:23       ` Greg Kroah-Hartman
2026-09-11 15:12         ` Mario Limonciello
2026-09-11 18:20           ` Michal Pecio
2026-09-10 17:02 ` [PATCH 3/3] USB: quirks: Ignore remote wakeup from the Valve Index breakout box hub Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff5e3967-e753-4ab7-b310-9a741e47815d@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=bentiss@kernel.org \
    --cc=curtis.vogt@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michal.pecio@gmail.com \
    --cc=pgriffais@valvesoftware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).