On Thu, Aug 02, 2018 at 09:38:58PM +0300, Tero Kristo wrote: > On 02/08/18 10:15, Wolfram Sang wrote: > > > > > Dealing with the new API sounds pretty cumbersome, as this would mean that > > > we need to change everything from the MFD / regmap level down to the i2c > > > platform drivers (the poweroff handler uses regmap to write to the PMIC.) I > > > > Yes, that's the problem. That's where letting the I2C core decide will > > save some hazzle. Some kind of whitelist for such transfer would be > > nice, though, to still find buggy drivers. I haven't looked into that > > yet if there is some information we can use (instead of passing yet > > another flag around). > > > > > guess we could use a shortcut from the poweroff handler to write directly to > > > the i2c bus though. > > > > It is not all about poweroff / reset. IIRC someone needed the irqless > > transfer very early, too. > > > > My personal use case would be "reset", too. There are some R-Car Gen2 > > boards which we need to reset via PMIC because of HW issues. > > > > Grygorii proposed to use shutdown handler for omap I2C to fix the issue, and > so it does. I added a simple shutdown handler to the driver which switches > all following I2C traffic to use polling mode. Inlined patch below, what do > you think of this approach? Hmm... * This is a driver specific solution, I don't see much we can move into core. Maybe the shutdown handler, but then we would still need a master_xfer_irqless callback. * It will only work for 'very late' and not for 'very early'. * Also, there is no white-listing, all transfers will be executed, so buggy drivers will go unnoticed. Or?
Attachment:
signature.asc
Description: PGP signature