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 3B0A4C433FE for ; Mon, 28 Nov 2022 13:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232093AbiK1NsA (ORCPT ); Mon, 28 Nov 2022 08:48:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232157AbiK1Nrr (ORCPT ); Mon, 28 Nov 2022 08:47:47 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 213E31E7; Mon, 28 Nov 2022 05:47: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-out2.suse.de (Postfix) with ESMTPS id C514A1F74A; Mon, 28 Nov 2022 13:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1669643263; 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=piZL6+xU26YG6MuHIbVBXc6UeZ1HPcF7+Q/hr9wWY3c=; b=kvr4zkdn0MZMjrXtMnvnFp2djNc1HeJslNef+gquz5zxgL0kb/0Icnyh+yUT5dI3LMqGvK /rpG7xO/+8lUYCueZPxcl2l2RuV3yqZDwWpNNWXU335SeKGwg6uIM+4mrhKLROhm2wkZSX Y+FKAO1jebw64i/c8f/pfGiz9IGzAmI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1669643263; 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=piZL6+xU26YG6MuHIbVBXc6UeZ1HPcF7+Q/hr9wWY3c=; b=8UJyONlu4vmzo+U1C739NQOtO7MeTzEW+amB4ueQh3WQySf9AVRpQYSbmKpiLiWOjDdqLz wLfN43U+C/p/lWBg== 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 8DAD613273; Mon, 28 Nov 2022 13:47:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id B/f7If+7hGPuEAAAMHmgww (envelope-from ); Mon, 28 Nov 2022 13:47:43 +0000 Date: Mon, 28 Nov 2022 14:47:43 +0100 Message-ID: <87mt8byyv4.wl-tiwai@suse.de> From: Takashi Iwai To: Ricardo Ribalda Cc: Kai Vehmanen , Jaroslav Kysela , Pierre-Louis Bossart , Peter Ujfalusi , Mark Brown , Daniel Baluta , Bard Liao , Takashi Iwai , Ranjani Sridharan , Liam Girdwood , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, stable@vger.kernel.org, sound-open-firmware@alsa-project.org Subject: Re: [PATCH v4] ALSA: core: Fix deadlock when shutdown a frozen userspace In-Reply-To: <20221127-snd-freeze-v4-0-51ca64b7f2ab@chromium.org> References: <20221127-snd-freeze-v4-0-51ca64b7f2ab@chromium.org> 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 Mon, 28 Nov 2022 14:42:49 +0100, Ricardo Ribalda wrote: > > During kexec(), the userspace is frozen. Therefore we cannot wait for it > to complete. > > Avoid running snd_sof_machine_unregister during shutdown. > > This fixes: > > [ 84.943749] Freezing user space processes ... (elapsed 0.111 seconds) done. > [ 246.784446] INFO: task kexec-lite:5123 blocked for more than 122 seconds. > [ 246.819035] Call Trace: > [ 246.821782] > [ 246.824186] __schedule+0x5f9/0x1263 > [ 246.828231] schedule+0x87/0xc5 > [ 246.831779] snd_card_disconnect_sync+0xb5/0x127 > ... > [ 246.889249] snd_sof_device_shutdown+0xb4/0x150 > [ 246.899317] pci_device_shutdown+0x37/0x61 > [ 246.903990] device_shutdown+0x14c/0x1d6 > [ 246.908391] kernel_kexec+0x45/0xb9 > > And: > > [ 246.893222] INFO: task kexec-lite:4891 blocked for more than 122 seconds. > [ 246.927709] Call Trace: > [ 246.930461] > [ 246.932819] __schedule+0x5f9/0x1263 > [ 246.936855] ? fsnotify_grab_connector+0x5c/0x70 > [ 246.942045] schedule+0x87/0xc5 > [ 246.945567] schedule_timeout+0x49/0xf3 > [ 246.949877] wait_for_completion+0x86/0xe8 > [ 246.954463] snd_card_free+0x68/0x89 > ... > [ 247.001080] platform_device_unregister+0x12/0x35 > > Cc: stable@vger.kernel.org > Fixes: 83bfc7e793b5 ("ASoC: SOF: core: unregister clients and machine drivers in .shutdown") > Signed-off-by: Ricardo Ribalda > --- > To: Pierre-Louis Bossart > To: Liam Girdwood > To: Peter Ujfalusi > To: Bard Liao > To: Ranjani Sridharan > To: Kai Vehmanen > To: Daniel Baluta > To: Mark Brown > To: Jaroslav Kysela > To: Takashi Iwai > Cc: sound-open-firmware@alsa-project.org > Cc: alsa-devel@alsa-project.org > Cc: linux-kernel@vger.kernel.org > --- > Changes in v4: > - Do not call snd_sof_machine_unregister from shutdown. > - Link to v3: https://lore.kernel.org/r/20221127-snd-freeze-v3-0-a2eda731ca14@chromium.org The subject prefix should be adjusted -- now it's no longer about ALSA core but specific to ASoC SOF. thanks, Takashi