aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_intel.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 0a6c55bb7d6b..170610e1d7da 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1890,9 +1890,8 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
1890 unsigned int pos; 1890 unsigned int pos;
1891 int stream; 1891 int stream;
1892 1892
1893 wallclk = azx_readl(chip, WALLCLK); 1893 wallclk = azx_readl(chip, WALLCLK) - azx_dev->start_wallclk;
1894 if ((wallclk - azx_dev->start_wallclk) < 1894 if (wallclk < (azx_dev->period_wallclk * 2) / 3)
1895 (azx_dev->period_wallclk * 2) / 3)
1896 return -1; /* bogus (too early) interrupt */ 1895 return -1; /* bogus (too early) interrupt */
1897 1896
1898 stream = azx_dev->substream->stream; 1897 stream = azx_dev->substream->stream;
@@ -1910,9 +1909,11 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
1910 1909
1911 if (WARN_ONCE(!azx_dev->period_bytes, 1910 if (WARN_ONCE(!azx_dev->period_bytes,
1912 "hda-intel: zero azx_dev->period_bytes")) 1911 "hda-intel: zero azx_dev->period_bytes"))
1913 return 0; /* this shouldn't happen! */ 1912 return -1; /* this shouldn't happen! */
1914 if (pos % azx_dev->period_bytes > azx_dev->period_bytes / 2) 1913 if (wallclk <= azx_dev->period_wallclk &&
1915 return 0; /* NG - it's below the period boundary */ 1914 pos % azx_dev->period_bytes > azx_dev->period_bytes / 2)
1915 /* NG - it's below the first next period boundary */
1916 return bdl_pos_adj[chip->dev_index] ? 0 : -1;
1916 azx_dev->start_wallclk = wallclk; 1917 azx_dev->start_wallclk = wallclk;
1917 return 1; /* OK, it's fine */ 1918 return 1; /* OK, it's fine */
1918} 1919}