Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-11 Thread Grygorii Strashko
On 05/08/2018 11:32 AM, Wolfram Sang wrote: Grygorii, thanks a lot for your input. Much appreciated! That would be great, but note: 1) only i2c_transfer() operations are locked, so if driver is doing i2c_transfer(1) i2c_transfer(2) <- suspend in the middle <- suspend in between

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-11 Thread Grygorii Strashko
On 05/08/2018 11:32 AM, Wolfram Sang wrote: Grygorii, thanks a lot for your input. Much appreciated! That would be great, but note: 1) only i2c_transfer() operations are locked, so if driver is doing i2c_transfer(1) i2c_transfer(2) <- suspend in the middle <- suspend in between

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-09 Thread Mark Brown
On Sat, May 05, 2018 at 10:32:55AM +0200, Wolfram Sang wrote: > > OTOH it does mean we might not notice things happening later than they > > should so it's not 100% clear... > What do you mean here? If someone is doing I/O later than they should currently we'll notice as they try to do

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-09 Thread Mark Brown
On Sat, May 05, 2018 at 10:32:55AM +0200, Wolfram Sang wrote: > > OTOH it does mean we might not notice things happening later than they > > should so it's not 100% clear... > What do you mean here? If someone is doing I/O later than they should currently we'll notice as they try to do

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-08 Thread Peter Rosin
On 2018-05-08 18:32, Wolfram Sang wrote: > Grygorii, > > thanks a lot for your input. Much appreciated! > >> That would be great, but note: >> 1) only i2c_transfer() operations are locked, so if driver is doing >> i2c_transfer(1) >> i2c_transfer(2) <- suspend in the middle >> <- suspend in

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-08 Thread Peter Rosin
On 2018-05-08 18:32, Wolfram Sang wrote: > Grygorii, > > thanks a lot for your input. Much appreciated! > >> That would be great, but note: >> 1) only i2c_transfer() operations are locked, so if driver is doing >> i2c_transfer(1) >> i2c_transfer(2) <- suspend in the middle >> <- suspend in

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-08 Thread Wolfram Sang
Grygorii, thanks a lot for your input. Much appreciated! > That would be great, but note: > 1) only i2c_transfer() operations are locked, so if driver is doing > i2c_transfer(1) > i2c_transfer(2) <- suspend in the middle > <- suspend in between > i2c_transfer(3) > It will not help. Will it not

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-08 Thread Wolfram Sang
Grygorii, thanks a lot for your input. Much appreciated! > That would be great, but note: > 1) only i2c_transfer() operations are locked, so if driver is doing > i2c_transfer(1) > i2c_transfer(2) <- suspend in the middle > <- suspend in between > i2c_transfer(3) > It will not help. Will it not

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-07 Thread Grygorii Strashko
On 05/04/2018 07:24 AM, Wolfram Sang wrote: > Hi Grygorii, > > thanks for stepping in. I kept thinking about better I2C core support > for such situations and the more input the better. > >> And you have to fix it (touch screen) - not your i2c driver. Otherwise, you >> can get >> situation

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-07 Thread Grygorii Strashko
On 05/04/2018 07:24 AM, Wolfram Sang wrote: > Hi Grygorii, > > thanks for stepping in. I kept thinking about better I2C core support > for such situations and the more input the better. > >> And you have to fix it (touch screen) - not your i2c driver. Otherwise, you >> can get >> situation

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-05 Thread Wolfram Sang
Hi Mark, > > And maybe this could be used here, too? Introduce this flag for very > > late/early messages. If they have it, messages are even sent in > > suspend_noirq() phase with the master_xfer_irqless() callback, otherwise > > we will have the WARNing printed out. > > It feels like it'd be

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-05 Thread Wolfram Sang
Hi Mark, > > And maybe this could be used here, too? Introduce this flag for very > > late/early messages. If they have it, messages are even sent in > > suspend_noirq() phase with the master_xfer_irqless() callback, otherwise > > we will have the WARNing printed out. > > It feels like it'd be

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-04 Thread Mark Brown
On Fri, May 04, 2018 at 02:24:47PM +0200, Wolfram Sang wrote: > To handle that, I imagined an additional adapter callback like > 'master_xfer_irqless' to be used for such special I2C messages. These > kind of special messages could be tagged with a new I2C_M_something > flag. > And maybe this

Re: I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-04 Thread Mark Brown
On Fri, May 04, 2018 at 02:24:47PM +0200, Wolfram Sang wrote: > To handle that, I imagined an additional adapter callback like > 'master_xfer_irqless' to be used for such special I2C messages. These > kind of special messages could be tagged with a new I2C_M_something > flag. > And maybe this

I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-04 Thread Wolfram Sang
Hi Grygorii, thanks for stepping in. I kept thinking about better I2C core support for such situations and the more input the better. > And you have to fix it (touch screen) - not your i2c driver. Otherwise, you > can get > situation when set of I2C transfers (executed from some >

I2C PM overhaul needed? (Re: [PATCH 1/2] i2c: sprd: Prevent i2c accesses after suspend is called)

2018-05-04 Thread Wolfram Sang
Hi Grygorii, thanks for stepping in. I kept thinking about better I2C core support for such situations and the more input the better. > And you have to fix it (touch screen) - not your i2c driver. Otherwise, you > can get > situation when set of I2C transfers (executed from some >