Re: [PATCH] ALSA: hda: Check snd_hda_power_pm construct error before executing verb

From: Takashi Iwai

Date: Tue Jul 14 2026 - 01:26:17 EST


On Tue, 14 Jul 2026 04:13:51 +0200,
songxiebing wrote:
>
> Hi Takashi,
>
> At present, this patch may cause misjudgment for some platform devices.
> If rpm is not enabled on the platform device, the default runtime_status is suspended,
> which will result in the inability to write commands properly.
>
> Could you please drop this patch? Sorry for the trouble.

OK, dropped now.


thanks,

Takashi

> >On Mon, 13 Jul 2026 04:04:27 +0200,
> >songxiebing wrote:
> >>
> >> From: Bob Song <songxiebing@xxxxxxxxxx>
> >>
> >> When userspace writes 1 to /sys/bus/pci/devices/XX/remove to remove HDA PCI device,
> >> the codec device enters runtime suspended state early. The snd_hda_power_pm RAII
> >> constructor fails to wake up codec, but the original code ignores pm.err and continues
> >> to execute hda verb commands. After pci driver remove callback completes, devres
> >> automatically iounmap the BAR virtual address bus->remap_addr, resulting in access
> >> to invalid unmapped MMIO address and triggering page fault BUG.
> >>
> >> Add error check for snd_hda_power_pm constructor result:
> >> 1. Detect pm construction failure when HDA core device is suspended;
> >> 2. Print warning log with command and error code for debug;
> >> 3. Return early to skip subsequent hardware register access, avoid page fault crash.
> >>
> >> Signed-off-by: Bob Song <songxiebing@xxxxxxxxxx>
> >
> >Applied to for-next branch. Thanks.
> >
> >
> >Takashi