]> git.ipfire.org Git - thirdparty/linux.git/commit
thunderbolt: Fix a logic error in wake on connect
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 11 Apr 2025 15:14:44 +0000 (10:14 -0500)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 16 Apr 2025 12:33:45 +0000 (15:33 +0300)
commit1a760d10ded372d113a0410c42be246315bbc2ff
tree5d066e206154012bea2e40a59a612a2fc5105b55
parent4bfeea6ec1c0241a6c856ed1694a72a8cbaa8494
thunderbolt: Fix a logic error in wake on connect

commit a5cfc9d65879c ("thunderbolt: Add wake on connect/disconnect
on USB4 ports") introduced a sysfs file to control wake up policy
for a given USB4 port that defaulted to disabled.

However when testing commit 4bfeea6ec1c02 ("thunderbolt: Use wake
on connect and disconnect over suspend") I found that it was working
even without making changes to the power/wakeup file (which defaults
to disabled). This is because of a logic error doing a bitwise or
of the wake-on-connect flag with device_may_wakeup() which should
have been a logical AND.

Adjust the logic so that policy is only applied when wakeup is
actually enabled.

Fixes: a5cfc9d65879c ("thunderbolt: Add wake on connect/disconnect on USB4 ports")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/usb4.c