[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f9e56af4-3474-91d0-aa43-eb1a582a8074@axentia.se>
Date: Sat, 7 Sep 2024 11:16:12 +0200
From: Peter Rosin <peda@...ntia.se>
To: Thomas Richard <thomas.richard@...tlin.com>
Cc: linux-kernel@...r.kernel.org, gregory.clement@...tlin.com,
theo.lebrun@...tlin.com, thomas.petazzoni@...tlin.com, u-kumar1@...com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 1/2] mux: add mux_chip_resume() function
Hi!
2024-09-06 at 18:17, Thomas Richard wrote:
> On 9/5/24 10:28, Peter Rosin wrote:
>> Maybe you should simply implement resume locally in the driver itself and
>> have it reprogram the register, perhaps still based on mux->cached_state,
>> but "behind the back" of the mux core?
>
> Ok, it's seems to be the best solution for now.
> I'll send a patch.
>
> Just a small comment, I think I should not use the cached_state.
> I should implement a mux_mmio_get(), which is called during suspend, to
> get the "real" state. Then use it during resume.
> Because the cache is not coherent during is a very small period [1].
>
> What do you think ?
>
> [1]
> https://elixir.bootlin.com/linux/v6.11-rc6/source/drivers/mux/core.c#L144
If you are worried about that, then I think you need a mutex in the
driver. Or why wouldn't a mux_mmio_get() be racy as well? (since you
are not able to grab the mux->lock)
Cheers,
Peter
Powered by blists - more mailing lists