>> On Di, 2019-03-19 at 11:36 +0100, Johan Hovold wrote:
>> On Mon, Feb 18, 2019 at 10:17:12AM +0100, Oliver Neukum wrote:
>>> On So, 2019-02-17 at 18:59 +0100, Karoly Pados wrote:
>>>> Current GPIO code in cp210x fails to take USB autosuspend into account,
>>>> making it practically impossible to use GPIOs with autosuspend enabled
>>>> without user configuration. Fix this like for ftdi_sio in a previous patch.
>>>> Tested on a CP2102N.
>>> your patch is looking good to me, but I am afraid there are issues.
>>> How do the GPIO lines on the device interact with USB reset and system
>>> suspend?
>> 
>> What was your concern here, Oliver?
>> 
>> If you have a device resetting or losing power (for reset_resume) the
>> GPIO lines will revert to the default. But that change is not reported
>> to user space, is it?
> 
> This driver doesn't support reset_resume() so that shouldn't be an
> issue, right? We'd disconnect (deregister the gpiochip) and re-probe
> instead.
> 
>> So the original patch is correct, but there are more situations rather
>> than suspend which could trigger the problem.
> 
> This patch just added the missing auto-resume handling, but, yeah,
> there may be devices out there for which things may get out of sync if
> they lose state over suspend. I think Karoly confirmed this wasn't the
> case with cp210x.
> 

The way I tested this is very simple: I just toggled an output pin. If the 
device
would lose its state during suspend, then the pin state would return to its 
factory
default as soon the it went into suspend. Since the LED stayed stable over 
suspend
(I connected an LED), it seems these devices don't lose state. I did not, 
however,
test all device state in detail to see if every setting remained. I cannot 
vouch for
whether *all* state is retained.

Reply via email to