mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: Thomas Richard <thomas.richard@bootlin.com>,
	Peter Rosin <peda@axentia.se>
Cc: <linux-kernel@vger.kernel.org>, <gregory.clement@bootlin.com>,
	<theo.lebrun@bootlin.com>, <thomas.petazzoni@bootlin.com>,
	<u-kumar1@ti.com>
Subject: Re: [PATCH v2] mux: mmio: Add suspend and resume support
Date: Wed, 4 Dec 2024 08:52:48 -0600	[thread overview]
Message-ID: <5d0a298f-559a-466b-b13a-7c6520406bb6@ti.com> (raw)
In-Reply-To: <30397c99-936e-4abb-b214-fca6ce95c2bb@bootlin.com>

On 12/4/24 8:14 AM, Thomas Richard wrote:
> On 12/4/24 14:53, Andrew Davis wrote:
>> On 9/11/24 3:53 AM, Thomas Richard wrote:
>>> The status of each mux is read during suspend and stored in the private
>>> memory of the mux_chip.
>>> Then the state is restored during the resume.
>>>
>>> Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
>>> ---
>>> In this second version, as discussed with Peter, everything is done in
>>> the
>>> mmio-mux driver.
>>> A mux_mmio_set() function was added, and used during suspend stage to get
>>> the status of the of the muxes.
>>> This status is stored in the private memory of the mux_chip.
>>> ---
>>> Changes in v2:
>>> - Remove all modifications done in the mux subsystem
>>> - Add a mux_mmio_set()
>>> - Read the status of muxes during suspend and store in the private memory
>>>     of the mux_chip.
>>
>> Do you need this private memory? Since this is already using regmap, why
>> not use the regmap cache, then you can restore all the values on resume
>> with a simple call to regcache_sync().
> The regmap can be set without cache.
> As you inherit the regmap, you cannot assume that the cache is enabled.
> 

Fair point, we don't really know much about the underlying registers.
One thing we don't know is if they are retained during suspend, so
saving and restoring might be unneeded in some cases. Maybe that isn't
something we can solve at this point, could be something that should
be done in the regmap framework instead..

For now, the rest of this patch seems good to me,

Reviewed-by: Andrew Davis <afd@ti.com>

      reply	other threads:[~2024-12-04 14:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11  8:53 Thomas Richard
2024-10-16 13:41 ` Thomas Richard
2024-12-04 10:22 ` Thomas Richard
2024-12-04 13:53 ` Andrew Davis
2024-12-04 14:14   ` Thomas Richard
2024-12-04 14:52     ` Andrew Davis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d0a298f-559a-466b-b13a-7c6520406bb6@ti.com \
    --to=afd@ti.com \
    --cc=gregory.clement@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=theo.lebrun@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=thomas.richard@bootlin.com \
    --cc=u-kumar1@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®