From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
To: <broonie@kernel.org>, <alsa-devel@alsa-project.org>,
<syed.sabakareem@amd.com>
Cc: <Sunil-kumar.Dommati@amd.com>, <mario.limonciello@amd.com>,
<basavaraj.hiregoudar@amd.com>,
Vijendar Mukunda <Vijendar.Mukunda@amd.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Syed Saba Kareem <Syed.SabaKareem@amd.com>,
open list <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/3] ASoC: amd: ps: add mutex lock for accessing common registers
Date: Wed, 4 Jan 2023 11:24:29 +0530 [thread overview]
Message-ID: <20230104055435.321327-1-Vijendar.Mukunda@amd.com> (raw)
Add mutex lock for accessing ACP common registers across different
modules.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
sound/soc/amd/ps/acp63.h | 1 +
sound/soc/amd/ps/pci-ps.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h
index 8f024cb309c9..47854280dd4b 100644
--- a/sound/soc/amd/ps/acp63.h
+++ b/sound/soc/amd/ps/acp63.h
@@ -106,6 +106,7 @@ struct acp63_dev_data {
struct resource *res;
bool acp63_audio_mode;
struct platform_device *pdev[ACP63_DEVS];
+ struct mutex acp_lock; /* protect shared registers */
u16 pdev_mask;
u16 pdev_count;
u16 pdm_dev_index;
diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c
index 401cfd0036be..6335595ec5b9 100644
--- a/sound/soc/amd/ps/pci-ps.c
+++ b/sound/soc/amd/ps/pci-ps.c
@@ -209,7 +209,8 @@ static int create_acp63_platform_devs(struct pci_dev *pci, struct acp63_dev_data
case ACP63_PDM_DEV_MASK:
adata->pdm_dev_index = 0;
acp63_fill_platform_dev_info(&pdevinfo[0], parent, NULL, "acp_ps_pdm_dma",
- 0, adata->res, 1, NULL, 0);
+ 0, adata->res, 1, &adata->acp_lock,
+ sizeof(adata->acp_lock));
acp63_fill_platform_dev_info(&pdevinfo[1], parent, NULL, "dmic-codec",
0, NULL, 0, NULL, 0);
acp63_fill_platform_dev_info(&pdevinfo[2], parent, NULL, "acp_ps_mach",
@@ -283,6 +284,7 @@ static int snd_acp63_probe(struct pci_dev *pci,
}
pci_set_master(pci);
pci_set_drvdata(pci, adata);
+ mutex_init(&adata->acp_lock);
ret = acp63_init(adata->acp63_base, &pci->dev);
if (ret)
goto release_regions;
--
2.34.1
next reply other threads:[~2023-01-04 5:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 5:54 Vijendar Mukunda [this message]
2023-01-04 5:54 ` [PATCH 2/3] ASoC: amd: ps: use acp_lock to protect common registers in pdm driver Vijendar Mukunda
2023-01-04 5:54 ` [PATCH 3/3] ASoC: amd: ps: remove unused variable Vijendar Mukunda
2023-01-06 17:04 ` [PATCH 1/3] ASoC: amd: ps: add mutex lock for accessing common registers 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=20230104055435.321327-1-Vijendar.Mukunda@amd.com \
--to=vijendar.mukunda@amd.com \
--cc=Sunil-kumar.Dommati@amd.com \
--cc=alsa-devel@alsa-project.org \
--cc=basavaraj.hiregoudar@amd.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=perex@perex.cz \
--cc=syed.sabakareem@amd.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 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®