Re: [PATCH 01/10] i2c: add suspended flag and accessors for i2c adapters

Peter Rosin
2018-12-21T18:40:08Z

On 2018-12-21 15:50, Wolfram Sang wrote:
>
>>>> I think this might be as simple as adding:
>>>>
>>>> if (WARN_ON(adap->dev.parent->power.is_suspended))
>>>> return -ESHUTDOWN;
>
> Peter, I think this should work for muxes, too, or? The i2c_transfer()
> call to the mux will not be rejected, but it will be later when we reach
> the root adapter. And then the error code will be pushed down the tree
> until we arrive at the mux again. So, the rejection will not happen at
> the earliest time, but it will happen. Is my understanding correct?

Yes, I agree with that analysis. All mux actions eventually end up with
an __i2c_transfer() call on the relevant root adapter. Hmm, but not *all*
calls. How about SMBus adapters? Should there not be a similar WARN_ON
in __i2c_smbus_xfer?

But maybe that's not applicable for some reason? Just asking...

Cheers,
Peter