On Thu, May 02, 2019 at 09:52:40AM +0200, Takashi Iwai wrote:
Takashi Iwai wrote:
Not to read the register while the chip is turned off, I suppose.
Actually other way round: the codec driver tries to avoid the whole register access while the chip is in BIAS_OFF state. OTOH, the jack state check is still required even in that state, so it flips the cache-only flag temporarily at reading the jack detect bit.
I guess we may remove the cache-only behavior, although this is a nice-to-have thing.
No, it should be removed - it's buggy and racy. Devices should only be going into cache only mode if they can't be physically accessed, otherwise you end up with incoherent things like this that create bugs. If the driver is actually able to access the register map, actively doing so and therefore needs to try flipping cache only mode on and off without coordinating with the rest of the device it isn't really in a cache only mode.