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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1EC9C433EF for ; Thu, 11 Nov 2021 13:29:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A4A6E610FC for ; Thu, 11 Nov 2021 13:29:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A4A6E610FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D52C6EA48; Thu, 11 Nov 2021 13:29:36 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 222826EA48 for ; Thu, 11 Nov 2021 13:29:35 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 929F721B3F; Thu, 11 Nov 2021 13:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1636637373; 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=LWluxz9DxDLw9ExF8OURHV8cbYos+TpPV+9ukpFRCd8=; b=NCej04BkmR07rito9NQQ2YHnXNxRxoWFfEtLWcAyDpkXa3L6zisPKqa7tuKQRxng3MsHmf 6GpZqz243BZ3LZTxrIVbOeCsEtLkkTIMUAqzGMhZUWl1AHP1QGxOIAcP9V/00smjgPn2xx jBA5W94xRGnYfhiVv7gC8V6aBHabzwM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1636637373; 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=LWluxz9DxDLw9ExF8OURHV8cbYos+TpPV+9ukpFRCd8=; b=ADufAHL/oJP0KaT0wEC2Qk87WHDlqNRgL6Urgh7QNueKiVMUujPgFgv6fEUw0PM3mS5uiR FqqFxn4rimD3KqCA== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 7B14DA3B85; Thu, 11 Nov 2021 13:29:33 +0000 (UTC) Date: Thu, 11 Nov 2021 14:29:33 +0100 Message-ID: From: Takashi Iwai To: Kai Vehmanen In-Reply-To: References: <20211110210307.1172004-1-kai.vehmanen@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 Subject: Re: [Intel-gfx] [PATCH] ALSA: hda: fix general protection fault in azx_runtime_idle X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, 10 Nov 2021 23:15:40 +0100, Kai Vehmanen wrote: > > Hey, > > On Wed, 10 Nov 2021, Takashi Iwai wrote: > > > On Wed, 10 Nov 2021 22:03:07 +0100, Kai Vehmanen wrote: > > > Fix a corner case between PCI device driver remove callback and > > > runtime PM idle callback. > [...] > > > Some non-persistent direct links showing the bug trigger on > > > different platforms with linux-next 20211109: > > > - https://intel-gfx-ci.01.org/tree/linux-next/next-20211109/fi-tgl-1115g4/igt@i915_module_load@reload.html > > > - https://intel-gfx-ci.01.org/tree/linux-next/next-20211109/fi-jsl-1/igt@i915_module_load@reload.html > > > > > > Notably with 20211110 linux-next, the bug does not trigger: > > > - https://intel-gfx-ci.01.org/tree/linux-next/next-20211110/fi-tgl-1115g4/igt@i915_module_load@reload.html > > > > Is this the case with CONFIG_DEBUG_KOBJECT_RELEASE? > > This would be the only logical explanation I can think of for now. > > hmm, that doesn't seem to be used. Here's a link to kconfig used in the > failing CI run: > https://intel-gfx-ci.01.org/tree/linux-next/next-20211109/kconfig.txt OK, then it's not due to the delayed release, but the cause should be the same, I suppose. > It's still a bit odd, especially given Scott just reported the other HDA > related regression in 5.15 today. The two issues don't seem to be related > though, although both are fixed by clearing drvdata (but in different > places of hda_intel.c). I don't think it's the same issue, rather a coincidence of the timing. There have been many changes in 5.15, after all :) > I'll try to run some more tests tomorrow. The fix should be good in any > case, but it would be interesting to understand better what change made > this more (?) likely to hit than before. This is not a new test and the > problem happens on fairly old platforms, so something has changed. A potential problem with the current code is that it doesn't disable the runtime PM at the release procedure. Could you try the patch below? You can put WARN_ON(!chip) at azx_runtime_idle(), too, for catching the invalid runtime call. thanks, Takashi --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1347,8 +1347,13 @@ static void azx_free(struct azx *chip) if (hda->freed) return; - if (azx_has_pm_runtime(chip) && chip->running) + if (azx_has_pm_runtime(chip) && chip->running) { pm_runtime_get_noresume(&pci->dev); + pm_runtime_forbid(&pci->dev); + pm_runtime_dont_use_autosuspend(&pci->dev); + pm_runtime_disable(&pci->dev); + } + chip->running = 0; azx_del_card_list(chip); @@ -2320,6 +2325,7 @@ static int azx_probe_continue(struct azx *chip) set_default_power_save(chip); if (azx_has_pm_runtime(chip)) { + pm_runtime_enable(&pci->dev); pm_runtime_use_autosuspend(&pci->dev); pm_runtime_allow(&pci->dev); pm_runtime_put_autosuspend(&pci->dev);