[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-de97a21a23dda34f1754a748560dede139e6bfc2@git.kernel.org>
Date: Thu, 7 Apr 2011 09:48:56 GMT
From: tip-bot for Feng Tang <feng.tang@...el.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, alan@...ux.intel.com, hpa@...or.com,
mingo@...hat.com, torvalds@...ux-foundation.org,
john.stultz@...aro.org, tglx@...utronix.de, feng.tang@...el.com,
a.zummo@...ertech.it, mingo@...e.hu
Subject: [tip:timers/urgent] rtc, x86/mrst/vrtc: Fix boot crash in rtc_read_alarm()
Commit-ID: de97a21a23dda34f1754a748560dede139e6bfc2
Gitweb: http://git.kernel.org/tip/de97a21a23dda34f1754a748560dede139e6bfc2
Author: Feng Tang <feng.tang@...el.com>
AuthorDate: Thu, 7 Apr 2011 09:39:44 +0800
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Thu, 7 Apr 2011 11:27:42 +0200
rtc, x86/mrst/vrtc: Fix boot crash in rtc_read_alarm()
Commit f44f7f96a20 ("RTC: Initialize kernel state from RTC") caused a
boot regression on the MRST platform.
The reason is that rtc_device_register() calls rtc_read_alarm() after
that change, which function does not have all driver data set up yet.
The rtc-mrst driver needs to call dev_set_drvdata() before rtc_device_register()
gets called.
Signed-off-by: Feng Tang <feng.tang@...el.com>
Signed-off-by: Alan Cox <alan@...ux.intel.com>
Acked-by: John Stultz <john.stultz@...aro.org>
Cc: Alessandro Zummo <a.zummo@...ertech.it>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Link: http://lkml.kernel.org/r/1302140384-27571-1-git-send-email-feng.tang@intel.com
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
drivers/rtc/rtc-mrst.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c
index 332a2c4..b2f0968 100644
--- a/drivers/rtc/rtc-mrst.c
+++ b/drivers/rtc/rtc-mrst.c
@@ -342,6 +342,8 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq)
mrst_rtc.irq = rtc_irq;
mrst_rtc.iomem = iomem;
+ mrst_rtc.dev = dev;
+ dev_set_drvdata(dev, &mrst_rtc);
mrst_rtc.rtc = rtc_device_register(driver_name, dev,
&mrst_rtc_ops, THIS_MODULE);
@@ -350,8 +352,6 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq)
goto cleanup0;
}
- mrst_rtc.dev = dev;
- dev_set_drvdata(dev, &mrst_rtc);
rename_region(iomem, dev_name(&mrst_rtc.rtc->dev));
spin_lock_irq(&rtc_lock);
@@ -376,9 +376,10 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq)
return 0;
cleanup1:
- mrst_rtc.dev = NULL;
rtc_device_unregister(mrst_rtc.rtc);
cleanup0:
+ dev_set_drvdata(dev, NULL);
+ mrst_rtc.dev = NULL;
release_region(iomem->start, iomem->end + 1 - iomem->start);
dev_err(dev, "rtc-mrst: unable to initialise\n");
return retval;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists