|
@@ -410,7 +410,7 @@ static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool
|
|
|
#ifdef CONFIG_SND_DMA_SGBUF
|
|
|
if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_SG) {
|
|
|
struct snd_sg_buf *sgbuf = dmab->private_data;
|
|
|
- if (chip->driver_type == AZX_DRIVER_CMEDIA)
|
|
|
+ if (!chip->uc_buffer)
|
|
|
return; /* deal with only CORB/RIRB buffers */
|
|
|
if (on)
|
|
|
set_pages_array_wc(sgbuf->page_table, sgbuf->pages);
|
|
@@ -1637,6 +1637,7 @@ static void azx_check_snoop_available(struct azx *chip)
|
|
|
dev_info(chip->card->dev, "Force to %s mode by module option\n",
|
|
|
snoop ? "snoop" : "non-snoop");
|
|
|
chip->snoop = snoop;
|
|
|
+ chip->uc_buffer = !snoop;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -1657,8 +1658,12 @@ static void azx_check_snoop_available(struct azx *chip)
|
|
|
snoop = false;
|
|
|
|
|
|
chip->snoop = snoop;
|
|
|
- if (!snoop)
|
|
|
+ if (!snoop) {
|
|
|
dev_info(chip->card->dev, "Force to non-snoop mode\n");
|
|
|
+ /* C-Media requires non-cached pages only for CORB/RIRB */
|
|
|
+ if (chip->driver_type != AZX_DRIVER_CMEDIA)
|
|
|
+ chip->uc_buffer = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
static void azx_probe_work(struct work_struct *work)
|
|
@@ -2097,7 +2102,7 @@ static void pcm_mmap_prepare(struct snd_pcm_substream *substream,
|
|
|
#ifdef CONFIG_X86
|
|
|
struct azx_pcm *apcm = snd_pcm_substream_chip(substream);
|
|
|
struct azx *chip = apcm->chip;
|
|
|
- if (!azx_snoop(chip) && chip->driver_type != AZX_DRIVER_CMEDIA)
|
|
|
+ if (chip->uc_buffer)
|
|
|
area->vm_page_prot = pgprot_writecombine(area->vm_page_prot);
|
|
|
#endif
|
|
|
}
|