Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5762768pxu; Thu, 22 Oct 2020 10:21:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzaY7d0PNQNkr5e8vv3zUKP9zlQIQHccaBUuSQhn0c+qxGjeb59I3a1iPblU2QpYxuJf84 X-Received: by 2002:a17:906:1a57:: with SMTP id j23mr3329355ejf.291.1603387313497; Thu, 22 Oct 2020 10:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603387313; cv=none; d=google.com; s=arc-20160816; b=N9CrPUbfXAR7fqIpM4PzcKss8q1Z3CVva/v2tkafR0VDZVHdisoen93b/AzS7Cbhjo ue44ucFZ/ofG2lO3Af/avLdC06G+gLyuha7cmMKNLOhUsd4ZjB3f605igzvMb8aWQ10I KmPheMRNxpCLR1BM+qlk+HrFiK1gU/NH2+pOJCWC78A814NGMbAlxm+1or2iq5oH5ZbT m0zOnTOTmWw83kKBOoaEXgfegKUnJkK1hakKcu0KPWt0TfxDXHAZs/ca1mNAiycBmTl3 l9ZalfTjCMXVUO5t5Xi4d7P8/jaIRnEX7wpP6fOSVRxCCKWn8nAX/dR4REztryWxNAcE ZGYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=WpxzM5T2oXZM9uNlrwwMMJYM97B01sisUMLV0IHjh+4=; b=n0efwLuWhBxLVPZJIKI36O1EgGxsZdklY6ePR5izjH2zS+0z5YsQtM5RrR6Joy6w+n qKqft8+4IpBzb/A1aYCX5Yr/WqH4+awE0W1jFI+KR0dIvUfuedi0FzyHYWPjZKax/oCh JLUoFwyxmv+Dfw4yGLsbQeXsz3wAnDzCctMm6E/eW0VS2vvphJ3910x28AFwSpq1pIDS Nd0jF5HYPVHX/9fKTGX/kz+dj6V2Jof3BgawFnBNkP1Huk5lZW5UAW7w6yRxq0EU4uKc cK2ez9cmtTtDTMeHAUwEtTsmqdqnaN9Hy9eAd/ySXpCjvWgZnkQoEeqe6KfBcqyDsmR9 HzwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b="HtZWIK/f"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Gm57Q85H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si1317779edz.165.2020.10.22.10.21.31; Thu, 22 Oct 2020 10:21:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b="HtZWIK/f"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Gm57Q85H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2894822AbgJVNYQ (ORCPT + 99 others); Thu, 22 Oct 2020 09:24:16 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:44745 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2894375AbgJVNYP (ORCPT ); Thu, 22 Oct 2020 09:24:15 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id CD7C85C008D; Thu, 22 Oct 2020 09:24:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 22 Oct 2020 09:24:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=WpxzM5T2oXZM9uNlrwwMMJYM97B 01sisUMLV0IHjh+4=; b=HtZWIK/fLwEU3KnyBhFBfIhUhQ4LHqKu5DWhaZwuXHl +9XGi6p9jxOTbkz6BvsuCH1oiu8BdCKAl0aLc7aRmLgcfZTb28KbC4vZ0MpstX+Q 9pmC4QUHFpNvcsjINx0s1R0GwCIEOAZlEgNneyunX+rjCc+BhSnbaGohSqU/+MVD ookqZ7AaAYTxZuEpKXHAaeg/tcXH7l5grhKxdeWQfnOyNNI3HITpnI8DBByloWv5 v/sVYjy+2Qs/G5b/Ig7Y3Oino/NO4r3C8D7Bl9oWn/E+dSrZUiudch7Y//FPM7Bm +OjBUPDeC6deak9oVI3l4ed0E9WVpXo+QRNRCzvAPew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=WpxzM5 T2oXZM9uNlrwwMMJYM97B01sisUMLV0IHjh+4=; b=Gm57Q85Hwi4xddGi9Qavhj CT/IfjHXHVayE5b+BdSwv3OaI8Xl1QNVUouXZb50qiNbMkD62CUFU1iguDqcejqz kBi60h+B+qjb7GMW2+IGRvsiaVUAe6Tt1Zvlci2bestIoZE/4wGA4dj2KVtr8ZJE lpb6B9AyyVABSdDE8VexUiE1U0VviuivCWzlWoAKDk2sdwSQRmwCklKvCpS9//GI L6yCIE1bCTjuyV58NgF74/LaCXL5gsdPXXmvHjV8beU0j2rxJJJ/WPlrGbeeciCL WFz9MEQNSAOAu3A8vKWkFfFXyrVl3wE6FJXnGw6O6FlhPAaYsLlE7FbbjOE9YaAg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrjeejgdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeelkeeghefhuddtleejgfeljeffheffgfeijefhgfeufefhtdevteegheeiheeg udenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 7C1C23280060; Thu, 22 Oct 2020 09:24:13 -0400 (EDT) Date: Thu, 22 Oct 2020 15:24:12 +0200 From: Maxime Ripard To: Takashi Iwai Cc: Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Dom Cobley , Dave Stevenson , Nicolas Saenz Julienne Subject: Re: Context expectations in ALSA Message-ID: <20201022132412.vntap4kfb2aj24qy@gilmour.lan> References: <20201022095041.44jytaelnlako54w@gilmour.lan> <30226f94-72e9-34d2-17d0-11d2501053f0@perex.cz> <20201022125741.xxibhwgcr2mhxehe@gilmour.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rwqqljnlxayusdb4" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --rwqqljnlxayusdb4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Takashi, On Thu, Oct 22, 2020 at 03:20:49PM +0200, Takashi Iwai wrote: > On Thu, 22 Oct 2020 14:57:41 +0200, > Maxime Ripard wrote: > >=20 > > On Thu, Oct 22, 2020 at 12:03:19PM +0200, Jaroslav Kysela wrote: > > > Dne 22. 10. 20 v 11:50 Maxime Ripard napsal(a): > > >=20 > > > > So, I'm not really sure what I'm supposed to do here. The drivers > > > > involved don't appear to be doing anything extraordinary, but the i= ssues > > > > lockdep report are definitely valid too. What are the expectations = in > > > > terms of context from ALSA when running the callbacks, and how can = we > > > > fix it? > > >=20 > > > I think that you should set the non-atomic flag and wake up the workq= ueue or > > > so from interrupt handler in this case. Call snd_pcm_period_elapsed()= from the > > > workqueue not the interrupt handler context. > >=20 > > Yeah, that was my first guess too. However, the DMA driver uses some > > kind of generic helpers using a tasklet, so getting rid of it would take > > some work and would very likely not be eligible for stable. >=20 > Who sets the nonatomic flag for vc4? I couldn't find the relevant > code in the latest upstream. Sorry if this wasn't clear enough, it's not there at the moment, ALSA takes a spinlock and lockdep complains that we're sleeping in an atomic context. I tried to add the nonatomic flag in my tree to see if it was fixing the issue, but ran into another lockdep complain now with ALSA taking a mutex in a tasklet. > Ideally dmaengine PCM helper should support the nonatomic mode, but > until then, the other side needs to drop the nonatomic flag, I > suppose. In this case, I'm not sure the blame is in the PCM helper but if there's any blame, I guess it's the virt-chan layer inside dmaengine (so for providers) that use a tasklet instead of something that allows sleeping Maxime --rwqqljnlxayusdb4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX5GH/AAKCRDj7w1vZxhR xepDAP96aJ4MTdcE8LJZ10+kDyzH1UtQlV//DYZWfptlugY+vgEA2+KK5p2ApO4B kDALlv1Yd5PHZH7QHStcrelNXI69ygs= =e2G2 -----END PGP SIGNATURE----- --rwqqljnlxayusdb4--