Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145273286
D54180.1777558282.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54180.1777558282.diff
View Options
diff --git a/sys/arm/allwinner/aw_rtc.c b/sys/arm/allwinner/aw_rtc.c
--- a/sys/arm/allwinner/aw_rtc.c
+++ b/sys/arm/allwinner/aw_rtc.c
@@ -87,7 +87,7 @@
#define HALF_OF_SEC_NS 500000000
#define RTC_RES_US 1000000
-#define RTC_TIMEOUT 70
+#define RTC_TIMEOUT 150
#define RTC_READ(sc, reg) bus_read_4((sc)->res, (reg))
#define RTC_WRITE(sc, reg, val) bus_write_4((sc)->res, (reg), (val))
@@ -321,7 +321,8 @@
{
struct aw_rtc_softc *sc = device_get_softc(dev);
struct clocktime ct;
- uint32_t clk, rdate, rtime;
+ uint32_t rdate, rtime;
+ u_int i;
/* RTC resolution is 1 sec */
if (ts->tv_nsec >= HALF_OF_SEC_NS)
@@ -335,12 +336,12 @@
return (EINVAL);
}
- for (clk = 0; RTC_READ(sc, LOSC_CTRL_REG) & LOSC_BUSY_MASK; clk++) {
- if (clk > RTC_TIMEOUT) {
+ for (i = 0; RTC_READ(sc, LOSC_CTRL_REG) & LOSC_BUSY_MASK; i++) {
+ if (i > RTC_TIMEOUT) {
device_printf(dev, "could not set time, RTC busy\n");
return (EINVAL);
}
- DELAY(1);
+ DELAY(10);
}
/* reset time register to avoid unexpected date increment */
RTC_WRITE(sc, sc->conf->rtc_time, 0);
@@ -352,21 +353,21 @@
rtime = SET_SEC_VALUE(ct.sec) | SET_MIN_VALUE(ct.min) |
SET_HOUR_VALUE(ct.hour);
- for (clk = 0; RTC_READ(sc, LOSC_CTRL_REG) & LOSC_BUSY_MASK; clk++) {
- if (clk > RTC_TIMEOUT) {
+ for (i = 0; RTC_READ(sc, LOSC_CTRL_REG) & LOSC_BUSY_MASK; i++) {
+ if (i > RTC_TIMEOUT) {
device_printf(dev, "could not set date, RTC busy\n");
return (EINVAL);
}
- DELAY(1);
+ DELAY(10);
}
RTC_WRITE(sc, sc->conf->rtc_date, rdate);
- for (clk = 0; RTC_READ(sc, LOSC_CTRL_REG) & LOSC_BUSY_MASK; clk++) {
- if (clk > RTC_TIMEOUT) {
+ for (i = 0; RTC_READ(sc, LOSC_CTRL_REG) & LOSC_BUSY_MASK; i++) {
+ if (i > RTC_TIMEOUT) {
device_printf(dev, "could not set time, RTC busy\n");
return (EINVAL);
}
- DELAY(1);
+ DELAY(10);
}
RTC_WRITE(sc, sc->conf->rtc_time, rtime);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 30, 2:11 PM (9 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28512181
Default Alt Text
D54180.1777558282.diff (1 KB)
Attached To
Mode
D54180: aw_rtc: bump settime() delays
Attached
Detach File
Event Timeline
Log In to Comment