rpms/kernel/F-10 linux-2.6.27-alsa-fix-vunmap-and-free-order.patch, NONE, 1.1.2.1 linux-2.6.27-alsa-hda-fix-dma-mask-for-ati-controllers.patch, NONE, 1.1.2.1 linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-ati.patch, NONE, 1.1.2.1 linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-via.patch, NONE, 1.1.2.1 linux-2.6.27-alsa-mixart-fix-lock-imbalance.patch, NONE, 1.1.2.1 linux-2.6.27-alsa-pcm-oss-fix-locking-typo.patch, NONE, 1.1.2.1 kernel.spec, 1.1206.2.52, 1.1206.2.53

Chuck Ebbert cebbert at fedoraproject.org
Thu Mar 19 01:29:29 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23033

Modified Files:
      Tag: private-fedora-10-2_6_27
	kernel.spec 
Added Files:
      Tag: private-fedora-10-2_6_27
	linux-2.6.27-alsa-fix-vunmap-and-free-order.patch 
	linux-2.6.27-alsa-hda-fix-dma-mask-for-ati-controllers.patch 
	linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-ati.patch 
	linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-via.patch 
	linux-2.6.27-alsa-mixart-fix-lock-imbalance.patch 
	linux-2.6.27-alsa-pcm-oss-fix-locking-typo.patch 
Log Message:
ALSA fixes headed for -stable:
    linux-2.6.27-alsa-fix-vunmap-and-free-order.patch
    linux-2.6.27-alsa-hda-fix-dma-mask-for-ati-controllers.patch
    linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-ati.patch
    linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-via.patch
    linux-2.6.27-alsa-mixart-fix-lock-imbalance.patch
    linux-2.6.27-alsa-pcm-oss-fix-locking-typo.patch

linux-2.6.27-alsa-fix-vunmap-and-free-order.patch:

--- NEW FILE linux-2.6.27-alsa-fix-vunmap-and-free-order.patch ---
From: Takashi Iwai <tiwai at suse.de>
Date: Tue, 17 Mar 2009 13:00:06 +0000 (+0100)
Subject: ALSA: Fix vunmap and free order in snd_free_sgbuf_pages()
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=6af845e4eb36fb91b322aaf77ec1cab2220a48ad

ALSA: Fix vunmap and free order in snd_free_sgbuf_pages()

In snd_free_sgbuf_pags(), vunmap() is called after releasing the SG
pages, and it causes errors on Xen as Xen manages the pages
differently.  Although no significant errors have been reported on
the actual hardware, this order should be fixed other way round,
first vunmap() then free pages.

Cc: Jan Beulich <jbeulich at novell.com>
Cc: <stable at kernel.org>
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---

diff --git a/sound/core/sgbuf.c b/sound/core/sgbuf.c
index d4564ed..4e7ec2b 100644
--- a/sound/core/sgbuf.c
+++ b/sound/core/sgbuf.c
@@ -38,6 +38,10 @@ int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab)
 	if (! sgbuf)
 		return -EINVAL;
 
+	if (dmab->area)
+		vunmap(dmab->area);
+	dmab->area = NULL;
+
 	tmpb.dev.type = SNDRV_DMA_TYPE_DEV;
 	tmpb.dev.dev = sgbuf->dev;
 	for (i = 0; i < sgbuf->pages; i++) {
@@ -48,9 +52,6 @@ int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab)
 		tmpb.bytes = (sgbuf->table[i].addr & ~PAGE_MASK) << PAGE_SHIFT;
 		snd_dma_free_pages(&tmpb);
 	}
-	if (dmab->area)
-		vunmap(dmab->area);
-	dmab->area = NULL;
 
 	kfree(sgbuf->table);
 	kfree(sgbuf->page_table);

linux-2.6.27-alsa-hda-fix-dma-mask-for-ati-controllers.patch:

