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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A899C433EF for ; Fri, 15 Oct 2021 12:24:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21B3560E05 for ; Fri, 15 Oct 2021 12:24:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238783AbhJOM1E (ORCPT ); Fri, 15 Oct 2021 08:27:04 -0400 Received: from mga14.intel.com ([192.55.52.115]:28965 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231612AbhJOM1D (ORCPT ); Fri, 15 Oct 2021 08:27:03 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10137"; a="228185588" X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="228185588" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 05:24:56 -0700 X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="492523934" Received: from liminghu-mobl.ccr.corp.intel.com (HELO [10.212.23.213]) ([10.212.23.213]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 05:24:55 -0700 Subject: Re: [RFC PATCH v3 04/13] ASoC: soc-pcm: introduce snd_soc_dpcm_fe_lock_irq/unlock_irq() To: Sameer Pujar , alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, Gyeongtaek Lee , Peter Ujfalusi , Kuninori Morimoto , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , open list References: <20211013143050.244444-1-pierre-louis.bossart@linux.intel.com> <20211013143050.244444-5-pierre-louis.bossart@linux.intel.com> From: Pierre-Louis Bossart Message-ID: <6d7c8d71-d131-fd92-c1c6-e4f4380a4f77@linux.intel.com> Date: Fri, 15 Oct 2021 07:24:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/15/21 1:24 AM, Sameer Pujar wrote: > > > On 10/13/2021 8:00 PM, Pierre-Louis Bossart wrote: >> In preparation for more changes, add two new helpers to gradually >> modify the DPCM locks. >> >> Since DPCM functions are not used from interrupt handlers, we can only >> use the lock_irq case. >> >> While most of the uses of DPCM are internal to soc-pcm.c, some drivers >> in soc/fsl and soc/sh do make use of DPCM-related loops that will >> require protection, adding EXPORT_SYMBOL_GPL() is needed for those >> drivers. >> >> The stream argument is unused in this patch but will be enabled in >> follow-up patches. >> >> Signed-off-by: Pierre-Louis Bossart >> >> --- >>   include/sound/soc-dpcm.h |  3 +++ >>   sound/soc/soc-pcm.c      | 42 +++++++++++++++++++++++----------------- >>   2 files changed, 27 insertions(+), 18 deletions(-) > > 1. Till this patch and with DEBUG_LOCKDEP config enabled, I see Did you mean "with this patch included", yes? > following warning: >    "WARNING: CPU: 0 PID: 0 at kernel/locking/irqflag-debug.c:10 > warn_bogus_irq_restore+0x30/0x40" > >    However test passed though. Interestingly it was seen only for the > first time I ran a 2x1 mixer test. > > 2. Also after I load sound modules and card gets registered, I see some > hw_param() calls for FE and BE. This seems harmless at this point, but > is getting problematic with subsequent patches. This was not happening > earier. This patch doesn't change any of the flow, it just adds a wrapper in preparation for the transition to the FE pcm lock. The only change is that we use spin_lock_irq instead of the irqsave/restore version, but that was also Takashi's recommendation. the test results would suggest that on Tegra DPCM functions are used from an interrupt context?