* [PATCH v3] MFD: ab8500: pass AB8500 IRQ to debugfs code by resource
@ 2013-04-15 7:47 Linus Walleij
2013-04-18 22:33 ` Samuel Ortiz
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2013-04-15 7:47 UTC (permalink / raw)
To: Samuel Ortiz, linux-kernel; +Cc: Anmar Oueja, Linus Walleij, Arnd Bergmann
From: Linus Walleij <linus.walleij@linaro.org>
The AB8500 debug code which was merged in parallel with the
multiplatform work incidentally introduced a new instance using
the <mach/irqs.h> header which is now deleted, causing this
build regression:
drivers/mfd/ab8500-debugfs.c:95:23:
fatal error: mach/irqs.h: No such file or directory
compilation terminated.
make[4]: *** [drivers/mfd/ab8500-debugfs.o] Error 1
The code most certainly never worked with device tree either
since that does not rely on this kind of hard-coded interrupt
numbers.
Fix the problem at the root by passing it as a named resource
from the ab8500-core driver. Use an untyped resource to
stop the MFD core from remapping this IRQ relative to the
AB8500 irqdomain.
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLov v2->v3:
- Fix typos.
ChangeLog v1->v2:
- Pass an untyped resource to avoid problems due to IRQ
remapping.
Sam this would have to go into the v3.10-targetted stuff...
Either immediately before you send it upstream or as a fixup.
---
drivers/mfd/ab8500-core.c | 15 +++++++++++++++
drivers/mfd/ab8500-debugfs.c | 16 ++++++++++++----
2 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 8e8a016..42abd3a 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -868,6 +868,15 @@ static struct resource ab8500_chargalg_resources[] = {};
#ifdef CONFIG_DEBUG_FS
static struct resource ab8500_debug_resources[] = {
{
+ .name = "IRQ_AB8500",
+ /*
+ * Number will be filled in. NOTE: this is deliberately
+ * not flagged as an IRQ in order to avoid remapping using
+ * the irqdomain in the MFD core, so that this IRQ passes
+ * unremapped to the debug code.
+ */
+ },
+ {
.name = "IRQ_FIRST",
.start = AB8500_INT_MAIN_EXT_CH_NOT_OK,
.end = AB8500_INT_MAIN_EXT_CH_NOT_OK,
@@ -1712,6 +1721,12 @@ static int ab8500_probe(struct platform_device *pdev)
if (ret)
return ret;
+#if CONFIG_DEBUG_FS
+ /* Pass to debugfs */
+ ab8500_debug_resources[0].start = ab8500->irq;
+ ab8500_debug_resources[0].end = ab8500->irq;
+#endif
+
if (is_ab9540(ab8500))
ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
ARRAY_SIZE(ab9540_devs), NULL,
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index b88bbbc..37b7ce4 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -91,12 +91,10 @@
#include <linux/ctype.h>
#endif
-/* TODO: this file should not reference IRQ_DB8500_AB8500! */
-#include <mach/irqs.h>
-
static u32 debug_bank;
static u32 debug_address;
+static int irq_ab8500;
static int irq_first;
static int irq_last;
static u32 *irq_count;
@@ -1589,7 +1587,7 @@ void ab8500_debug_register_interrupt(int line)
{
if (line < num_interrupt_lines) {
num_interrupts[line]++;
- if (suspend_test_wake_cause_interrupt_is_mine(IRQ_DB8500_AB8500))
+ if (suspend_test_wake_cause_interrupt_is_mine(irq_ab8500))
num_wake_interrupts[line]++;
}
}
@@ -2941,6 +2939,7 @@ static int ab8500_debug_probe(struct platform_device *plf)
struct dentry *file;
int ret = -ENOMEM;
struct ab8500 *ab8500;
+ struct resource *res;
debug_bank = AB8500_MISC;
debug_address = AB8500_REV_REG & 0x00FF;
@@ -2959,6 +2958,15 @@ static int ab8500_debug_probe(struct platform_device *plf)
if (!event_name)
goto out_freedev_attr;
+ res = platform_get_resource_byname(plf, 0, "IRQ_AB8500");
+ if (!res) {
+ dev_err(&plf->dev, "AB8500 irq not found, err %d\n",
+ irq_first);
+ ret = -ENXIO;
+ goto out_freeevent_name;
+ }
+ irq_ab8500 = res->start;
+
irq_first = platform_get_irq_byname(plf, "IRQ_FIRST");
if (irq_first < 0) {
dev_err(&plf->dev, "First irq not found, err %d\n",
--
1.7.11.3
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v3] MFD: ab8500: pass AB8500 IRQ to debugfs code by resource
2013-04-15 7:47 [PATCH v3] MFD: ab8500: pass AB8500 IRQ to debugfs code by resource Linus Walleij
@ 2013-04-18 22:33 ` Samuel Ortiz
2013-04-25 12:06 ` Linus Walleij
0 siblings, 1 reply; 3+ messages in thread
From: Samuel Ortiz @ 2013-04-18 22:33 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-kernel, Anmar Oueja, Linus Walleij, Arnd Bergmann
Hi Linus,
On Mon, Apr 15, 2013 at 09:47:01AM +0200, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
>
> The AB8500 debug code which was merged in parallel with the
> multiplatform work incidentally introduced a new instance using
> the <mach/irqs.h> header which is now deleted, causing this
> build regression:
>
> drivers/mfd/ab8500-debugfs.c:95:23:
> fatal error: mach/irqs.h: No such file or directory
> compilation terminated.
> make[4]: *** [drivers/mfd/ab8500-debugfs.o] Error 1
>
> The code most certainly never worked with device tree either
> since that does not rely on this kind of hard-coded interrupt
> numbers.
>
> Fix the problem at the root by passing it as a named resource
> from the ab8500-core driver. Use an untyped resource to
> stop the MFD core from remapping this IRQ relative to the
> AB8500 irqdomain.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLov v2->v3:
> - Fix typos.
> ChangeLog v1->v2:
> - Pass an untyped resource to avoid problems due to IRQ
> remapping.
>
> Sam this would have to go into the v3.10-targetted stuff...
> Either immediately before you send it upstream or as a fixup.
I usually try to send one single pull request during the merge window, so I'll
add this one to my 3.10 MFD fixup pull request.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] MFD: ab8500: pass AB8500 IRQ to debugfs code by resource
2013-04-18 22:33 ` Samuel Ortiz
@ 2013-04-25 12:06 ` Linus Walleij
0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2013-04-25 12:06 UTC (permalink / raw)
To: Samuel Ortiz; +Cc: Linus Walleij, linux-kernel, Anmar Oueja, Arnd Bergmann
On Fri, Apr 19, 2013 at 12:33 AM, Samuel Ortiz <sameo@linux.intel.com> wrote:
>> Sam this would have to go into the v3.10-targetted stuff...
>> Either immediately before you send it upstream or as a fixup.
>
> I usually try to send one single pull request during the merge window, so I'll
> add this one to my 3.10 MFD fixup pull request.
But the merge winow isn't even open yet ... now you will break it in the
merge window and the un-break it later. Well whatever as long as it
gets fixed. But it causes some annoyance when trying to bisect in the
merge window.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-25 12:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-15 7:47 [PATCH v3] MFD: ab8500: pass AB8500 IRQ to debugfs code by resource Linus Walleij
2013-04-18 22:33 ` Samuel Ortiz
2013-04-25 12:06 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®