Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/rockchip rkiic_wait: fix non-polled mode
details: https://anonhg.NetBSD.org/src/rev/f14a7aa1911f
branches: trunk
changeset: 335517:f14a7aa1911f
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Jan 11 14:59:13 2015 +0000
description:
rkiic_wait: fix non-polled mode
diffstat:
sys/arch/arm/rockchip/rockchip_i2c.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diffs (44 lines):
diff -r 93351fced342 -r f14a7aa1911f sys/arch/arm/rockchip/rockchip_i2c.c
--- a/sys/arch/arm/rockchip/rockchip_i2c.c Sun Jan 11 14:22:53 2015 +0000
+++ b/sys/arch/arm/rockchip/rockchip_i2c.c Sun Jan 11 14:59:13 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rockchip_i2c.c,v 1.5 2015/01/01 22:15:40 jmcneill Exp $ */
+/* $NetBSD: rockchip_i2c.c,v 1.6 2015/01/11 14:59:13 jmcneill Exp $ */
/*-
* Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
#include "opt_rkiic.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rockchip_i2c.c,v 1.5 2015/01/01 22:15:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rockchip_i2c.c,v 1.6 2015/01/11 14:59:13 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -319,16 +319,21 @@
retry = timeout / hz;
while (retry > 0) {
error = cv_timedwait(&sc->sc_cv, &sc->sc_lock, hz);
- if (error && error != EWOULDBLOCK)
- return error;
+ if (error) {
+ if (error != EWOULDBLOCK) {
+ return error;
+ } else {
+ --retry;
+ }
+ }
if (sc->sc_intr_ipd & mask)
return 0;
- --retry;
}
}
#ifdef RKIIC_DEBUG
- device_printf(sc->sc_dev, "%s: ipd %#x\n", __func__, sc->sc_intr_ipd);
+ device_printf(sc->sc_dev, "%s: ipd %#x flags %#x\n", __func__,
+ sc->sc_intr_ipd, flags);
#endif
return ETIMEDOUT;
}
Home |
Main Index |
Thread Index |
Old Index