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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC91BC433EF for ; Mon, 25 Apr 2022 13:15:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AE6491740; Mon, 25 Apr 2022 15:14:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AE6491740 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650892531; bh=NFZGtIU3NiD6JM6D8mENFb5y8ZC2UqJWM6r+KrUBir0=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TRo7RdX3qikjluzwyI106i64l3Vammww73JwWxkzKiV+JQywpGRBhsnn68R+VLHYI VWcrqIwEZZYAJzyTT2SE3PXcq4L5+bfqpGUbJ59TEEn3Utvf8AI6bGfYFJtYBU6V/4 Vfi/alaLfZATjCPXrmYEceolL4psUzRVDduArixA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 45486F8014B; Mon, 25 Apr 2022 15:14:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 42924F8016A; Mon, 25 Apr 2022 15:14:40 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E7598F800FA for ; Mon, 25 Apr 2022 15:14:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E7598F800FA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="CMS5i+YK"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Wd/qnkK4" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 75FD31F38D; Mon, 25 Apr 2022 13:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1650892477; 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=YC7JBkWKuFPXqbASOhCH10KHexm4Q563rnMayuDiKvE=; b=CMS5i+YKuqIhcfin1iIfSBwyKdaDjS36pWLDWudes9WaG44poP4xImUjNhhNOdjRPz3hlA wa0KDmgxd2v9CFMoClXiH9ve20lm2bMlm65aOPHLB5uUMK5Wv+eGlNu+l8oUPgVjMd/++x 17B2Df2jC1Ut3sFUCKyWjF+wWMZWx4A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1650892477; 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=YC7JBkWKuFPXqbASOhCH10KHexm4Q563rnMayuDiKvE=; b=Wd/qnkK4fMdW4pj0g/mKagZpwqURJLeC2KuPpa81/fScw3je6JctikcVqqt/Hzcsq1OhQ7 x8BqkBQaqLpFWOCA== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 6F4CD2C141; Mon, 25 Apr 2022 13:14:37 +0000 (UTC) Date: Mon, 25 Apr 2022 15:14:37 +0200 Message-ID: From: Takashi Iwai To: P9ter Ujfalusi Subject: Re: [PATCH] ALSA: memalloc: Add fallback SG-buffer free if fallback is used for noncontig In-Reply-To: References: <20220425122814.751-1-peter.ujfalusi@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, 25 Apr 2022 14:49:35 +0200, P9ter Ujfalusi wrote: > > > > On 25/04/2022 15:28, Peter Ujfalusi wrote: > > From: Peter Ujfalusi > > > > If the dma_alloc_noncontiguous() fails in snd_dma_noncontig_alloc() we are > > taking a fallback path which should be taken into account on the free path > > since the way to free the two type of allocations are not the same. > > > > Fixes: 925ca893b4a6 ("ALSA: memalloc: Add fallback SG-buffer allocations for x86") > > Signed-off-by: Peter Ujfalusi > > --- > > Hi Takashi, > > > > I'm not sure about thisa as I can not get my systems to use the fallback, but in > > theory this shiuld be done, no? > > RIght, this is not needed as on the free path the callback is picked > based on the dmab->dev.type, so it should be picking the correct free > after all. > > Please this patch. Yes, the type got overwritten at switching to the fallback, so your change is superfluous. > > Since you have introduced the fallback, I believe there are cases when it is > > taken and it might be related to some strange memory allocation errors happening > > in SOF during firmware loading, like: > > https://github.com/thesofproject/linux/issues/3609 > > https://github.com/thesofproject/linux/issues/3584 > > https://github.com/thesofproject/linux/issues/3530 > > Still these reports are real and somehow they are pointing to dma > allocation issues. > > Hrm, the fallback got backported to 5.17.4, so it might have been fixed > already? Yes, it should be. Let me know if the problem still persists even after the fallback support is backported to stable kernels. thanks, Takashi