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

2018-12-21 Thread Wolfram Sang
Hi Peter, > Yes, I agree with that analysis. All mux actions eventually end up with Good! > 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? Yes, there should. Yeah, that's w

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

2018-12-21 Thread Peter Rosin
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 re

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

2018-12-21 Thread Wolfram Sang
> > > 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

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

2018-12-21 Thread Hans de Goede
Hi, On 20-12-18 22:09, Rafael J. Wysocki wrote: On Thursday, December 20, 2018 11:00:29 AM CET Hans de Goede wrote: Hi, On 19-12-18 23:33, Wolfram Sang wrote: Hi Lukas, Hans, On Wed, Dec 19, 2018 at 07:36:54PM +0100, Hans de Goede wrote: Hi, On 19-12-18 18:22, Lukas Wunner wrote: On Wed,

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

2018-12-20 Thread Rafael J. Wysocki
On Thursday, December 20, 2018 11:00:29 AM CET Hans de Goede wrote: > Hi, > > On 19-12-18 23:33, Wolfram Sang wrote: > > Hi Lukas, Hans, > > > > On Wed, Dec 19, 2018 at 07:36:54PM +0100, Hans de Goede wrote: > >> Hi, > >> > >> On 19-12-18 18:22, Lukas Wunner wrote: > >>> On Wed, Dec 19, 2018 at 0

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

2018-12-20 Thread Hans de Goede
Hi, On 19-12-18 23:33, Wolfram Sang wrote: Hi Lukas, Hans, On Wed, Dec 19, 2018 at 07:36:54PM +0100, Hans de Goede wrote: Hi, On 19-12-18 18:22, Lukas Wunner wrote: On Wed, Dec 19, 2018 at 05:48:17PM +0100, Wolfram Sang wrote: +static inline void i2c_mark_adapter_suspended(struct i2c_adapte

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

2018-12-19 Thread Wolfram Sang
Hi Lukas, Hans, On Wed, Dec 19, 2018 at 07:36:54PM +0100, Hans de Goede wrote: > Hi, > > On 19-12-18 18:22, Lukas Wunner wrote: > > On Wed, Dec 19, 2018 at 05:48:17PM +0100, Wolfram Sang wrote: > > > +static inline void i2c_mark_adapter_suspended(struct i2c_adapter *adap) > > > +{ > > > + i2c_loc

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

2018-12-19 Thread Hans de Goede
Hi, On 19-12-18 18:22, Lukas Wunner wrote: On Wed, Dec 19, 2018 at 05:48:17PM +0100, Wolfram Sang wrote: +static inline void i2c_mark_adapter_suspended(struct i2c_adapter *adap) +{ + i2c_lock_bus(adap, I2C_LOCK_ROOT_ADAPTER); + set_bit(I2C_ALF_IS_SUSPENDED, &adap->locked_flags); +

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

2018-12-19 Thread Lukas Wunner
On Wed, Dec 19, 2018 at 05:48:17PM +0100, Wolfram Sang wrote: > +static inline void i2c_mark_adapter_suspended(struct i2c_adapter *adap) > +{ > + i2c_lock_bus(adap, I2C_LOCK_ROOT_ADAPTER); > + set_bit(I2C_ALF_IS_SUSPENDED, &adap->locked_flags); > + i2c_unlock_bus(adap, I2C_LOCK_ROOT_ADA

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

2018-12-19 Thread Wolfram Sang
A few drivers open code handling of suspended adapters. It could be handled by the core, though, to ensure generic handling. This patch adds the flag and accessor functions. The usage of these helpers is optional, though. See the kerneldoc in this patch. Signed-off-by: Wolfram Sang --- drivers/i