lkml.org 
[lkml]   [2024]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/3] HID: i2c-hid: Rely on HID descriptor fetch to probe
From
On 4/24/24 7:00 PM, Doug Anderson wrote:
> I worry a little bit about keying just off of -EREMOTEIO. If I'm
> skimming the code properly it's up to the different i2c bus controller
> to decide which error code to return here. Looking at, for instance,
> "i2c-qcom-geni.c", I see:
>
> [NACK] = {-ENXIO, "NACK: slv unresponsive, check its power/reset-ln"},


Hmm, good point. I decided to go through the drivers and check their
behavior on NACK, and based on my quick glance I found (insert accuracy
disclaimer):

- 52 drivers emitting ENXIO
- 14 drivers emitting EREMOTEIO
- 11 driver emitting EIO
- 5 drivers emitting ETIMEDOUT
- 1 driver emitting EAGAIN
- 1 driver emitting I2C_ERR_BERR (???)

So just EREMOTEIO is definitely not good enough. Looking at the drivers,
it seems like the majority of drivers emitting generic error codes could
just as well emit ENXIO on NACK. Room for improvement.

> Maybe we should just use dev_dbg() in all cases here when we fail to
> fetch the descriptor? ...otherwise I think some boards will start
> getting a noisy error message.

I'm okay with that. I don't like hiding a useful error message, but the
smbus probe would also have hidden bus errors.

I'll send a v3 with just dev_dbg, then if I (or someone else) end up
aligning more i2c drivers on their NACK error we can go to the stricter
check and incentivize the drivers to give meaningful error values...


\
 
 \ /
  Last update: 2024-05-27 18:04    [W:0.067 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site