linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gnss: sirf: fix activation retry handling
@ 2018-12-05 10:21 Johan Hovold
  2018-12-09 19:58 ` Andreas Kemnade
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Hovold @ 2018-12-05 10:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andreas Kemnade, Johan Hovold, stable

Fix activation helper which would return -ETIMEDOUT even if the last
retry attempt was successful.

Also change the semantics of the retries variable so that it actually
holds the number of retries (rather than tries).

Fixes: d2efbbd18b1e ("gnss: add driver for sirfstar-based receivers")
Cc: stable <stable@vger.kernel.org>	# 4.19
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/gnss/sirf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gnss/sirf.c b/drivers/gnss/sirf.c
index 71d014edd167..2c22836d3ffd 100644
--- a/drivers/gnss/sirf.c
+++ b/drivers/gnss/sirf.c
@@ -168,7 +168,7 @@ static int sirf_set_active(struct sirf_data *data, bool active)
 	else
 		timeout = SIRF_HIBERNATE_TIMEOUT;
 
-	while (retries-- > 0) {
+	do {
 		sirf_pulse_on_off(data);
 		ret = sirf_wait_for_power_state(data, active, timeout);
 		if (ret < 0) {
@@ -179,9 +179,9 @@ static int sirf_set_active(struct sirf_data *data, bool active)
 		}
 
 		break;
-	}
+	} while (retries--);
 
-	if (retries == 0)
+	if (retries < 0)
 		return -ETIMEDOUT;
 
 	return 0;
-- 
2.19.2


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

* Re: [PATCH] gnss: sirf: fix activation retry handling
  2018-12-05 10:21 [PATCH] gnss: sirf: fix activation retry handling Johan Hovold
@ 2018-12-09 19:58 ` Andreas Kemnade
  2018-12-13 13:34   ` Johan Hovold
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Kemnade @ 2018-12-09 19:58 UTC (permalink / raw)
  To: Johan Hovold, stable, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

Hi,

On Wed,  5 Dec 2018 11:21:49 +0100
Johan Hovold <johan@kernel.org> wrote:

> Fix activation helper which would return -ETIMEDOUT even if the last
> retry attempt was successful.
> 
> Also change the semantics of the retries variable so that it actually
> holds the number of retries (rather than tries).
> 
Sounds sane. I rebased my patch series on top of it and improved my
testing script (the manual on/off toggle in between was not working
properly)

Regards,
Andreas

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] gnss: sirf: fix activation retry handling
  2018-12-09 19:58 ` Andreas Kemnade
@ 2018-12-13 13:34   ` Johan Hovold
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2018-12-13 13:34 UTC (permalink / raw)
  To: Andreas Kemnade; +Cc: Johan Hovold, stable, linux-kernel

On Sun, Dec 09, 2018 at 08:58:02PM +0100, Andreas Kemnade wrote:
> Hi,
> 
> On Wed,  5 Dec 2018 11:21:49 +0100
> Johan Hovold <johan@kernel.org> wrote:
> 
> > Fix activation helper which would return -ETIMEDOUT even if the last
> > retry attempt was successful.
> > 
> > Also change the semantics of the retries variable so that it actually
> > holds the number of retries (rather than tries).

> Sounds sane. I rebased my patch series on top of it and improved my
> testing script (the manual on/off toggle in between was not working
> properly)

That's great. And thanks for testing. I'm a bit short on time at the
moment, but will try to take at least a quick look at your v2 today.

Johan

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

end of thread, other threads:[~2018-12-13 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 10:21 [PATCH] gnss: sirf: fix activation retry handling Johan Hovold
2018-12-09 19:58 ` Andreas Kemnade
2018-12-13 13:34   ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).