Don't sleep while setting the clock. This can cause panics when

periodic_resettodr() calls CLOCK_SETTIME() and smu tries to sleep while
running from a callout.

Reported by:	Torfinn Ingolfsen
This commit is contained in:
nwhitehorn 2011-03-13 21:23:25 +00:00
parent 161663c247
commit 20a41141c5

View File

@ -1177,7 +1177,7 @@ smu_gettime(device_t dev, struct timespec *ts)
static int
smu_settime(device_t dev, struct timespec *ts)
{
struct smu_cmd cmd;
static struct smu_cmd cmd;
struct clocktime ct;
cmd.cmd = SMU_RTC;
@ -1194,7 +1194,7 @@ smu_settime(device_t dev, struct timespec *ts)
cmd.data[6] = bin2bcd(ct.mon);
cmd.data[7] = bin2bcd(ct.year - 2000);
return (smu_run_cmd(dev, &cmd, 1));
return (smu_run_cmd(dev, &cmd, 0));
}
/* SMU I2C Interface */