Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp584916rwb; Thu, 1 Dec 2022 06:06:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Q0XCrCQsTJjrb36uG4N3bPv9Uuii4Dn2MwFoQuZFfMGlcUO0jgisC2szu/uEDWZViXd+c X-Received: by 2002:a63:e44:0:b0:475:2f61:bbc3 with SMTP id 4-20020a630e44000000b004752f61bbc3mr43462724pgo.435.1669903569456; Thu, 01 Dec 2022 06:06:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669903569; cv=none; d=google.com; s=arc-20160816; b=c/btxvGmVvOw5HtsJBvCxW1VH0j4rAYuJmx5YWG53oljWoy2DwcZ+Y5xlV0qzzrLFo deX8qJmPiMcmAiykbZgQi2I/u+S5ViqkPQ5D9SgOQ2DdOatRwne+Jlm6PwDis9neFxO6 nZLTdqE4fGZ7oyqbXzpHRz9Da8nWiEMY3J0V1sW4h3QjqrEzKd7YVR68IR5VCzmZS5ww Nree5PNxMo1zObL2ERltFE6NbuIw3c86uxWEGWbQAKFRMyDGfYlNKadmAC4DUAXsjR2C MzgCgRNGwBvsJ/pqITSZcZPFLNqFrhPq4olVwlrmx/PFTZQL2IAVtOA3eCVtt6HL5wfp cWcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=l7Y2FkbIVTKFtl+HxieOmsxNGhmLoxEmtYJ88v/cdgw=; b=FwrkSnJ6soPz/Gox/voGeJpSbbVZjnoJxqA+PqWrY0/wS/cQe4FnNj34Di5ta0rkqy cZBZyP7HuvE/ytxISuHYO3tQ2a2aXTJzzcW8/L5fOuLIzJIuj28LkOafpuNsDeB/qNjv yihwbYUto13AXqR2znBuKJ8XlqHjdvhxfX57ptz5JZ+YZgWM7TXPBB06vC/cY/wsRHPH sgI8+IYnl9emqGvXkbsf+fh1CmlSHZy80dG7pqqpVQnraOfeCg+RWp72QT1MyReAf0U2 QVwwjAYMp0ia6pDxEH13/r2Yj/0rmEPBcljbYscIzoI8PtCd3GtBtndCy2BWEht0npIb 8VnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Sxbi0cvS; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lr10-20020a17090b4b8a00b0020af2411705si5163573pjb.104.2022.12.01.06.05.57; Thu, 01 Dec 2022 06:06:09 -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=@chromium.org header.s=google header.b=Sxbi0cvS; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbiLANF0 (ORCPT + 82 others); Thu, 1 Dec 2022 08:05:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231533AbiLANFI (ORCPT ); Thu, 1 Dec 2022 08:05:08 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD1B2A9EAE for ; Thu, 1 Dec 2022 05:04:20 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id 62so1591770pgb.13 for ; Thu, 01 Dec 2022 05:04:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=l7Y2FkbIVTKFtl+HxieOmsxNGhmLoxEmtYJ88v/cdgw=; b=Sxbi0cvSliG9a00Ry4hRL3209ix85X2kIBcjhC5k1nEv5BOdHhFeI7Ixds0JdL6dZ6 7K72xHH++bcFQ6L4GeTVOnVIGmY3VxFsiE1PwDgAbEFd1Qg/8JsKJA/ZZABySB5cfN5I rXB/aOLFPlnEkVyBmH4j/VAB0BH/L38J6evN4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l7Y2FkbIVTKFtl+HxieOmsxNGhmLoxEmtYJ88v/cdgw=; b=cnXpP7rDDJeEcKhzWgyJMfyqwjD4SFIHzSY29XB+JEKvbj+czdjzo90XSTBd7yMm+U PvJP2+RQlIkdG10npsIZPoH6+fK3IsLkxmfiGHwJgUAHSk2PKGmLFGkEI0gKcG4Nq2T2 RgKdjENC+wYTSGSN12HjLUio7Uy1v7N0VGnNDnRopwToaGmyUOTnt+tBz3rKWyG1ptsb XITpH2eDoNzgzh6/dGCXnyqu3ZlmGQKPjrlUdatLEn8oSkFxQm2LW84W7M/9aMz0uqoD YEY8BjOqQrUUAmNYJJvbZo1vZi/UzkciJbnDH8nQsFF6JAEiU0IvE+BXjiamwy2h70In 7fvg== X-Gm-Message-State: ANoB5pl02iR2LsF1842NcH/19pEXbE7Y2bk9Y0LpRH8LBZq8i5z1Kqeh cn+BCfaW/hw7nqS1daDQJKH5PjA2iUOcruyZ X-Received: by 2002:aa7:8686:0:b0:576:1b68:2b59 with SMTP id d6-20020aa78686000000b005761b682b59mr3097072pfo.72.1669899858416; Thu, 01 Dec 2022 05:04:18 -0800 (PST) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com. [209.85.210.172]) by smtp.gmail.com with ESMTPSA id u11-20020a17090341cb00b001896af10ca7sm3597749ple.134.2022.12.01.05.04.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Dec 2022 05:04:17 -0800 (PST) Received: by mail-pf1-f172.google.com with SMTP id l127so1164780pfl.2 for ; Thu, 01 Dec 2022 05:04:16 -0800 (PST) X-Received: by 2002:a05:6e02:66d:b0:303:1196:96c7 with SMTP id l13-20020a056e02066d00b00303119696c7mr9848943ilt.133.1669899845427; Thu, 01 Dec 2022 05:04:05 -0800 (PST) MIME-Version: 1.0 References: <20221127-snd-freeze-v8-0-3bc02d09f2ce@chromium.org> <20221127-snd-freeze-v8-3-3bc02d09f2ce@chromium.org> <716e5175-7a44-7ae8-b6bb-10d9807552e6@suse.com> In-Reply-To: <716e5175-7a44-7ae8-b6bb-10d9807552e6@suse.com> From: Ricardo Ribalda Date: Thu, 1 Dec 2022 14:03:54 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 3/3] ASoC: SOF: Fix deadlock when shutdown a frozen userspace To: Oliver Neukum Cc: Juergen Gross , Mark Brown , Chromeos Kdump , Daniel Baluta , Christophe Leroy , Len Brown , Ard Biesheuvel , Ranjani Sridharan , "Rafael J. Wysocki" , Boris Ostrovsky , Nicholas Piggin , Michael Ellerman , Eric Biederman , Dave Hansen , Jaroslav Kysela , Joel Fernandes , Liam Girdwood , Peter Ujfalusi , Pavel Machek , Pierre-Louis Bossart , Kai Vehmanen , Steven Rostedt , "K. Y. Srinivasan" , Ingo Molnar , Bjorn Helgaas , Dexuan Cui , Takashi Iwai , "H. Peter Anvin" , Bard Liao , Haiyang Zhang , Wei Liu , Thomas Gleixner , Borislav Petkov , x86@kernel.org, kexec@lists.infradead.org, alsa-devel@alsa-project.org, stable@vger.kernel.org, sound-open-firmware@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, xen-devel@lists.xenproject.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 Hi Oliver Thanks for your review On Thu, 1 Dec 2022 at 13:29, Oliver Neukum wrote: > > On 01.12.22 12:08, Ricardo Ribalda wrote: > > If we are shutting down due to kexec and the userspace is frozen, the > > system will stall forever waiting for userspace to complete. > > > > Do not wait for the clients to complete in that case. > > Hi, > > I am afraid I have to state that this approach is bad in every case, > not just this corner case. It basically means that user space can stall > the kernel for an arbitrary amount of time. And we cannot have that. > > Regards > Oliver This patchset does not modify this behaviour. It simply fixes the stall for kexec(). The patch that introduced the stall: 83bfc7e793b5 ("ASoC: SOF: core: unregister clients and machine drivers in .shutdown") was sent as a generalised version of: https://github.com/thesofproject/linux/pull/3388 AFAIK, we would need a similar patch for every single board.... which I am not sure it is doable in a reasonable timeframe. On the meantime this seems like a decent compromises. Yes, a miss-behaving userspace can still stall during suspend, but that was not introduced in this patch. Regards! > -- Ricardo Ribalda