diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-02 22:22:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-02 22:22:44 -0400 |
commit | 4edf5886bba1a3fba3b780c7263f64c23536a4a5 (patch) | |
tree | 69d49b7b267a4970f1e56f5a8196937cc53fb80e | |
parent | 2e518181074b4ac67c27768f44a1515c4fc1bff9 (diff) | |
parent | 798cb7e897210dbf827f69a302c0967e0380ebac (diff) |
Merge branch 'for-linus' of git://github.com/tiwai/sound
* 'for-linus' of git://github.com/tiwai/sound:
ALSA: hda - Fix a regression of the position-buffer check
-rw-r--r-- | sound/pci/hda/hda_intel.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index be6982289c0d..e9a2a8795d1b 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -1924,7 +1924,8 @@ static unsigned int azx_via_get_position(struct azx *chip, | |||
1924 | } | 1924 | } |
1925 | 1925 | ||
1926 | static unsigned int azx_get_position(struct azx *chip, | 1926 | static unsigned int azx_get_position(struct azx *chip, |
1927 | struct azx_dev *azx_dev) | 1927 | struct azx_dev *azx_dev, |
1928 | bool with_check) | ||
1928 | { | 1929 | { |
1929 | unsigned int pos; | 1930 | unsigned int pos; |
1930 | int stream = azx_dev->substream->stream; | 1931 | int stream = azx_dev->substream->stream; |
@@ -1940,7 +1941,7 @@ static unsigned int azx_get_position(struct azx *chip, | |||
1940 | default: | 1941 | default: |
1941 | /* use the position buffer */ | 1942 | /* use the position buffer */ |
1942 | pos = le32_to_cpu(*azx_dev->posbuf); | 1943 | pos = le32_to_cpu(*azx_dev->posbuf); |
1943 | if (chip->position_fix[stream] == POS_FIX_AUTO) { | 1944 | if (with_check && chip->position_fix[stream] == POS_FIX_AUTO) { |
1944 | if (!pos || pos == (u32)-1) { | 1945 | if (!pos || pos == (u32)-1) { |
1945 | printk(KERN_WARNING | 1946 | printk(KERN_WARNING |
1946 | "hda-intel: Invalid position buffer, " | 1947 | "hda-intel: Invalid position buffer, " |
@@ -1964,7 +1965,7 @@ static snd_pcm_uframes_t azx_pcm_pointer(struct snd_pcm_substream *substream) | |||
1964 | struct azx *chip = apcm->chip; | 1965 | struct azx *chip = apcm->chip; |
1965 | struct azx_dev *azx_dev = get_azx_dev(substream); | 1966 | struct azx_dev *azx_dev = get_azx_dev(substream); |
1966 | return bytes_to_frames(substream->runtime, | 1967 | return bytes_to_frames(substream->runtime, |
1967 | azx_get_position(chip, azx_dev)); | 1968 | azx_get_position(chip, azx_dev, false)); |
1968 | } | 1969 | } |
1969 | 1970 | ||
1970 | /* | 1971 | /* |
@@ -1987,7 +1988,7 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) | |||
1987 | return -1; /* bogus (too early) interrupt */ | 1988 | return -1; /* bogus (too early) interrupt */ |
1988 | 1989 | ||
1989 | stream = azx_dev->substream->stream; | 1990 | stream = azx_dev->substream->stream; |
1990 | pos = azx_get_position(chip, azx_dev); | 1991 | pos = azx_get_position(chip, azx_dev, true); |
1991 | 1992 | ||
1992 | if (WARN_ONCE(!azx_dev->period_bytes, | 1993 | if (WARN_ONCE(!azx_dev->period_bytes, |
1993 | "hda-intel: zero azx_dev->period_bytes")) | 1994 | "hda-intel: zero azx_dev->period_bytes")) |