All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()
@ 2018-01-15  8:08 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2018-01-15  8:08 UTC (permalink / raw)
  To: Liam Girdwood, Manuel Lauss
  Cc: alsa-devel, Mark Brown, kernel-janitors, Takashi Iwai

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>

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,
 	do {
 		mutex_lock(&ctx->lock);
 
-		tmo = 5;
-		while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--)
+		tmo = 6;
+		while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo)
 			udelay(21);	/* wait an ac97 frame time */
 		if (!tmo) {
 			pr_debug("ac97rd timeout #1\n");
@@ -105,7 +105,7 @@ static unsigned short au1xac97c_ac97_read(struct snd_ac97 *ac97,
 		 * poll, Forrest, poll...
 		 */
 		tmo = 0x10000;
-		while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--)
+		while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo)
 			asm volatile ("nop");
 		data = RD(ctx, AC97_CMDRESP);
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()
@ 2018-01-15  8:08 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2018-01-15  8:08 UTC (permalink / raw)
  To: Liam Girdwood, Manuel Lauss
  Cc: alsa-devel, Mark Brown, kernel-janitors, Takashi Iwai

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>

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,
 	do {
 		mutex_lock(&ctx->lock);
 
-		tmo = 5;
-		while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--)
+		tmo = 6;
+		while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo)
 			udelay(21);	/* wait an ac97 frame time */
 		if (!tmo) {
 			pr_debug("ac97rd timeout #1\n");
@@ -105,7 +105,7 @@ static unsigned short au1xac97c_ac97_read(struct snd_ac97 *ac97,
 		 * poll, Forrest, poll...
 		 */
 		tmo = 0x10000;
-		while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--)
+		while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo)
 			asm volatile ("nop");
 		data = RD(ctx, AC97_CMDRESP);
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()
  2018-01-15  8:08 ` Dan Carpenter
@ 2018-01-15  8:25   ` Manuel Lauss
  -1 siblings, 0 replies; 8+ messages in thread
From: Manuel Lauss @ 2018-01-15  8:25 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Liam Girdwood, Manuel Lauss, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, kernel-janitors

On Mon, Jan 15, 2018 at 9:08 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>

Ackey-by: Manuel Lauss <manuel.lauss@gmail.com>

I didn't notice any failures with latest -git though, I've never
actually hit these
timeouts, even under maximum CPU load.

Manuel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()
@ 2018-01-15  8:25   ` Manuel Lauss
  0 siblings, 0 replies; 8+ messages in thread
From: Manuel Lauss @ 2018-01-15  8:25 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Liam Girdwood, Manuel Lauss, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, kernel-janitors

On Mon, Jan 15, 2018 at 9:08 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>

Ackey-by: Manuel Lauss <manuel.lauss@gmail.com>

I didn't notice any failures with latest -git though, I've never
actually hit these
timeouts, even under maximum CPU load.

Manuel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()
  2018-01-15  8:25   ` Manuel Lauss
@ 2018-01-15  8:37     ` Dan Carpenter
  -1 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2018-01-15  8:37 UTC (permalink / raw)
  To: Manuel Lauss
  Cc: alsa-devel, kernel-janitors, Takashi Iwai, Liam Girdwood,
	Manuel Lauss, Mark Brown

On Mon, Jan 15, 2018 at 09:25:15AM +0100, Manuel Lauss wrote:
> On Mon, Jan 15, 2018 at 9:08 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > 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>
> 
> Ackey-by: Manuel Lauss <manuel.lauss@gmail.com>
> 
> I didn't notice any failures with latest -git though, I've never
> actually hit these
> timeouts, even under maximum CPU load.
> 

Yeah.  These are static checker fixes, not something I hit in real life.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()
@ 2018-01-15  8:37     ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2018-01-15  8:37 UTC (permalink / raw)
  To: Manuel Lauss
  Cc: alsa-devel, kernel-janitors, Takashi Iwai, Liam Girdwood,
	Manuel Lauss, Mark Brown

On Mon, Jan 15, 2018 at 09:25:15AM +0100, Manuel Lauss wrote:
> On Mon, Jan 15, 2018 at 9:08 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > 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>
> 
> Ackey-by: Manuel Lauss <manuel.lauss@gmail.com>
> 
> I didn't notice any failures with latest -git though, I've never
> actually hit these
> timeouts, even under maximum CPU load.
> 

Yeah.  These are static checker fixes, not something I hit in real life.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Applied "ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()" to the asoc tree
  2018-01-15  8:08 ` Dan Carpenter
@ 2018-01-16 13:57   ` Mark Brown
  -1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2018-01-16 13:57 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Mark Brown, Liam Girdwood, Manuel Lauss, alsa-devel

The patch

   ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 123af9043e93cb6f235207d260d50f832cdb5439 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Mon, 15 Jan 2018 11:08:38 +0300
Subject: [PATCH] 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>
---
 sound/soc/au1x/ac97c.c | 6 +++---
 1 file 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,
 	do {
 		mutex_lock(&ctx->lock);
 
-		tmo = 5;
-		while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--)
+		tmo = 6;
+		while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo)
 			udelay(21);	/* wait an ac97 frame time */
 		if (!tmo) {
 			pr_debug("ac97rd timeout #1\n");
@@ -105,7 +105,7 @@ static unsigned short au1xac97c_ac97_read(struct snd_ac97 *ac97,
 		 * poll, Forrest, poll...
 		 */
 		tmo = 0x10000;
-		while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--)
+		while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo)
 			asm volatile ("nop");
 		data = RD(ctx, AC97_CMDRESP);
 
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Applied "ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()" to the asoc tree
@ 2018-01-16 13:57   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2018-01-16 13:57 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Mark Brown, Liam Girdwood, Manuel Lauss, alsa-devel

The patch

   ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 123af9043e93cb6f235207d260d50f832cdb5439 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Mon, 15 Jan 2018 11:08:38 +0300
Subject: [PATCH] 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>
---
 sound/soc/au1x/ac97c.c | 6 +++---
 1 file 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,
 	do {
 		mutex_lock(&ctx->lock);
 
-		tmo = 5;
-		while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--)
+		tmo = 6;
+		while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo)
 			udelay(21);	/* wait an ac97 frame time */
 		if (!tmo) {
 			pr_debug("ac97rd timeout #1\n");
@@ -105,7 +105,7 @@ static unsigned short au1xac97c_ac97_read(struct snd_ac97 *ac97,
 		 * poll, Forrest, poll...
 		 */
 		tmo = 0x10000;
-		while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--)
+		while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo)
 			asm volatile ("nop");
 		data = RD(ctx, AC97_CMDRESP);
 
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-01-16 13:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-15  8:08 [PATCH] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() Dan Carpenter
2018-01-15  8:08 ` Dan Carpenter
2018-01-15  8:25 ` Manuel Lauss
2018-01-15  8:25   ` Manuel Lauss
2018-01-15  8:37   ` Dan Carpenter
2018-01-15  8:37     ` Dan Carpenter
2018-01-16 13:57 ` Applied "ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()" to the asoc tree Mark Brown
2018-01-16 13:57   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.