LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org, jejb@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Dave Jones <davej@redhat.com>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	Chris Wedgwood <reviews@ml.cw.f00f.org>,
	Michael Krufky <mkrufky@linuxtv.org>,
	Chuck Ebbert <cebbert@redhat.com>,
	Domenico Andreoli <cavokz@gmail.com>, Willy Tarreau <w@1wt.eu>,
	Rodrigo Rubira Branco <rbranco@la.checkpoint.com>,
	Jake Edge <jake@lwn.net>, Eugene Teo <eteo@redhat.com>,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, Takashi Iwai <tiwai@suse.de>
Subject: [patch 07/57] ALSA: hda - Add reboot notifier
Date: Tue, 4 Nov 2008 15:31:11 -0800	[thread overview]
Message-ID: <20081104233111.GH659@suse.de> (raw)
In-Reply-To: <20081104233028.GA659@suse.de>

[-- Attachment #1: alsa-hda-add-reboot-notifier.patch --]
[-- Type: text/plain, Size: 2410 bytes --]

2.6.27-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Takashi Iwai <tiwai@suse.de>

commit 0cbf00980f0fc4cc064a15ab3dfce19b5fae9130 upstream

The current snd-hda-intel driver seems blocking the power-off on some
devices like eeepc.  Although this is likely a BIOS problem, we can add
a workaround by disabling IRQ lines before power-off operation.
This patch adds the reboot notifier to achieve it.

The detailed problem description is found in bug#11889:
    http://bugme.linux-foundation.org/show_bug.cgi?id=11889

Tested-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/pci/hda/hda_intel.c |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -45,6 +45,7 @@
 #include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/mutex.h>
+#include <linux/reboot.h>
 #include <sound/core.h>
 #include <sound/initval.h>
 #include "hda_codec.h"
@@ -385,6 +386,9 @@ struct azx {
 
 	/* for pending irqs */
 	struct work_struct irq_pending_work;
+
+	/* reboot notifier (for mysterious hangup problem at power-down) */
+	struct notifier_block reboot_notifier;
 };
 
 /* driver types */
@@ -1890,12 +1894,36 @@ static int azx_resume(struct pci_dev *pc
 
 
 /*
+ * reboot notifier for hang-up problem at power-down
+ */
+static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf)
+{
+	struct azx *chip = container_of(nb, struct azx, reboot_notifier);
+	azx_stop_chip(chip);
+	return NOTIFY_OK;
+}
+
+static void azx_notifier_register(struct azx *chip)
+{
+	chip->reboot_notifier.notifier_call = azx_halt;
+	register_reboot_notifier(&chip->reboot_notifier);
+}
+
+static void azx_notifier_unregister(struct azx *chip)
+{
+	if (chip->reboot_notifier.notifier_call)
+		unregister_reboot_notifier(&chip->reboot_notifier);
+}
+
+/*
  * destructor
  */
 static int azx_free(struct azx *chip)
 {
 	int i;
 
+	azx_notifier_unregister(chip);
+
 	if (chip->initialized) {
 		azx_clear_irq_pending(chip);
 		for (i = 0; i < chip->num_streams; i++)
@@ -2250,6 +2278,7 @@ static int __devinit azx_probe(struct pc
 	pci_set_drvdata(pci, card);
 	chip->running = 1;
 	power_down_all_codecs(chip);
+	azx_notifier_register(chip);
 
 	dev++;
 	return err;

-- 

  parent reply	other threads:[~2008-11-04 23:39 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081104232144.186593464@mini.kroah.org>
2008-11-04 23:30 ` [patch 00/57] 2.6.27-stable review Greg KH
2008-11-04 23:30   ` [patch 01/57] agp: Fix stolen memory counting on G4X Greg KH
2008-11-04 23:30   ` [patch 02/57] SCSI: sd: Fix handling of NO_SENSE check condition Greg KH
2008-11-04 23:31   ` [patch 03/57] S390: Fix sysdev class file creation Greg KH
2008-11-04 23:31   ` [patch 04/57] sysfs: Fix return values for sysdev_store_{ulong, int} Greg KH
2008-11-04 23:31   ` [patch 05/57] ipmi: add MODULE_ALIAS to load ipmi_devintf with ipmi_si Greg KH
2008-11-04 23:31   ` [patch 06/57] USB: fix crash when URBs are unlinked after the device is gone Greg KH
2008-11-04 23:31   ` Greg KH [this message]
2008-11-04 23:31   ` [patch 08/57] kbuild: mkspec - fix build rpm Greg KH
2008-11-04 23:31   ` [patch 09/57] x86: fix /dev/mem mmap breakage when PAT is disabled Greg KH
2008-11-04 23:31   ` [patch 10/57] atl1: fix vlan tag regression Greg KH
2008-11-04 23:31   ` [patch 11/57] libertas: fix buffer overrun Greg KH
2008-11-04 23:31   ` [patch 12/57] Revert "HID: Invert HWHEEL mappings for some Logitech mice" Greg KH
2008-11-04 23:31   ` [patch 13/57] libata: initialize port_task when !CONFIG_ATA_SFF Greg KH
2008-11-04 23:31   ` [patch 14/57] syncookies: fix inclusion of tcp options in syn-ack Greg KH
2008-11-04 23:31   ` [patch 15/57] tcp: Restore ordering of TCP options for the sake of inter-operability Greg KH
2008-11-04 23:31   ` [patch 16/57] tcpv6: fix option space offsets with md5 Greg KH
2008-11-04 23:31   ` [patch 17/57] pkt_sched: sch_generic: Fix oops in sch_teql Greg KH
2008-11-04 23:31   ` [patch 18/57] sparc64: Fix race in arch/sparc64/kernel/trampoline.S Greg KH
2008-11-04 23:31   ` [patch 19/57] math-emu: Fix signalling of underflow and inexact while packing result Greg KH
2008-11-04 23:31   ` [patch 20/57] firewire: fix setting tag and sy in iso transmission Greg KH
2008-11-04 23:31   ` [patch 21/57] firewire: fix ioctl() return code Greg KH
2008-11-04 23:31   ` [patch 22/57] firewire: Survive more than 256 bus resets Greg KH
2008-11-04 23:31   ` [patch 23/57] firewire: fix struct fw_node memory leak Greg KH
2008-11-04 23:31   ` [patch 24/57] firewire: fw-sbp2: delay first login to avoid retries Greg KH
2008-11-04 23:31   ` [patch 25/57] firewire: fw-sbp2: fix races Greg KH
2008-11-04 23:31   ` [patch 26/57] ACPI: Always report a sync event after a lid state change Greg KH
2008-11-04 23:31   ` [patch 27/57] powerpc: fix i2c on PPC linkstation / kurobox machines Greg KH
2008-11-04 23:31   ` [patch 28/57] powerpc: Reserve in bootmem lmb reserved regions that cross NUMA nodes Greg KH
2008-11-04 23:32   ` [patch 29/57] powerpc/numa: Make memory reserve code more robust Greg KH
2008-11-04 23:32   ` [patch 30/57] powerpc: Dont use a 16G page if beyond mem= limits Greg KH
2008-11-04 23:32   ` [patch 31/57] i2c: The i2c mailing list is moving Greg KH
2008-11-04 23:32   ` [patch 32/57] scx200_i2c: Add missing class parameter Greg KH
2008-11-04 23:32   ` [patch 33/57] ALSA: use correct lock in snd_ctl_dev_disconnect() Greg KH
2008-11-04 23:32   ` [patch 34/57] V4L: pvrusb2: Keep MPEG PTSs from drifting away Greg KH
2008-11-04 23:32   ` [patch 35/57] DVB: s5h1411: bugfix: Setting serial or parallel mode could destroy bits Greg KH
2008-11-04 23:32   ` [patch 36/57] DVB: s5h1411: Perform s5h1411 soft reset after tuning Greg KH
2008-11-04 23:32   ` [patch 37/57] DVB: s5h1411: Power down s5h1411 when not in use Greg KH
2008-11-04 23:32   ` [patch 38/57] PCI: fix 64-vbit prefetchable memory resource BARs Greg KH
2008-11-04 23:32   ` [patch 39/57] sched: disable the hrtick for now Greg KH
2008-11-04 23:33   ` [patch 40/57] sched_clock: prevent scd->clock from moving backwards Greg KH
2008-11-04 23:33   ` [patch 41/57] x86: avoid dereferencing beyond stack + THREAD_SIZE Greg KH
2008-11-04 23:33   ` [patch 42/57] rtc-cmos: look for PNP RTC first, then for platform RTC Greg KH
2008-11-04 23:33   ` [patch 43/57] USB: storage: Avoid I/O errors when issuing SCSI ioctls to JMicron USB/ATA bridge Greg KH
2008-11-04 23:33   ` [patch 44/57] x86: register a platform RTC device if PNP doesnt describe it Greg KH
2008-11-04 23:33   ` [patch 45/57] sata_promise: add ATA engine reset to reset ops Greg KH
2008-11-04 23:33   ` [patch 46/57] sata_nv: fix generic, nf2/3 detection regression Greg KH
2008-11-04 23:33   ` [patch 47/57] ACPI: EC: do transaction from interrupt context Greg KH
2008-11-04 23:33   ` [patch 48/57] ACPI: EC: Rename some variables Greg KH
2008-11-04 23:33   ` [patch 49/57] ACPI: EC: Check for IBF=0 periodically if not in GPE mode Greg KH
2008-11-04 23:33   ` [patch 50/57] libata: Fix LBA48 on pata_it821x RAID volumes Greg KH
2008-11-04 23:33   ` [patch 51/57] ACPI: Ingore the RESET_REG_SUP bit when using ACPI reset mechanism Greg KH
2008-11-05  0:48     ` Zhao Yakui
2008-11-05  1:02       ` Greg KH
2008-11-04 23:33   ` [patch 52/57] ACPI: Clear WAK_STS on resume Greg KH
2008-11-04 23:33   ` [patch 53/57] Input: atkbd - expand Latitudes force release quirk to other Dells Greg KH
2008-11-04 23:33   ` [patch 54/57] hfsplus: fix Buffer overflow with a corrupted image Greg KH
2008-11-04 23:33   ` [patch 55/57] hfsplus: check read_mapping_page() return value Greg KH
2008-11-04 23:33   ` [patch 56/57] bonding: fix panic when taking bond interface down before removing module Greg KH
2008-11-04 23:33   ` [patch 57/57] file caps: always start with clear bprm->caps_* Greg KH

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=20081104233111.GH659@suse.de \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=cavokz@gmail.com \
    --cc=cebbert@redhat.com \
    --cc=chuckw@quantumlinux.com \
    --cc=davej@redhat.com \
    --cc=eteo@redhat.com \
    --cc=jake@lwn.net \
    --cc=jejb@kernel.org \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkrufky@linuxtv.org \
    --cc=rbranco@la.checkpoint.com \
    --cc=rdunlap@xenotime.net \
    --cc=reviews@ml.cw.f00f.org \
    --cc=stable@kernel.org \
    --cc=tiwai@suse.de \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=w@1wt.eu \
    --cc=zwane@arm.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).