On 10/08/18 01:55, Grygorii Strashko wrote:
On 08/04/2018 04:00 PM, Andy Shevchenko wrote:
On Sat, Aug 4, 2018 at 2:57 AM, Grygorii Strashko
<grygorii.strashko@xxxxxx> wrote:
But ... PM operation can involve many devices :( pmic, gpio, i2c-muxes, regulators, so
such flag will just spread all over the kernel.
Another, options is to mark i2c devices in DT, but that might not go as SW specific.
Or?
Can't we use device links for that?
IIUC, Rafael specifically introduced them to alllow independednt
devices to be link in a chain from PM wise prospective.
it's not about shutdown sequence, so device links wouldn't help.
It's about making some i2c bus + set of selected i2c devices working during
very late shutdown stages (irqs disabled) and block (or warn) any other
i2c devices.
This whole deal sounds like it is getting too complicated for the
purpose. Personally I can't see any usecase where early i2c transactions
would be needed, you can't use i2c before the driver has been probed. If
you need to use i2c very early, then something seems wrong, or you
probably need to write specific support code for the case.
Also for the very late case, if shutdown handlers have been called
pretty much everything is down already and there are probably only one
or two potential users for i2c at that point. I can't see why we would
need to add complicated access restriction lists just for that purpose.
The shutdown handler switching the driver only to polling mode for very
late access seems to work just fine. I can't see how the i2c core would
be able to do the same, except by just adding a new API in place, but
drivers will still need to be changed to support the new mode.
So, what is the plan going forward?
1) Modify i2c core APIs? And modify all relevant i2c drivers to support
this?
2) Just add the shutdown handler switch to the relevant drivers? (My
RFCv2 patch)
3) Something else?
-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki