Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://github.com/tiwai/sound
Browse files Browse the repository at this point in the history
* 'for-linus' of git://github.com/tiwai/sound:
  ALSA: hda - Fix a regression of the position-buffer check
  • Loading branch information
torvalds committed Oct 3, 2011
2 parents 2e51818 + 798cb7e commit 4edf588
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,8 @@ static unsigned int azx_via_get_position(struct azx *chip,
}

static unsigned int azx_get_position(struct azx *chip,
struct azx_dev *azx_dev)
struct azx_dev *azx_dev,
bool with_check)
{
unsigned int pos;
int stream = azx_dev->substream->stream;
Expand All @@ -1940,7 +1941,7 @@ static unsigned int azx_get_position(struct azx *chip,
default:
/* use the position buffer */
pos = le32_to_cpu(*azx_dev->posbuf);
if (chip->position_fix[stream] == POS_FIX_AUTO) {
if (with_check && chip->position_fix[stream] == POS_FIX_AUTO) {
if (!pos || pos == (u32)-1) {
printk(KERN_WARNING
"hda-intel: Invalid position buffer, "
Expand All @@ -1964,7 +1965,7 @@ static snd_pcm_uframes_t azx_pcm_pointer(struct snd_pcm_substream *substream)
struct azx *chip = apcm->chip;
struct azx_dev *azx_dev = get_azx_dev(substream);
return bytes_to_frames(substream->runtime,
azx_get_position(chip, azx_dev));
azx_get_position(chip, azx_dev, false));
}

/*
Expand All @@ -1987,7 +1988,7 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
return -1; /* bogus (too early) interrupt */

stream = azx_dev->substream->stream;
pos = azx_get_position(chip, azx_dev);
pos = azx_get_position(chip, azx_dev, true);

if (WARN_ONCE(!azx_dev->period_bytes,
"hda-intel: zero azx_dev->period_bytes"))
Expand Down

0 comments on commit 4edf588

Please sign in to comment.