All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <broonie@kernel.org>
Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org,
	david.rhodes@cirrus.com, lgirdwood@gmail.com, tiwai@suse.com
Subject: [PATCH 5/8] firmware: cs_dsp: Clear core reset for cache
Date: Wed, 5 Jan 2022 11:30:23 +0000	[thread overview]
Message-ID: <20220105113026.18955-6-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20220105113026.18955-1-ckeepax@opensource.cirrus.com>

If the Halo registers are kept in the register cache the
HALO_CORE_RESET bit will be retained as 1 after reset is triggered in
cs_dsp_halo_start_core. This will cause subsequent writes to reset
the core which is not desired. Apart from this bit the rest of the
register bits are cacheable, so for safety sake clear the bit to
ensure the cache is consistent.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 drivers/firmware/cirrus/cs_dsp.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index 5af8171d6cedf..e48108e694f8d 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -2744,10 +2744,16 @@ EXPORT_SYMBOL_GPL(cs_dsp_stop);
 
 static int cs_dsp_halo_start_core(struct cs_dsp *dsp)
 {
-	return regmap_update_bits(dsp->regmap,
-				  dsp->base + HALO_CCM_CORE_CONTROL,
-				  HALO_CORE_RESET | HALO_CORE_EN,
-				  HALO_CORE_RESET | HALO_CORE_EN);
+	int ret;
+
+	ret = regmap_update_bits(dsp->regmap, dsp->base + HALO_CCM_CORE_CONTROL,
+				 HALO_CORE_RESET | HALO_CORE_EN,
+				 HALO_CORE_RESET | HALO_CORE_EN);
+	if (ret)
+		return ret;
+
+	return regmap_update_bits(dsp->regmap, dsp->base + HALO_CCM_CORE_CONTROL,
+				  HALO_CORE_RESET, 0);
 }
 
 static void cs_dsp_halo_stop_core(struct cs_dsp *dsp)
-- 
2.11.0


  parent reply	other threads:[~2022-01-05 11:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 11:30 [PATCH 0/8] Add low power hibernation support to cs35l41 Charles Keepax
2022-01-05 11:30 ` [PATCH 1/8] ASoC: cs35l41: Add cs35l51/53 IDs Charles Keepax
2022-01-05 11:30 ` [PATCH 2/8] ASoC: cs35l41: Remove incorrect comment Charles Keepax
2022-01-05 11:30 ` [PATCH 3/8] ASoC: cs35l41: Correct DSP power down Charles Keepax
2022-01-05 11:30 ` [PATCH 4/8] ASoC: cs35l41: Correct handling of some registers in the cache Charles Keepax
2022-01-05 11:30 ` Charles Keepax [this message]
2022-01-05 11:30 ` [PATCH 6/8] ASoC: wm_adsp: Add support for "toggle" preloaders Charles Keepax
2022-01-05 11:30 ` [PATCH 7/8] ASoC: cs35l41: Update handling of test key registers Charles Keepax
2022-01-05 11:30 ` [PATCH 8/8] ASoC: cs35l41: Add support for hibernate memory retention mode Charles Keepax
2022-01-05 12:03 ` [PATCH 0/8] Add low power hibernation support to cs35l41 Takashi Iwai
2022-01-05 13:05   ` Charles Keepax
2022-01-05 14:07     ` Takashi Iwai
2022-01-05 14:23       ` Charles Keepax
2022-01-05 14:30 ` Mark Brown
2022-01-05 14:44   ` Charles Keepax
2022-01-05 16:12 ` Mark Brown

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=20220105113026.18955-6-ckeepax@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=david.rhodes@cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.cirrus.com \
    --cc=tiwai@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.