2019-05-27 14:55:05 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2013-05-30 22:07:10 +08:00
|
|
|
/*
|
|
|
|
*/
|
2015-01-08 23:54:15 +08:00
|
|
|
#ifndef __SOUND_HDA_INTEL_H
|
|
|
|
#define __SOUND_HDA_INTEL_H
|
|
|
|
|
2015-02-20 01:04:17 +08:00
|
|
|
#include "hda_controller.h"
|
2015-01-08 23:54:15 +08:00
|
|
|
|
|
|
|
struct hda_intel {
|
|
|
|
struct azx chip;
|
|
|
|
|
|
|
|
/* for pending irqs */
|
|
|
|
struct work_struct irq_pending_work;
|
|
|
|
|
|
|
|
/* sync probing */
|
|
|
|
struct completion probe_wait;
|
|
|
|
struct work_struct probe_work;
|
|
|
|
|
|
|
|
/* card list (for power_save trigger) */
|
|
|
|
struct list_head list;
|
|
|
|
|
|
|
|
/* extra flags */
|
|
|
|
unsigned int irq_pending_warned:1;
|
2015-04-15 04:13:18 +08:00
|
|
|
unsigned int probe_continued:1;
|
2015-01-08 23:54:15 +08:00
|
|
|
|
2015-09-05 02:49:36 +08:00
|
|
|
/* vga_switcheroo setup */
|
2015-01-08 23:54:15 +08:00
|
|
|
unsigned int use_vga_switcheroo:1;
|
|
|
|
unsigned int vga_switcheroo_registered:1;
|
|
|
|
unsigned int init_failed:1; /* delayed init failed */
|
ALSA: hda: Release resources at error in delayed probe
snd-hda-intel driver handles the most of its probe task in the delayed
work (either via workqueue or via firmware loader). When an error
happens in the later delayed probe, we can't deregister the device
itself because the probe callback already returned success and the
device was bound. So, for now, we set hda->init_failed flag and make
the rest untouched until the device gets really unbound.
However, this leaves the device up running, keeping the resources
without any use that prevents other operations.
In this patch, we release the resources at first when a probe error
happens in the delayed probe stage, but keeps the top-level object, so
that the PM and other ops can still refer to the object itself.
Also for simplicity, snd_hda_intel object is allocated via devm, so
that we can get rid of the explicit kfree calls.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207043
Link: https://lore.kernel.org/r/20200413082034.25166-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-04-13 16:20:31 +08:00
|
|
|
unsigned int freed:1; /* resources already released */
|
2015-01-08 23:54:15 +08:00
|
|
|
|
2015-04-29 17:43:36 +08:00
|
|
|
bool need_i915_power:1; /* the hda controller needs i915 power */
|
2015-01-08 23:54:15 +08:00
|
|
|
};
|
2013-05-30 22:07:10 +08:00
|
|
|
|
|
|
|
#endif
|