Re: [PATCH] net: usb: ax88179_178a: avoid failed operations when device is disconnected

From: Jose Ignacio Tornos Martinez
Date: Thu Nov 30 2023 - 03:42:22 EST


Hi Oliver,

> I am sorry, but this is a layering violation. You are looking
> at an internal state of the USB layer to surpress logging
> -ENODEV. If you think these messages should go away, filter
> for ENODEV where they are generated.
Thank you for your comments and suggestion.
My intention was also to avoid unnecessary and failed operations
if disconnection was detected.
Ok, let me research more and do better.

Hi Alan,

> In addition, you should be more careful about the distinction between
> "unbound" and "disconnected". It's possible for the driver to be
> unbound from the device even while the device is still plugged in. In
> this situation, submitting URBs will fail with an error even though the
> device state isn't USB_STATE_NOTATTACHED.
Thank you for you comments.
I also tested "unbound" and stop and unbind operations were correctly
executed. I just wanted to avoid the issues during disconnection, if other
operations are commanded later I think it is better to warn.
Ok, I will try to do better.

Best regards
Jose Ignacio