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:
parent
161663c247
commit
20a41141c5
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user