Re: I2C writes with interrupts disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 01, 2018 at 01:12:06PM +0300, Andy Shevchenko wrote:
> On Tue, Jul 31, 2018 at 12:09 PM, Wolfram Sang <wsa@xxxxxxxxxxxxx> wrote:
> >
> >> After this happens we try to shutdown the PMIC that interact over I2C.
> >> I2C writes will need I2C interrupts to be enabled but in an interrupt
> >> disabled context if shutting PMIC is the last thing in the sequence
> >> which needs I2C writes is there an already existing solution to this
> >> scenario? Any pointers would help.
> >
> > No existing solution. Long standing, known problem.
> >
> > IIRC the latest design we discussed is to add a new callback to struct
> > i2c_algorithm like 'master_xfer_irqless' and teach the I2C core when to
> > call which callback. Which might not be so super straightforward because
> > for most drivers (except PMICs probably) using I2C when interrupts are
> > disabled is a bug and we also shouldn't hide that by providing a generic
> > fallback.
> 
> Perhaps we should call it like i2c_pmic_xfer() to deliberately show
> that this is dedicated solely for PMICs?

Mark, wearing his regmap maintainer hat, would prefer to have the I2C
core figuring it out. I do understand that, otherwise you need flags and
such preserving the information across layers. I came up with the idea
of a flag I2C_M_IRQLESS but it creates the same set of "problems".

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux