From: Takashi Iwai <tiwai@suse.de>
To: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: alsa-devel@alsa-project.org, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] ALSA: hda: fix general protection fault in azx_runtime_idle
Date: Mon, 15 Nov 2021 08:57:56 +0100 [thread overview]
Message-ID: <s5hsfvxvojf.wl-tiwai@suse.de> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2111121424170.3554566@eliteleevi.tm.intel.com>
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 <kai.vehmanen@linux.intel.com>
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
>
> ack, tested this and no warnings anymore.
>
> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> Tested-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
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
next prev parent reply other threads:[~2021-11-15 7:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 21:03 [Intel-gfx] [PATCH] ALSA: hda: fix general protection fault in azx_runtime_idle Kai Vehmanen
2021-11-10 21:55 ` Takashi Iwai
2021-11-10 22:15 ` Kai Vehmanen
2021-11-11 13:29 ` Takashi Iwai
2021-11-11 17:39 ` Kai Vehmanen
2021-11-12 10:02 ` Takashi Iwai
2021-11-12 12:27 ` Kai Vehmanen
2021-11-15 7:57 ` Takashi Iwai [this message]
2021-11-10 21:57 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-11-10 22:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-11-10 23:45 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-11-11 15:33 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for ALSA: hda: fix general protection fault in azx_runtime_idle (rev2) Patchwork
2021-11-11 15:37 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2021-11-11 16:01 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-11-12 10:28 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for ALSA: hda: fix general protection fault in azx_runtime_idle (rev3) Patchwork
2021-11-12 10:32 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2021-11-12 10:57 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-11-12 15:04 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hsfvxvojf.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kai.vehmanen@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox