Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3214241rwb; Sat, 12 Nov 2022 01:06:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf4pmH7q08tje6HJq8fTSW+MGhrDEtTQGXlOwH5oFIGg1vUQJldNeUglzsaLSTouIddXzamU X-Received: by 2002:a05:6a00:2295:b0:56b:9c04:c8df with SMTP id f21-20020a056a00229500b0056b9c04c8dfmr6192945pfe.46.1668244008363; Sat, 12 Nov 2022 01:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668244008; cv=none; d=google.com; s=arc-20160816; b=VLQ2d2dxJlhyx4bAg1bhY/pWlj9AZ51TNejT1yYw7r5TvW81XD4kCPvK43z2Y3JQd1 V/w0lZmsBSL312GjEvs8nn9ATeH4+es7I+XuKiDtU8+nO3D9pidRLU1OXAwsqvO2oLOx 3xlVUeghSl+utmsVTVq3P3V3R8AA+h9vW5ORhkNxAb8IkXJB9JQ5Wv7AdytzQnS3tOXK qxnec5BMxJNWuhm3rtdWtvXAntsrRd4VKWMu6XOO5GuUQmCvfAN6uuhXOwwisiTa087S HHe8WcCcfyteYFxKYXDaPddWJR4lTQJsiV6v/D1RyLg1R5OfU2KYpg2DmfulesSDaSBP /AIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=xMQY17H7BFjnZoOCg94vz2f65Z/QFPDjM6eSMtYUsG4=; b=aKCAnaWaVLQFmdOQsea1AC8guW72dgHSyrGyOSQVeRX7qP4Aq4W1P4QrRniRSDpqgc 3TCrBGLgq3CgRDxwOz8fBjKQqRfeCjrmJjtUmeITUFXOWY+zqbHfrYqx4MeW8z00428E qkZTKrZuEorRO1ORQzvez1afj8bXgcLuaCDLzMtgJkELU3m2QqW15vY74q40ZgE/cRB0 U54p2gAUiSzbWWVhFshIL2NIdFBNSxiLOnR/eymVbhVlYVWHGGNiwRC6cOSLvDXJ1SY4 2no3LsTopBuaWcpAaDtQuEkEL3J862xuKRB/iemSb7pqUtUKMwr+MAfm/U+G5v6VCt/q AwPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=GKRHAElI; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=4PZ0XTMz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a655845000000b0046e9da89cebsi4460006pgr.532.2022.11.12.01.06.36; Sat, 12 Nov 2022 01:06:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=GKRHAElI; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=4PZ0XTMz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232427AbiKLIqu (ORCPT + 90 others); Sat, 12 Nov 2022 03:46:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230257AbiKLIqr (ORCPT ); Sat, 12 Nov 2022 03:46:47 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4644C2CE3F for ; Sat, 12 Nov 2022 00:46:45 -0800 (PST) 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 D8D4022310; Sat, 12 Nov 2022 08:46:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1668242803; 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=xMQY17H7BFjnZoOCg94vz2f65Z/QFPDjM6eSMtYUsG4=; b=GKRHAElIgeK94yqtYmWY6MjQsUfYYZ2Pqe4EqeZH40pjA34oVePTRuXJLt3uwhe1JfJDV1 /0YA998hgmw98dTzg4Yw0AMGgCLKvYtelTEhTIQ52Dgw7lzI05dI7aSicqyDK/gACjssva iykTlN5DFBBKv4j39BBVBTBeVGDCuAU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1668242803; 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=xMQY17H7BFjnZoOCg94vz2f65Z/QFPDjM6eSMtYUsG4=; b=4PZ0XTMz2JdKxATjIqvUt3u59Cu1eSKXyNLHPeUE8BFpZFN1ouYZLYShEdo+sZDbQwIjdL 4o1oSr0fGNCnlMCA== 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 B90EB13A08; Sat, 12 Nov 2022 08:46:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eiAvLHNdb2M3IAAAMHmgww (envelope-from ); Sat, 12 Nov 2022 08:46:43 +0000 Date: Sat, 12 Nov 2022 09:46:43 +0100 Message-ID: <87a64w7e6k.wl-tiwai@suse.de> From: Takashi Iwai To: Linus Torvalds Cc: Linux Kernel Mailing List Subject: Re: [GIT PULL] sound fixes for 6.1-rc5 In-Reply-To: References: <87fsepx42m.wl-tiwai@suse.de> 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 12 Nov 2022 02:28:19 +0100, Linus Torvalds wrote: > > On Fri, Nov 11, 2022 at 12:56 AM Takashi Iwai wrote: > > > > please pull sound fixes for v6.1-rc5 from: > > Hmm. I don't know that this came in through this particular pull > request, but I don't seem to have seen it before: > > Nov 11 14:32:37 xps13 kernel: > snd_hda_intel 0000:00:1f.3: Too many BDL entries: > buffer=2097152, period=65536 > > there's six of those lines in my logs (two batches of three, five > seconds apart). > > I don't see any negative side effects aside from the messages, and > sound seems to work fine, but since I don't think I've ever seen this > one before I thought I'd just mention it. > > I also haven't been using this laptop on a while - an arm64 Fedora > uboot update broke my M2 boot, so I'm temporarily back to using my > trusty old xps13. > > So while it's new to me, the issue that introduced it may not be > particularly new. > > Google does show that the message itself has been happening for others > for a long time. But I checked with 'journalctl', and it hasn't > happened on this particular machine before. > > It might be a non-kernel change that triggers it, of course. Wooh, that must be the last change in the memalloc helper for non-contiguous pages :-< Admittedly the fix was a bit premature, sorry for the mess. Below is the quick workaround. I'm going to send another PR soon later. thanks, Takashi -- 8< -- From: Takashi Iwai Subject: [PATCH] ALSA: memalloc: Try dma_alloc_noncontiguous() at first The latest fix for the non-contiguous memalloc helper changed the allocation method for a non-IOMMU system to use only the fallback allocator. This should have worked, but it caused a problem sometimes when too many non-contiguous pages are allocated that can't be treated by HD-audio controller. As a quirk workaround, go back to the original strategy: use dma_alloc_noncontiguous() at first, and apply the fallback only when it fails, but only for non-IOMMU case. We'll need a better fix in the fallback code as well, but this workaround should paper over most cases. Fixes: 9736a325137b ("ALSA: memalloc: Don't fall back for SG-buffer with IOMMU") Reported-by: Linus Torvalds Link: https://lore.kernel.org/r/CAHk-=wgSH5ubdvt76gNwa004ooZAEJL_1Q-Fyw5M2FDdqL==dg@mail.gmail.com Signed-off-by: Takashi Iwai --- sound/core/memalloc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 6a81aaab25ab..ba095558b6d1 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -542,8 +542,10 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size) struct sg_table *sgt; void *p; + sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir, + DEFAULT_GFP, 0); #ifdef CONFIG_SND_DMA_SGBUF - if (!get_dma_ops(dmab->dev.dev)) { + if (!sgt && !get_dma_ops(dmab->dev.dev)) { if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG) dmab->dev.type = SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK; else @@ -551,9 +553,6 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size) return snd_dma_sg_fallback_alloc(dmab, size); } #endif - - sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir, - DEFAULT_GFP, 0); if (!sgt) return NULL; -- 2.35.3