Re: [PATCH] usb: core: Add error handling in usb_reset_device for autoresume failure
From: Oliver Neukum
Date: Thu Feb 20 2025 - 05:23:00 EST
On 20.02.25 10:52, Wentao Liang wrote:
In usb_reset_device(), the function continues execution and
calls usb_autosuspend_device() after usb_autosuspend_device fails.
This can only fail if the device needs to be physically
resumed. In that case you called usb_reset_device() while
you weren't supposed to. The purpose of the call is to keep
the counter elevated in order to disable runtime power management
temporarily.
The code is older than helpers to elevate the count. The correct
fix would be to use them rather than handle an error that cannot
happen.
Regards
Oliver