--- NEW FILE linux-2.6.27-alsa-hda-fix-dma-mask-for-ati-controllers.patch ---
From: Takashi Iwai <tiwai at suse.de>
Date: Tue, 17 Mar 2009 06:47:18 +0000 (+0100)
Subject: ALSA: hda - Fix DMA mask for ATI controllers
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=09240cf429505891d6123ce14a29f58f2a60121e

ALSA: hda - Fix DMA mask for ATI controllers

ATI controllers (at least some SB0600 models) appear buggy to handle
64bit DMA.  As a workaround, reset GCAP bit0 and let the driver to
use only 32bit DMA on these controllers.

Cc: <stable at kernel.org>
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 5e909e0..643f0e4 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2210,9 +2210,17 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
 	gcap = azx_readw(chip, GCAP);
 	snd_printdd("chipset global capabilities = 0x%x\n", gcap);
 
+	/* ATI chips seems buggy about 64bit DMA addresses */
+	if (chip->driver_type == AZX_DRIVER_ATI)
+		gcap &= ~0x01;
+
 	/* allow 64bit DMA address if supported by H/W */
 	if ((gcap & 0x01) && !pci_set_dma_mask(pci, DMA_64BIT_MASK))
 		pci_set_consistent_dma_mask(pci, DMA_64BIT_MASK);
