From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7CB1C00144 for ; Fri, 29 Jul 2022 10:49:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235712AbiG2KtQ (ORCPT ); Fri, 29 Jul 2022 06:49:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234819AbiG2KtP (ORCPT ); Fri, 29 Jul 2022 06:49:15 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C93E1B52 for ; Fri, 29 Jul 2022 03:49:13 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7C56B336A6; Fri, 29 Jul 2022 10:49:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1659091752; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=w0AuRT6j+BAd+ktXQDocMPYxjDry5eY2VMp8bMGBxHs=; b=t2bCkVDG3izr7VMXxsl9xZ3iKjnzk5zDLLNp8GDLcOWAVqwyUnStNZ+/szncRPulxOeoi9 1H5vlb9bp02c/Aw/5kXheaOGJtUf7vEcvmRmaBiI6QOEHuooOjavp2AMNVkMBi7quNLgMD 65DD+H1wYnKyMM528DXZV6sCZV5S9Kc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1659091752; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=w0AuRT6j+BAd+ktXQDocMPYxjDry5eY2VMp8bMGBxHs=; b=aR1kLDws8Bx/MPc9BAwMgQ0JAwlQ3KmMfbw67LXLmrSV6/PeIC67wK4tTr2s4ZBL4idoyA sMl1Tv6Z5+nweUDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2B16013A8E; Fri, 29 Jul 2022 10:49:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0gw4CSi742LYBwAAMHmgww (envelope-from ); Fri, 29 Jul 2022 10:49:12 +0000 Date: Fri, 29 Jul 2022 12:49:11 +0200 Message-ID: <87sfmkp520.wl-tiwai@suse.de> From: Takashi Iwai To: Venkata Prasad Potturu Cc: Mark Brown , 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 , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Yang Yingliang , Nathan Chancellor , Charles Keepax , open list Subject: Re: [PATCH v3] ASoC: amd: acp: Initialize list to store acp_stream during pcm_open In-Reply-To: <3d351235-c11a-234d-7722-447b4f0442e7@amd.com> References: <20220728124057.54259-1-venkataprasad.potturu@amd.com> <3d351235-c11a-234d-7722-447b4f0442e7@amd.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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