aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-01 04:30:53 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-11-23 22:02:53 -0500
commit413cbf469a19e7662ba5025695bf5a573927105a (patch)
tree22302073f672f1d504fb820d9fcea49a5a430a59 /sound/pci
parent5d01410fe4d92081f349b013a2e7a95429e4f2c9 (diff)
ALSA: hda - Limit 40bit DMA for AMD HDMI controllers
AMD/ATI HDMI controller chip models, we already have a filter to lower to 32bit DMA, but the rest are supposed to be working with 64bit although the hardware doesn't really work with 63bit but only with 40 or 48bit DMA. In this patch, we take 40bit DMA for safety for the AMD/ATI controllers as the graphics drivers does. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: <stable@vger.kernel.org>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_intel.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 16660f312043..bd298ba5d4df 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1486,6 +1486,7 @@ static int azx_first_init(struct azx *chip)
1486 struct snd_card *card = chip->card; 1486 struct snd_card *card = chip->card;
1487 int err; 1487 int err;
1488 unsigned short gcap; 1488 unsigned short gcap;
1489 unsigned int dma_bits = 64;
1489 1490
1490#if BITS_PER_LONG != 64 1491#if BITS_PER_LONG != 64
1491 /* Fix up base address on ULI M5461 */ 1492 /* Fix up base address on ULI M5461 */
@@ -1522,9 +1523,14 @@ static int azx_first_init(struct azx *chip)
1522 gcap = azx_readw(chip, GCAP); 1523 gcap = azx_readw(chip, GCAP);
1523 dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap); 1524 dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap);
1524 1525
1526 /* AMD devices support 40 or 48bit DMA, take the safe one */
1527 if (chip->pci->vendor == PCI_VENDOR_ID_AMD)
1528 dma_bits = 40;
1529
1525 /* disable SB600 64bit support for safety */ 1530 /* disable SB600 64bit support for safety */
1526 if (chip->pci->vendor == PCI_VENDOR_ID_ATI) { 1531 if (chip->pci->vendor == PCI_VENDOR_ID_ATI) {
1527 struct pci_dev *p_smbus; 1532 struct pci_dev *p_smbus;
1533 dma_bits = 40;
1528 p_smbus = pci_get_device(PCI_VENDOR_ID_ATI, 1534 p_smbus = pci_get_device(PCI_VENDOR_ID_ATI,
1529 PCI_DEVICE_ID_ATI_SBX00_SMBUS, 1535 PCI_DEVICE_ID_ATI_SBX00_SMBUS,
1530 NULL); 1536 NULL);
@@ -1554,9 +1560,11 @@ static int azx_first_init(struct azx *chip)
1554 } 1560 }
1555 1561
1556 /* allow 64bit DMA address if supported by H/W */ 1562 /* allow 64bit DMA address if supported by H/W */
1557 if ((gcap & AZX_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64))) 1563 if (!(gcap & AZX_GCAP_64OK))
1558 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64)); 1564 dma_bits = 32;
1559 else { 1565 if (!pci_set_dma_mask(pci, DMA_BIT_MASK(dma_bits))) {
1566 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(dma_bits));
1567 } else {
1560 pci_set_dma_mask(pci, DMA_BIT_MASK(32)); 1568 pci_set_dma_mask(pci, DMA_BIT_MASK(32));
1561 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)); 1569 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32));
1562 } 1570 }