summaryrefslogtreecommitdiff
path: root/sys/dev/pci/azalia.c
diff options
context:
space:
mode:
authorDeanna Phillips <deanna@cvs.openbsd.org>2008-03-02 17:24:13 +0000
committerDeanna Phillips <deanna@cvs.openbsd.org>2008-03-02 17:24:13 +0000
commit0049e8de2ee68857fbe349c002c555a3317e520d (patch)
tree987feddb9872b98f84e8a7d362473821529fc306 /sys/dev/pci/azalia.c
parent1c7afa20d77ef1af57380ba7b4a2cc8afe27351c (diff)
Clear interrupts on detach. Fixes interrupt storm on digital-only
controllers, like the HDMI found on Radeon cards. Tested by claudio@ and kettenis@.
Diffstat (limited to 'sys/dev/pci/azalia.c')
-rw-r--r--sys/dev/pci/azalia.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
index 9e6019ec224..11539fc9ce9 100644
--- a/sys/dev/pci/azalia.c
+++ b/sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.c,v 1.46 2007/12/16 18:46:43 deanna Exp $ */
+/* $OpenBSD: azalia.c,v 1.47 2008/03/02 17:24:12 deanna Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
@@ -526,6 +526,14 @@ azalia_pci_detach(struct device *self, int flags)
azalia_delete_corb(az);
azalia_delete_rirb(az);
+ DPRINTF(("%s: disable interrupts\n", __func__));
+ AZ_WRITE_4(az, INTCTL, 0);
+
+ DPRINTF(("%s: clear interrupts\n", __func__));
+ AZ_WRITE_4(az, INTSTS, HDA_INTSTS_CIS | HDA_INTSTS_GIS);
+ AZ_WRITE_2(az, STATESTS, HDA_STATESTS_SDIWAKE);
+ AZ_WRITE_1(az, RIRBSTS, HDA_RIRBSTS_RINTFL | HDA_RIRBSTS_RIRBOIS);
+
DPRINTF(("%s: delete PCI resources\n", __func__));
if (az->ih != NULL) {
pci_intr_disestablish(az->pc, az->ih);
@@ -1911,6 +1919,11 @@ azalia_stream_delete(stream_t *this, azalia_t *az)
{
if (this->bdlist.addr == NULL)
return 0;
+
+ /* disable stream interrupts */
+ STR_WRITE_1(this, CTL, STR_READ_1(this, CTL) |
+ ~(HDA_SD_CTL_DEIE | HDA_SD_CTL_FEIE | HDA_SD_CTL_IOCE));
+
azalia_free_dmamem(az, &this->bdlist);
return 0;
}