public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Cc: Mark Brown <broonie@kernel.org>,
	alsa-devel@alsa-project.org, vsujithkumar.reddy@amd.com,
	Vijendar.Mukunda@amd.com, Basavaraj.Hiregoudar@amd.com,
	Sunil-kumar.Dommati@amd.com, ssabakar@amd.com,
	Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Yang Yingliang <yangyingliang@huawei.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Charles Keepax <ckeepax@opensource.cirrus.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] ASoC: amd: acp: Initialize list to store acp_stream during pcm_open
Date: Fri, 29 Jul 2022 12:49:11 +0200	[thread overview]
Message-ID: <87sfmkp520.wl-tiwai@suse.de> (raw)
In-Reply-To: <3d351235-c11a-234d-7722-447b4f0442e7@amd.com>

On Fri, 29 Jul 2022 12:34:51 +0200,
Venkata Prasad Potturu wrote:
> 
> 
> On 7/28/22 18:19, Mark Brown wrote:
> Thanks for your time.
> 
>     On Thu, Jul 28, 2022 at 06:10:50PM +0530, Venkata Prasad Potturu wrote:
> 
>         @@ -104,14 +105,13 @@ static irqreturn_t i2s_irq_handler(int irq, void *data)
>          
>               ext_intr_stat = readl(ACP_EXTERNAL_INTR_STAT(adata, rsrc->irqp_used));
>          
>         -     for (i = 0; i < ACP_MAX_STREAM; i++) {
>         -                           stream = adata->stream[i];
>         +     spin_lock_irqsave(&adata->acp_lock, flags);
>         +     list_for_each_entry(stream, &adata->stream_list, list) {
>         
>     If we're already in an interrupt handler here (presumably not a threaded
>     one) why are we using irqsave?
>     
> Yes, your statement make sense, I have followed below statement in kernel
> document. so used irqsave in interrupt context as well.
> 
> We will change it to spin_lock() and send it in the next version.
> 
> statement:- spin_lock_irqsave() will turn off interrupts if they are on,
> otherwise does nothing (if we are already in an interrupt handler), hence
> these functions are safe to call from any context.

Also the open and close callbacks are certainly non-irq context, hence
you can use spin_lock_irq() instead of irqsave(), too.


Takashi

  parent reply	other threads:[~2022-07-29 10:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28 12:40 [PATCH v3] ASoC: amd: acp: Initialize list to store acp_stream during pcm_open Venkata Prasad Potturu
2022-07-28 12:49 ` Mark Brown
     [not found]   ` <3d351235-c11a-234d-7722-447b4f0442e7@amd.com>
2022-07-29 10:49     ` Takashi Iwai [this message]
2022-07-29 11:17       ` Venkata Prasad Potturu

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=87sfmkp520.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=AjitKumar.Pandey@amd.com \
    --cc=Basavaraj.Hiregoudar@amd.com \
    --cc=Sunil-kumar.Dommati@amd.com \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=perex@perex.cz \
    --cc=ssabakar@amd.com \
    --cc=tiwai@suse.com \
    --cc=venkataprasad.potturu@amd.com \
    --cc=vsujithkumar.reddy@amd.com \
    --cc=yangyingliang@huawei.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