diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-01-15 03:08:38 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-01-15 13:46:04 -0500 |
commit | 123af9043e93cb6f235207d260d50f832cdb5439 (patch) | |
tree | d27f6078e32e9917616d2e67ffa52276d709a705 /sound/soc/au1x | |
parent | 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff) |
ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()
The loop timeout doesn't work because it's a post op and ends with "tmo"
set to -1. I changed it from a post-op to a pre-op and I changed the
initial the starting value from 5 to 6 so we still iterate 5 times. I
left the other as it was because it's a large number.
Fixes: b3c70c9ea62a ("ASoC: Alchemy AC97C/I2SC audio support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/au1x')
-rw-r--r-- | sound/soc/au1x/ac97c.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/au1x/ac97c.c b/sound/soc/au1x/ac97c.c index 29a97d52e8ad..66d6c52e7761 100644 --- a/sound/soc/au1x/ac97c.c +++ b/sound/soc/au1x/ac97c.c | |||
@@ -91,8 +91,8 @@ static unsigned short au1xac97c_ac97_read(struct snd_ac97 *ac97, | |||
91 | do { | 91 | do { |
92 | mutex_lock(&ctx->lock); | 92 | mutex_lock(&ctx->lock); |
93 | 93 | ||
94 | tmo = 5; | 94 | tmo = 6; |
95 | while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--) | 95 | while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo) |
96 | udelay(21); /* wait an ac97 frame time */ | 96 | udelay(21); /* wait an ac97 frame time */ |
97 | if (!tmo) { | 97 | if (!tmo) { |
98 | pr_debug("ac97rd timeout #1\n"); | 98 | pr_debug("ac97rd timeout #1\n"); |
@@ -105,7 +105,7 @@ static unsigned short au1xac97c_ac97_read(struct snd_ac97 *ac97, | |||
105 | * poll, Forrest, poll... | 105 | * poll, Forrest, poll... |
106 | */ | 106 | */ |
107 | tmo = 0x10000; | 107 | tmo = 0x10000; |
108 | while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--) | 108 | while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo) |
109 | asm volatile ("nop"); | 109 | asm volatile ("nop"); |
110 | data = RD(ctx, AC97_CMDRESP); | 110 | data = RD(ctx, AC97_CMDRESP); |
111 | 111 | ||