Date: Sun, 13 Mar 2011 21:23:26 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r219624 - head/sys/powerpc/powermac Message-ID: <201103132123.p2DLNQmp066362@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Sun Mar 13 21:23:25 2011 New Revision: 219624 URL: http://svn.freebsd.org/changeset/base/219624 Log: 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 Modified: head/sys/powerpc/powermac/smu.c Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Sun Mar 13 20:02:39 2011 (r219623) +++ head/sys/powerpc/powermac/smu.c Sun Mar 13 21:23:25 2011 (r219624) @@ -1177,7 +1177,7 @@ smu_gettime(device_t dev, struct timespe 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 timespe 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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103132123.p2DLNQmp066362>