From: Greg Kroah-Hartman Date: Tue, 11 Feb 2014 18:07:12 +0000 (-0800) Subject: 3.13-stable patches X-Git-Tag: v3.4.80~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4362f6e88f81c25871d5c153a79f3b8fbd5e51c7;p=thirdparty%2Fkernel%2Fstable-queue.git 3.13-stable patches added patches: rtc-cmos-add-an-alarm-disable-quirk.patch --- diff --git a/queue-3.13/rtc-cmos-add-an-alarm-disable-quirk.patch b/queue-3.13/rtc-cmos-add-an-alarm-disable-quirk.patch new file mode 100644 index 00000000000..ded11f9dd26 --- /dev/null +++ b/queue-3.13/rtc-cmos-add-an-alarm-disable-quirk.patch @@ -0,0 +1,125 @@ +From d5a1c7e3fc38d9c7d629e1e47f32f863acbdec3d Mon Sep 17 00:00:00 2001 +From: Borislav Petkov +Date: Sat, 20 Jul 2013 19:00:23 +0200 +Subject: rtc-cmos: Add an alarm disable quirk + +From: Borislav Petkov + +commit d5a1c7e3fc38d9c7d629e1e47f32f863acbdec3d upstream. + +41c7f7424259f ("rtc: Disable the alarm in the hardware (v2)") added the +functionality to disable the RTC wake alarm when shutting down the box. + +However, there are at least two b0rked BIOSes we know about: + +https://bugzilla.novell.com/show_bug.cgi?id=812592 +https://bugzilla.novell.com/show_bug.cgi?id=805740 + +where, when wakeup alarm is enabled in the BIOS, the machine reboots +automatically right after shutdown, regardless of what wakeup time is +programmed. + +Bisecting the issue lead to this patch so disable its functionality with +a DMI quirk only for those boxes. + +Cc: Brecht Machiels +Cc: Thomas Gleixner +Cc: John Stultz +Cc: Rabin Vincent +Signed-off-by: Borislav Petkov +[jstultz: Changed variable name for clarity, added extra dmi entry] +Tested-by: Brecht Machiels +Tested-by: Borislav Petkov +Signed-off-by: John Stultz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/rtc/rtc-cmos.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 51 insertions(+), 1 deletion(-) + +--- a/drivers/rtc/rtc-cmos.c ++++ b/drivers/rtc/rtc-cmos.c +@@ -34,11 +34,11 @@ + #include + #include + #include +-#include + #include + #include + #include + #include ++#include + + /* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */ + #include +@@ -377,6 +377,51 @@ static int cmos_set_alarm(struct device + return 0; + } + ++/* ++ * Do not disable RTC alarm on shutdown - workaround for b0rked BIOSes. ++ */ ++static bool alarm_disable_quirk; ++ ++static int __init set_alarm_disable_quirk(const struct dmi_system_id *id) ++{ ++ alarm_disable_quirk = true; ++ pr_info("rtc-cmos: BIOS has alarm-disable quirk. "); ++ pr_info("RTC alarms disabled\n"); ++ return 0; ++} ++ ++static const struct dmi_system_id rtc_quirks[] __initconst = { ++ /* https://bugzilla.novell.com/show_bug.cgi?id=805740 */ ++ { ++ .callback = set_alarm_disable_quirk, ++ .ident = "IBM Truman", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "4852570"), ++ }, ++ }, ++ /* https://bugzilla.novell.com/show_bug.cgi?id=812592 */ ++ { ++ .callback = set_alarm_disable_quirk, ++ .ident = "Gigabyte GA-990XA-UD3", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, ++ "Gigabyte Technology Co., Ltd."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "GA-990XA-UD3"), ++ }, ++ }, ++ /* http://permalink.gmane.org/gmane.linux.kernel/1604474 */ ++ { ++ .callback = set_alarm_disable_quirk, ++ .ident = "Toshiba Satellite L300", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L300"), ++ }, ++ }, ++ {} ++}; ++ + static int cmos_alarm_irq_enable(struct device *dev, unsigned int enabled) + { + struct cmos_rtc *cmos = dev_get_drvdata(dev); +@@ -385,6 +430,9 @@ static int cmos_alarm_irq_enable(struct + if (!is_valid_irq(cmos->irq)) + return -EINVAL; + ++ if (alarm_disable_quirk) ++ return 0; ++ + spin_lock_irqsave(&rtc_lock, flags); + + if (enabled) +@@ -1157,6 +1205,8 @@ static int __init cmos_init(void) + platform_driver_registered = true; + } + ++ dmi_check_system(rtc_quirks); ++ + if (retval == 0) + return 0; + diff --git a/queue-3.13/series b/queue-3.13/series index e50210e0212..906bccdfda2 100644 --- a/queue-3.13/series +++ b/queue-3.13/series @@ -115,3 +115,4 @@ timekeeping-avoid-possible-deadlock-from-clock_was_set_delayed.patch 3.13.y-timekeeping-fix-clock_set-clock_was_set-think-o.patch timekeeping-fix-clock_tai-timer-nanosleep-delays.patch timekeeping-fix-missing-timekeeping_update-in-suspend-path.patch +rtc-cmos-add-an-alarm-disable-quirk.patch