+	else {
+		pci_set_dma_mask(pci, DMA_32BIT_MASK);
+		pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK);
+	}
 
 	/* read number of streams from GCAP register instead of using
 	 * hardcoded value

linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-ati.patch:

--- NEW FILE linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-ati.patch ---
From: Takashi Iwai <tiwai at suse.de>
Date: Tue, 17 Mar 2009 06:49:14 +0000 (+0100)
Subject: ALSA: hda - Workaround for buggy DMA position on ATI controllers
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=c673ba1c23941173c16ff24c7cb34199e826c8b5

ALSA: hda - Workaround for buggy DMA position on ATI controllers

The position-buffer on ATI controllers are unreliable as well as
on VIA chips, thus the same workaround for DMA position reading as
VIA is useful for ATI.

Cc: <stable at kernel.org>
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 643f0e4..f3b5723 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2059,26 +2059,31 @@ static int __devinit check_position_fix(struct azx *chip, int fix)
 {
 	const struct snd_pci_quirk *q;
 
-	/* Check VIA HD Audio Controller exist */
-	if (chip->pci->vendor == PCI_VENDOR_ID_VIA &&
-	    chip->pci->device == VIA_HDAC_DEVICE_ID) {
+	switch (fix) {
+	case POS_FIX_LPIB:
+	case POS_FIX_POSBUF:
+		return fix;
+	}
+
+	/* Check VIA/ATI HD Audio Controller exist */
+	switch (chip->driver_type) {
+	case AZX_DRIVER_VIA:
+	case AZX_DRIVER_ATI:
 		chip->via_dmapos_patch = 1;
 		/* Use link position directly, avoid any transfer problem. */
 		return POS_FIX_LPIB;
 	}
 	chip->via_dmapos_patch = 0;
 
-	if (fix == POS_FIX_AUTO) {
-		q = snd_pci_quirk_lookup(chip->pci, position_fix_list);
-		if (q) {
-			printk(KERN_INFO
-				    "hda_intel: position_fix set to %d "
-				    "for device %04x:%04x\n",
-				    q->value, q->subvendor, q->subdevice);
-			return q->value;
-		}
+	q = snd_pci_quirk_lookup(chip->pci, position_fix_list);
+	if (q) {
+		printk(KERN_INFO
+		       "hda_intel: position_fix set to %d "
+		       "for device %04x:%04x\n",
+		       q->value, q->subvendor, q->subdevice);
+		return q->value;
 	}
-	return fix;
+	return POS_FIX_AUTO;
 }
 
 /*

linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-via.patch:

--- NEW FILE linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-via.patch ---
From: Joseph Chan <josephchan at via.com.tw>
Date: Tue, 26 Aug 2008 12:38:03 +0000 (+0200)
Subject: ALSA: hda - Fix VIA recording problem
X-Git-Tag: v2.6.28-rc1~20^2~185
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=0e153474f47aee906107a5c1da0ae83553e5ba6a

ALSA: hda - Fix VIA recording problem

Add a workaround for bad DMA-position reporting on VIA chipset.

Signed-off-by: Joseph Chan <josephchan at via.com.tw>
[modified and cleaned up by tiwai]
Signed-off-by: Takashi Iwai <tiwai at suse.de>
Signed-off-by: Jaroslav Kysela <perex at perex.cz>
---

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 4f80248..52a3adf 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -286,6 +286,11 @@ enum {
 #define INTEL_SCH_HDA_DEVC      0x78
 #define INTEL_SCH_HDA_DEVC_NOSNOOP       (0x1<<11)
 
+/* Define IN stream 0 FIFO size offset in VIA controller */
+#define VIA_IN_STREAM0_FIFO_SIZE_OFFSET	0x90
+/* Define VIA HD Audio Device ID*/
+#define VIA_HDAC_DEVICE_ID		0x3288
+
 
 /*
  */
@@ -317,6 +322,12 @@ struct azx_dev {
 	unsigned int running :1;
 	unsigned int irq_pending :1;
 	unsigned int irq_ignore :1;
+	/*
+	 * For VIA:
+	 *  A flag to ensure DMA position is 0
+	 *  when link position is not greater than FIFO size
+	 */
+	unsigned int insufficient :1;
 };
 
 /* CORB/RIRB */
@@ -379,6 +390,7 @@ struct azx {
 	unsigned int polling_mode :1;
 	unsigned int msi :1;
 	unsigned int irq_pending_warned :1;
+	unsigned int via_dmapos_patch :1; /* enable DMA-position fix for VIA */
 
 	/* for debugging */
 	unsigned int last_cmd;	/* last issued command (to sync) */
@@ -818,6 +830,11 @@ static void azx_int_clear(struct azx *chip)
 /* start a stream */
 static void azx_stream_start(struct azx *chip, struct azx_dev *azx_dev)
 {
+	/*
+	 * Before stream start, initialize parameter
+	 */
+	azx_dev->insufficient = 1;
+
 	/* enable SIE */
 	azx_writeb(chip, INTCTL,
 		   azx_readb(chip, INTCTL) | (1 << azx_dev->index));
@@ -1148,7 +1165,8 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev)
 
 	/* enable the position buffer */
 	if (chip->position_fix == POS_FIX_POSBUF ||
-	    chip->position_fix == POS_FIX_AUTO) {
+	    chip->position_fix == POS_FIX_AUTO ||
+	    chip->via_dmapos_patch) {
 		if (!(azx_readl(chip, DPLBASE) & ICH6_DPLBASE_ENABLE))
 			azx_writel(chip, DPLBASE,
 				(u32)chip->posbuf.addr | ICH6_DPLBASE_ENABLE);
@@ -1504,13 +1522,71 @@ static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 	return 0;
 }
 
+/* get the current DMA position with correction on VIA chips */
+static unsigned int azx_via_get_position(struct azx *chip,
+					 struct azx_dev *azx_dev)
+{
+	unsigned int link_pos, mini_pos, bound_pos;
+	unsigned int mod_link_pos, mod_dma_pos, mod_mini_pos;
+	unsigned int fifo_size;
+
+	link_pos = azx_sd_readl(azx_dev, SD_LPIB);
+	if (azx_dev->index >= 4) {
+		/* Playback, no problem using link position */
+		return link_pos;
+	}
+
+	/* Capture */
+	/* For new chipset,
+	 * use mod to get the DMA position just like old chipset
+	 */
+	mod_dma_pos = le32_to_cpu(*azx_dev->posbuf);
+	mod_dma_pos %= azx_dev->period_bytes;
+
+	/* azx_dev->fifo_size can't get FIFO size of in stream.
+	 * Get from base address + offset.
+	 */
+	fifo_size = readw(chip->remap_addr + VIA_IN_STREAM0_FIFO_SIZE_OFFSET);
+
+	if (azx_dev->insufficient) {
+		/* Link position never gather than FIFO size */
+		if (link_pos <= fifo_size)
+			return 0;
+
+		azx_dev->insufficient = 0;
+	}
+
+	if (link_pos <= fifo_size)
+		mini_pos = azx_dev->bufsize + link_pos - fifo_size;
+	else
+		mini_pos = link_pos - fifo_size;
+
+	/* Find nearest previous boudary */
+	mod_mini_pos = mini_pos % azx_dev->period_bytes;
+	mod_link_pos = link_pos % azx_dev->period_bytes;
+	if (mod_link_pos >= fifo_size)
+		bound_pos = link_pos - mod_link_pos;
+	else if (mod_dma_pos >= mod_mini_pos)
+		bound_pos = mini_pos - mod_mini_pos;
+	else {
+		bound_pos = mini_pos - mod_mini_pos + azx_dev->period_bytes;
+		if (bound_pos >= azx_dev->bufsize)
+			bound_pos = 0;
+	}
+
+	/* Calculate real DMA position we want */
+	return bound_pos + mod_dma_pos;
+}
+
 static unsigned int azx_get_position(struct azx *chip,
 				     struct azx_dev *azx_dev)
 {
 	unsigned int pos;
 
-	if (chip->position_fix == POS_FIX_POSBUF ||
-	    chip->position_fix == POS_FIX_AUTO) {
+	if (chip->via_dmapos_patch)
+		pos = azx_via_get_position(chip, azx_dev);
+	else if (chip->position_fix == POS_FIX_POSBUF ||
+		 chip->position_fix == POS_FIX_AUTO) {
 		/* use the position buffer */
 		pos = le32_to_cpu(*azx_dev->posbuf);
 	} else {
@@ -1946,6 +2022,15 @@ static int __devinit check_position_fix(struct azx *chip, int fix)
 {
 	const struct snd_pci_quirk *q;
 
+	/* Check VIA HD Audio Controller exist */
+	if (chip->pci->vendor == PCI_VENDOR_ID_VIA &&
+	    chip->pci->device == VIA_HDAC_DEVICE_ID) {
+		chip->via_dmapos_patch = 1;
+		/* Use link position directly, avoid any transfer problem. */
+		return POS_FIX_LPIB;
+	}
+	chip->via_dmapos_patch = 0;
+
 	if (fix == POS_FIX_AUTO) {
 		q = snd_pci_quirk_lookup(chip->pci, position_fix_list);
 		if (q) {

linux-2.6.27-alsa-mixart-fix-lock-imbalance.patch:

--- NEW FILE linux-2.6.27-alsa-mixart-fix-lock-imbalance.patch ---
From: Jiri Slaby <jirislaby at gmail.com>
Date: Wed, 11 Mar 2009 19:11:41 +0000 (+0100)
Subject: ALSA: mixart, fix lock imbalance
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=82f5d57163abed2e5ff271d03217b6f90c616eb8

ALSA: mixart, fix lock imbalance

There is an omitted unlock in one snd_mixart_hw_params fail path. Fix it.

Signed-off-by: Jiri Slaby <jirislaby at gmail.com>
Cc: <stable at kernel.org>
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---

diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index f23a735..bb16250 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -607,6 +607,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
 	/* set the format to the board */
 	err = mixart_set_format(stream, format);
 	if(err < 0) {
+		mutex_unlock(&mgr->setup_mutex);
 		return err;
 	}
 

linux-2.6.27-alsa-pcm-oss-fix-locking-typo.patch:

--- NEW FILE linux-2.6.27-alsa-pcm-oss-fix-locking-typo.patch ---
From: Jiri Slaby <jirislaby at gmail.com>
Date: Wed, 11 Mar 2009 19:11:40 +0000 (+0100)
Subject: ALSA: pcm_oss, fix locking typo
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=91054598f794fb5d8a0b1e747ff8e2e8fc2115b3

ALSA: pcm_oss, fix locking typo

s/mutex_lock/mutex_unlock/ on 2 fail paths in snd_pcm_oss_proc_write.
Probably a typo, lock should be unlocked when leaving the function.

Signed-off-by: Jiri Slaby <jirislaby at gmail.com>
Cc: <stable at kernel.org>
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---

diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 0a1798e..699d289 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2872,7 +2872,7 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry,
 			setup = kmalloc(sizeof(*setup), GFP_KERNEL);
 			if (! setup) {
 				buffer->error = -ENOMEM;
-				mutex_lock(&pstr->oss.setup_mutex);
+				mutex_unlock(&pstr->oss.setup_mutex);
 				return;
 			}
 			if (pstr->oss.setup_list == NULL)
@@ -2886,7 +2886,7 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry,
 			if (! template.task_name) {
 				kfree(setup);
 				buffer->error = -ENOMEM;
-				mutex_lock(&pstr->oss.setup_mutex);
+				mutex_unlock(&pstr->oss.setup_mutex);
 				return;
 			}
 		}


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1206.2.52
retrieving revision 1.1206.2.53
diff -u -r1.1206.2.52 -r1.1206.2.53
--- kernel.spec	18 Mar 2009 21:35:48 -0000	1.1206.2.52
+++ kernel.spec	19 Mar 2009 01:29:25 -0000	1.1206.2.53
@@ -623,6 +623,13 @@
 Patch400: linux-2.6-scsi-cpqarray-set-master.patch
 
 Patch410: linux-2.6-alsa-hda-probe-mask-quirks.patch
+# alsa patches headed for 2.6.27.21
+Patch411: linux-2.6.27-alsa-fix-vunmap-and-free-order.patch
+Patch412: linux-2.6.27-alsa-hda-fix-dma-mask-for-ati-controllers.patch
+Patch413: linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-via.patch
+Patch414: linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-ati.patch
+Patch415: linux-2.6.27-alsa-mixart-fix-lock-imbalance.patch
+Patch416: linux-2.6.27-alsa-pcm-oss-fix-locking-typo.patch
 
 Patch429: linux-2.6-squashfs.patch
 Patch430: linux-2.6-net-silence-noisy-printks.patch
@@ -1240,6 +1247,12 @@
 
 # ALSA
 ApplyPatch linux-2.6-alsa-hda-probe-mask-quirks.patch
+ApplyPatch linux-2.6.27-alsa-fix-vunmap-and-free-order.patch
+ApplyPatch linux-2.6.27-alsa-hda-fix-dma-mask-for-ati-controllers.patch
+ApplyPatch linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-via.patch
+ApplyPatch linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-ati.patch
+ApplyPatch linux-2.6.27-alsa-mixart-fix-lock-imbalance.patch
+ApplyPatch linux-2.6.27-alsa-pcm-oss-fix-locking-typo.patch
 
 # Filesystem patches.
 # Squashfs
@@ -1966,6 +1979,15 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Wed Mar 18 2009 Chuck Ebbert <cebbert at redhat.com>  2.6.27.20-170.2.53
+- ALSA fixes headed for -stable:
+    linux-2.6.27-alsa-fix-vunmap-and-free-order.patch
+    linux-2.6.27-alsa-hda-fix-dma-mask-for-ati-controllers.patch
+    linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-ati.patch
+    linux-2.6.27-alsa-hda-workaround-for-buggy-dma-on-via.patch
+    linux-2.6.27-alsa-mixart-fix-lock-imbalance.patch
+    linux-2.6.27-alsa-pcm-oss-fix-locking-typo.patch
+
 * Wed Mar 18 2009 Chuck Ebbert <cebbert at redhat.com>  2.6.27.20-170.2.52
 - Two nfsd fixes headed for -stable:
     linux-2.6-nfsd-drop-cap-mknod-for-non-root.patch




More information about the fedora-extras-commits mailing list