summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel A Fernandes <agnel.joel@gmail.com>2011-08-10 22:12:55 -0500
committerKoen Kooi <koen@dominion.thruhere.net>2011-08-11 08:43:38 +0200
commit6c4f3e4a16562c6813e8c6cc9507f1249e2bf877 (patch)
tree77c6af6cf35256a5a98aea7af721effbe87c3153
parent1eb2449fae160cbe7dbfdce06e2f252d818a8a7e (diff)
downloadmeta-ti-6c4f3e4a16562c6813e8c6cc9507f1249e2bf877.tar.gz
linux-3.0: rtc-twl: Updated Sakoman patches with newer versions
This fixes all IRQ kernel panics that were showing up on my BeagleBoard-xM * Refreshed patch that switched to using threaded IRQ (0009-rtc-twl-Switch-to-using-threaded-irq.patch) * Added patch to fix registration vs init order (0010-fix-registration-vs-init-order.patch) * Modified batter recharge patch to be applyable with the other changes (0014-rtc-twl-add-support-for-backup-battery-recharge.patch) Summary of patches added/updated: [PATCH 1/2] rtc: twl: Use threaded IRQ, remove IRQ enable in interrupt handler [PATCH 2/2] rtc: twl: Fix registration vs. init order kernel.org patchwork links: http://www.spinics.net/lists/linux-omap/msg54794.html http://www.mail-archive.com/linux-omap@vger.kernel.org/msg53176.html Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
-rw-r--r--recipes-kernel/linux/linux-3.0/sakoman/0009-rtc-twl-Switch-to-using-threaded-irq.patch62
-rw-r--r--recipes-kernel/linux/linux-3.0/sakoman/0010-fix-registration-vs-init-order.patch128
-rw-r--r--recipes-kernel/linux/linux-3.0/sakoman/0014-rtc-twl-add-support-for-backup-battery-recharge.patch (renamed from recipes-kernel/linux/linux-3.0/sakoman/0010-rtc-twl-add-support-for-backup-battery-recharge.patch)20
-rw-r--r--recipes-kernel/linux/linux_3.0.bb5
4 files changed, 190 insertions, 25 deletions
diff --git a/recipes-kernel/linux/linux-3.0/sakoman/0009-rtc-twl-Switch-to-using-threaded-irq.patch b/recipes-kernel/linux/linux-3.0/sakoman/0009-rtc-twl-Switch-to-using-threaded-irq.patch
index 59e1f374..750bec8b 100644
--- a/recipes-kernel/linux/linux-3.0/sakoman/0009-rtc-twl-Switch-to-using-threaded-irq.patch
+++ b/recipes-kernel/linux/linux-3.0/sakoman/0009-rtc-twl-Switch-to-using-threaded-irq.patch
@@ -1,25 +1,61 @@
1From 61f6890ed80c09e40841221d238410a8d9ebace6 Mon Sep 17 00:00:00 2001 1From patchwork Wed Jul 27 07:07:20 2011
2From: Ilkka Koskinen <ilkka.koskinen@nokia.com> 2Subject: [1/2] rtc: twl: Use threaded IRQ,
3Date: Wed, 16 Mar 2011 16:07:14 +0000 3 remove IRQ enable in interrupt handler
4Subject: [PATCH 09/13] rtc-twl: Switch to using threaded irq 4Date: Wed, 27 Jul 2011 07:07:20 -0000
5From: Todd Poynor <toddpoynor@google.com>
6X-Patchwork-Id: 1010862
7Message-Id: <1311750441-5559-1-git-send-email-toddpoynor@google.com>
8To: Alessandro Zummo <a.zummo@towertech.it>
9Cc: rtc-linux@googlegroups.com, linux-omap@vger.kernel.org,
10 linux-kernel@vger.kernel.org, Todd Poynor <toddpoynor@google.com>
11
12IRQs disabled on entry to twl_rtc_interrupt is not a consequence
13of LOCKDEP; both twl6030 and twl4030 explicitly disable IRQs
14before calling the module IRQ handlers.
15
16The ISR should not be enabling IRQs; use a threaded IRQ handler
17instead.
18
19Also fixes warnings:
20
21 WARNING: at kernel/irq/handle.c:130 handle_irq_event_percpu+nnn
22 irq nnn handler twl_rtc_interrupt+nnn enabled interrupts
23
24Signed-off-by: Todd Poynor <toddpoynor@google.com>
5 25
6--- 26---
7 drivers/rtc/rtc-twl.c | 2 +- 27drivers/rtc/rtc-twl.c | 14 +++-----------
8 1 files changed, 1 insertions(+), 1 deletions(-) 28 1 files changed, 3 insertions(+), 11 deletions(-)
9 29
10diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c 30diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
11index f9a2799..f3e5045 100644 31index 9a81f77..ece41b9 100644
12--- a/drivers/rtc/rtc-twl.c 32--- a/drivers/rtc/rtc-twl.c
13+++ b/drivers/rtc/rtc-twl.c 33+++ b/drivers/rtc/rtc-twl.c
14@@ -462,7 +462,7 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev) 34@@ -362,14 +362,6 @@ static irqreturn_t twl_rtc_interrupt(int irq, void *rtc)
35 int res;
36 u8 rd_reg;
37
38-#ifdef CONFIG_LOCKDEP
39- /* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which
40- * we don't want and can't tolerate. Although it might be
41- * friendlier not to borrow this thread context...
42- */
43- local_irq_enable();
44-#endif
45-
46 res = twl_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG);
47 if (res)
48 goto out;
49@@ -462,9 +454,9 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
15 if (ret < 0) 50 if (ret < 0)
16 goto out1; 51 goto out1;
17 52
18- ret = request_irq(irq, twl_rtc_interrupt, 53- ret = request_irq(irq, twl_rtc_interrupt,
54- IRQF_TRIGGER_RISING,
55- dev_name(&rtc->dev), rtc);
19+ ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt, 56+ ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt,
20 IRQF_TRIGGER_RISING, 57+ IRQF_TRIGGER_RISING,
21 dev_name(&rtc->dev), rtc); 58+ dev_name(&rtc->dev), rtc);
22 if (ret < 0) { 59 if (ret < 0) {
23-- 60 dev_err(&pdev->dev, "IRQ is not free.\n");
241.6.6.1 61 goto out1;
25
diff --git a/recipes-kernel/linux/linux-3.0/sakoman/0010-fix-registration-vs-init-order.patch b/recipes-kernel/linux/linux-3.0/sakoman/0010-fix-registration-vs-init-order.patch
new file mode 100644
index 00000000..16aab35d
--- /dev/null
+++ b/recipes-kernel/linux/linux-3.0/sakoman/0010-fix-registration-vs-init-order.patch
@@ -0,0 +1,128 @@
1From patchwork Wed Jul 27 07:07:21 2011
2Content-Type: text/plain; charset="utf-8"
3MIME-Version: 1.0
4Content-Transfer-Encoding: 7bit
5Subject: [2/2] rtc: twl: Fix registration vs. init order
6Date: Wed, 27 Jul 2011 07:07:21 -0000
7From: Todd Poynor <toddpoynor@google.com>
8X-Patchwork-Id: 1010892
9Message-Id: <1311750441-5559-2-git-send-email-toddpoynor@google.com>
10To: Alessandro Zummo <a.zummo@towertech.it>
11Cc: rtc-linux@googlegroups.com, linux-omap@vger.kernel.org,
12 linux-kernel@vger.kernel.org, Todd Poynor <toddpoynor@google.com>
13
14Only register as an RTC device after the hardware has been
15successfully initialized. The RTC class driver will call
16back to this driver to read a pending alarm, and other
17drivers watching for new devices on the RTC class may
18read the RTC time upon registration. Such access might
19occur while the RTC is stopped, prior to clearing
20pending alarms, etc.
21
22The new ordering also avoids leaving the platform
23device drvdata set to an unregistered struct rtc_device *
24on probe errors.
25
26Signed-off-by: Todd Poynor <toddpoynor@google.com>
27
28---
29drivers/rtc/rtc-twl.c | 52 ++++++++++++++++++++++--------------------------
30 1 files changed, 24 insertions(+), 28 deletions(-)
31
32diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
33index ece41b9..20687d5 100644
34--- a/drivers/rtc/rtc-twl.c
35+++ b/drivers/rtc/rtc-twl.c
36@@ -420,24 +420,12 @@ static struct rtc_class_ops twl_rtc_ops = {
37 static int __devinit twl_rtc_probe(struct platform_device *pdev)
38 {
39 struct rtc_device *rtc;
40- int ret = 0;
41+ int ret = -EINVAL;
42 int irq = platform_get_irq(pdev, 0);
43 u8 rd_reg;
44
45 if (irq <= 0)
46- return -EINVAL;
47-
48- rtc = rtc_device_register(pdev->name,
49- &pdev->dev, &twl_rtc_ops, THIS_MODULE);
50- if (IS_ERR(rtc)) {
51- ret = PTR_ERR(rtc);
52- dev_err(&pdev->dev, "can't register RTC device, err %ld\n",
53- PTR_ERR(rtc));
54- goto out0;
55-
56- }
57-
58- platform_set_drvdata(pdev, rtc);
59+ goto out1;
60
61 ret = twl_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG);
62 if (ret < 0)
63@@ -454,14 +442,6 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
64 if (ret < 0)
65 goto out1;
66
67- ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt,
68- IRQF_TRIGGER_RISING,
69- dev_name(&rtc->dev), rtc);
70- if (ret < 0) {
71- dev_err(&pdev->dev, "IRQ is not free.\n");
72- goto out1;
73- }
74-
75 if (twl_class_is_6030()) {
76 twl6030_interrupt_unmask(TWL6030_RTC_INT_MASK,
77 REG_INT_MSK_LINE_A);
78@@ -472,28 +452,44 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
79 /* Check RTC module status, Enable if it is off */
80 ret = twl_rtc_read_u8(&rd_reg, REG_RTC_CTRL_REG);
81 if (ret < 0)
82- goto out2;
83+ goto out1;
84
85 if (!(rd_reg & BIT_RTC_CTRL_REG_STOP_RTC_M)) {
86 dev_info(&pdev->dev, "Enabling TWL-RTC.\n");
87 rd_reg = BIT_RTC_CTRL_REG_STOP_RTC_M;
88 ret = twl_rtc_write_u8(rd_reg, REG_RTC_CTRL_REG);
89 if (ret < 0)
90- goto out2;
91+ goto out1;
92 }
93
94 /* init cached IRQ enable bits */
95 ret = twl_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG);
96 if (ret < 0)
97+ goto out1;
98+
99+ rtc = rtc_device_register(pdev->name,
100+ &pdev->dev, &twl_rtc_ops, THIS_MODULE);
101+ if (IS_ERR(rtc)) {
102+ ret = PTR_ERR(rtc);
103+ dev_err(&pdev->dev, "can't register RTC device, err %ld\n",
104+ PTR_ERR(rtc));
105+ goto out1;
106+ }
107+
108+ ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt,
109+ IRQF_TRIGGER_RISING,
110+ dev_name(&rtc->dev), rtc);
111+ if (ret < 0) {
112+ dev_err(&pdev->dev, "IRQ is not free.\n");
113 goto out2;
114+ }
115
116- return ret;
117+ platform_set_drvdata(pdev, rtc);
118+ return 0;
119
120 out2:
121- free_irq(irq, rtc);
122-out1:
123 rtc_device_unregister(rtc);
124-out0:
125+out1:
126 return ret;
127 }
128
diff --git a/recipes-kernel/linux/linux-3.0/sakoman/0010-rtc-twl-add-support-for-backup-battery-recharge.patch b/recipes-kernel/linux/linux-3.0/sakoman/0014-rtc-twl-add-support-for-backup-battery-recharge.patch
index 7afbf33b..270d0af3 100644
--- a/recipes-kernel/linux/linux-3.0/sakoman/0010-rtc-twl-add-support-for-backup-battery-recharge.patch
+++ b/recipes-kernel/linux/linux-3.0/sakoman/0014-rtc-twl-add-support-for-backup-battery-recharge.patch
@@ -7,14 +7,16 @@ Subject: [PATCH 10/13] rtc-twl: add support for backup battery recharge
7 drivers/rtc/rtc-twl.c | 25 +++++++++++++++++++++++++ 7 drivers/rtc/rtc-twl.c | 25 +++++++++++++++++++++++++
8 1 files changed, 25 insertions(+), 0 deletions(-) 8 1 files changed, 25 insertions(+), 0 deletions(-)
9 9
10
10diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c 11diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
11index f3e5045..1fe1bc9 100644 12index a64494e..552446b 100644
12--- a/drivers/rtc/rtc-twl.c 13--- a/drivers/rtc/rtc-twl.c
13+++ b/drivers/rtc/rtc-twl.c 14+++ b/drivers/rtc/rtc-twl.c
14@@ -30,6 +30,23 @@ 15@@ -30,7 +30,24 @@
15 16
16 #include <linux/i2c/twl.h> 17 #include <linux/i2c/twl.h>
17 18
19-
18+/* 20+/*
19+ * PM_RECEIVER block register offsets (use TWL4030_MODULE_PM_RECEIVER) 21+ * PM_RECEIVER block register offsets (use TWL4030_MODULE_PM_RECEIVER)
20+ */ 22+ */
@@ -32,12 +34,13 @@ index f3e5045..1fe1bc9 100644
32+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_150UA 0x01 34+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_150UA 0x01
33+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_500UA 0x02 35+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_500UA 0x02
34+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_1MA 0x03 36+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_1MA 0x03
35 37+
36 /* 38 /*
37 * RTC block register offsets (use TWL_MODULE_RTC) 39 * RTC block register offsets (use TWL_MODULE_RTC)
38@@ -495,6 +512,14 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev) 40 */
39 if (ret < 0) 41@@ -484,6 +501,14 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
40 goto out2; 42 goto out2;
43 }
41 44
42+ /* enable backup battery charging */ 45+ /* enable backup battery charging */
43+ /* use a conservative 25uA @ 3.1V */ 46+ /* use a conservative 25uA @ 3.1V */
@@ -47,9 +50,6 @@ index f3e5045..1fe1bc9 100644
47+ BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA, 50+ BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA,
48+ REG_BB_CFG); 51+ REG_BB_CFG);
49+ 52+
50 return ret; 53 platform_set_drvdata(pdev, rtc);
51 54 return 0;
52 out2:
53--
541.6.6.1
55 55
diff --git a/recipes-kernel/linux/linux_3.0.bb b/recipes-kernel/linux/linux_3.0.bb
index edb8df79..718b6af0 100644
--- a/recipes-kernel/linux/linux_3.0.bb
+++ b/recipes-kernel/linux/linux_3.0.bb
@@ -9,7 +9,7 @@ COMPATIBLE_MACHINE = "(beagleboard)"
9SRCREV_pn-${PN} = "94ed5b4788a7cdbe68bc7cb8516972cbebdc8274" 9SRCREV_pn-${PN} = "94ed5b4788a7cdbe68bc7cb8516972cbebdc8274"
10 10
11# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc 11# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
12MACHINE_KERNEL_PR_append = "k" 12MACHINE_KERNEL_PR_append = "m"
13 13
14FILESPATHPKG_prepend = "linux-3.0:" 14FILESPATHPKG_prepend = "linux-3.0:"
15 15
@@ -208,10 +208,11 @@ SRC_URI += "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-3.0.y.git
208 file://sakoman/0007-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch \ 208 file://sakoman/0007-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch \
209 file://sakoman/0008-Revert-omap2_mcspi-Flush-posted-writes.patch \ 209 file://sakoman/0008-Revert-omap2_mcspi-Flush-posted-writes.patch \
210 file://sakoman/0009-rtc-twl-Switch-to-using-threaded-irq.patch \ 210 file://sakoman/0009-rtc-twl-Switch-to-using-threaded-irq.patch \
211 file://sakoman/0010-rtc-twl-add-support-for-backup-battery-recharge.patch \ 211 file://sakoman/0010-fix-registration-vs-init-order.patch \
212 file://sakoman/0011-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch \ 212 file://sakoman/0011-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch \
213 file://sakoman/0012-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch \ 213 file://sakoman/0012-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch \
214 file://sakoman/0013-omap-mmc-twl4030-move-clock-input-selection-prior-to.patch \ 214 file://sakoman/0013-omap-mmc-twl4030-move-clock-input-selection-prior-to.patch \
215 file://sakoman/0014-rtc-twl-add-support-for-backup-battery-recharge.patch \
215 \ 216 \
216 file://sgx/0001-ARM-L2-Add-and-export-outer_clean_all.patch \ 217 file://sgx/0001-ARM-L2-Add-and-export-outer_clean_all.patch \
217 file://defconfig" 218 file://defconfig"