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 0E435C433F5 for ; Mon, 15 Nov 2021 07:58:01 +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 CB73163217 for ; Mon, 15 Nov 2021 07:58:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CB73163217 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 1859689C25; Mon, 15 Nov 2021 07:58:00 +0000 (UTC) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3145A89932 for ; Mon, 15 Nov 2021 07:57:58 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 892DE1FD50; Mon, 15 Nov 2021 07:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1636963076; 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=MfJK66Q5Yf9s8KyRoh0tj2vHn6+Gv8C2aBOi72F6Px4=; b=kBlKwl9+6f4ST8e3iIA8CAHRcMYdUKQm+n48JOaGJsei63MTzvrV/77MnAeNFOoZ1Um3Dj FWl3yrW7wBUm+PNfkJIoItrwJaWbGJ1cv3X+khmBi8vwsc002sLlvqWzS+aki7B3nY8Nfy s05QN/V02+oDfykWFcTe0xLL69dTrZY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1636963076; 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=MfJK66Q5Yf9s8KyRoh0tj2vHn6+Gv8C2aBOi72F6Px4=; b=j/b8AT1LHsvo5ipNJF28vtdZ60g0LbRDIqfhprKB182oKKANbRAyLsmowHFAiZq1uYPC1r 8GAIe9MtN4a81jCQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 6ED54A3B85; Mon, 15 Nov 2021 07:57:56 +0000 (UTC) Date: Mon, 15 Nov 2021 08:57:56 +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 Fri, 12 Nov 2021 13:27:34 +0100, Kai Vehmanen wrote: > > Hi, > > On Fri, 12 Nov 2021, Takashi Iwai wrote: > > > On Thu, 11 Nov 2021 18:39:36 +0100, Kai Vehmanen wrote: > > > And later > > > [ 54.770701] Enabling runtime PM for inactive device (0000:00:1f.3) with active children > > > [ 54.770718] WARNING: CPU: 0 PID: 10 at drivers/base/power/runtime.c:1439 pm_runtime_enable+0x98/0xb0 > > > > > > Adding a "pm_runtime_set_active(&pci->dev)" to both azx_free() and > > > azx_probe_continue() seems to help and fix still works. > > > > Ah yes, I was confused as if it were already called in hdac_device.c, > > but this was about the HD-audio bus controller, not the codec. > > > > Below is the revised one. > [...] > > Currently we haven't explicitly enable and allow/forbid the runtime PM > > at the probe and the remove phases of HD-audio controller driver, and > > this was the reason of a GPF mentioned in the commit e81478bbe7a1 > > ("ALSA: hda: fix general protection fault in azx_runtime_idle"); > > namely, even after the resources are released, the runtime PM might be > > still invoked by the bound graphics driver during the remove of the > > controller driver. Although we've fixed it by clearing the drvdata > > reference, it'd be also better to cover the runtime PM issue more > > properly. > > > > This patch adds a few more pm_runtime_*() calls at the probe and the > > remove time for setting and cleaning up the runtime PM. Particularly, > > now more explicitly pm_runtime_enable() and _disable() get called as > > well as pm_runtime_forbid() call at the remove callback, so that a > > use-after-free should be avoided. > > > > Reported-by: Kai Vehmanen > > Signed-off-by: Takashi Iwai > > ack, tested this and no warnings anymore. > > Reviewed-by: Kai Vehmanen > Tested-by: Kai Vehmanen OK, I'll submit and merge the patch. As the original problem was fixed by NULL checks, I'd push this for 5.16, though. thanks, Takashi