Subject: Re: [PATCH 2/6] ARM: ep93xx: enable SPARSE_IRQ

From: Alexander Sverdlin <[email-masked]>
Date: Sat, 19 Oct 2019 18:42:34 +0200

Hello Arnd,

On Fri, 18 Oct 2019 18:29:15 +0200
Arnd Bergmann <[email-masked]> wrote:

> Without CONFIG_SPARSE_IRQ, we rely on mach/irqs.h to define NR_IRQS
> globally. Do the minimal conversion by setting .nr_irqs in each
> machine descriptor.
> 
> Only the vision_ep9307 machine has extra IRQs for GPIOs, so make
> .nr_irqs the original value there, while using the plain NR_EP93XX_IRQS
> everywhere else.

This patch causes multiple problems on EDB9302:

1. WARNINGs during gpiochip registration, for instance:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at kernel/irq/chip.c:1013 __irq_do_set_handler+0x94/0x188
CPU: 0 PID: 1 Comm: swapper Tainted: G        W         5.4.0-rc3 #1
Hardware name: Cirrus Logic EDB9302 Evaluation Board
[<c000e878>] (unwind_backtrace) from [<c000d574>] (show_stack+0x10/0x18)
[<c000d574>] (show_stack) from [<c0335e28>] (dump_stack+0x18/0x24)
[<c0335e28>] (dump_stack) from [<c001cf1c>] (__warn+0xa4/0xc8)
[<c001cf1c>] (__warn) from [<c001cfe8>] (warn_slowpath_fmt+0xa8/0xb8)
[<c001cfe8>] (warn_slowpath_fmt) from [<c0055668>] (__irq_do_set_handler+0x94/0x188)
[<c0055668>] (__irq_do_set_handler) from [<c005647c>] (irq_set_chained_handler_and_data+0x48/0x7c)
[<c005647c>] (irq_set_chained_handler_and_data) from [<c01ab440>] (gpiochip_add_data_with_key+0x6d4/0xabc)
[<c01ab440>] (gpiochip_add_data_with_key) from [<c01ab868>] (devm_gpiochip_add_data+0x40/0x88)
[<c01ab868>] (devm_gpiochip_add_data) from [<c01ae554>] (ep93xx_gpio_probe+0x1ac/0x280)
[<c01ae554>] (ep93xx_gpio_probe) from [<c01e0f34>] (platform_drv_probe+0x28/0x6c)
[<c01e0f34>] (platform_drv_probe) from [<c01df588>] (really_probe+0x1c8/0x340)
[<c01df588>] (really_probe) from [<c01ddfe4>] (bus_for_each_drv+0x58/0xc0)
[<c01ddfe4>] (bus_for_each_drv) from [<c01df904>] (__device_attach+0xb4/0x104)
[<c01df904>] (__device_attach) from [<c01de1d4>] (bus_probe_device+0x8c/0x94)
[<c01de1d4>] (bus_probe_device) from [<c01db5e4>] (device_add+0x3d0/0x59c)
[<c01db5e4>] (device_add) from [<c01e16d8>] (platform_device_add+0x100/0x20c)
[<c01e16d8>] (platform_device_add) from [<c03f50b0>] (ep93xx_init_devices+0x16c/0x20c)
[<c03f50b0>] (ep93xx_init_devices) from [<c03f53a0>] (edb93xx_init_machine+0xc/0x84)
[<c03f53a0>] (edb93xx_init_machine) from [<c03f1984>] (customize_machine+0x20/0x38)
[<c03f1984>] (customize_machine) from [<c03f0e54>] (do_one_initcall+0x78/0x1a0)
[<c03f0e54>] (do_one_initcall) from [<c03f1080>] (kernel_init_freeable+0x104/0x1b8)
[<c03f1080>] (kernel_init_freeable) from [<c034c358>] (kernel_init+0x8/0xf8)
[<c034c358>] (kernel_init) from [<c00090d0>] (ret_from_fork+0x14/0x24)
Exception stack(0xc4433fb0 to 0xc4433ff8)
3fa0:                                     00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
---[ end trace 8f9e35e2d6224882 ]---

2. Broken sound (I2S), this looks like below in the log:

ep93xx-i2s ep93xx-i2s: Missing dma channel for stream: 0
 CS4271: ASoC: pcm constructor failed: -22
edb93xx-audio edb93xx-audio: ASoC: can't create pcm CS4271 HiFi :-22

And /proc/interrupts has two entries less. Without patch:

# cat /proc/interrupts
           CPU0       
  7:          0       VIC   7 Edge      i2s-pcm-out
  8:          0       VIC   8 Edge      i2s-pcm-in
 39:          2       VIC   7 Edge      eth0
 51:       7532       VIC  19 Edge      ep93xx timer
 52:        144       VIC  20 Edge      uart-pl010
 53:          4       VIC  21 Edge      ep93xx-spi
 60:          0       VIC  28 Edge      ep93xx-i2s
Err:          0

With patch:

# cat /proc/interrupts 
           CPU0       
 39:        146       VIC   7 Edge      eth0
 51:     162161       VIC  19 Edge      ep93xx timer
 52:        139       VIC  20 Edge      uart-pl010
 53:          4       VIC  21 Edge      ep93xx-spi
 60:          0       VIC  28 Edge      ep93xx-i2s
Err:          0

I will try to look into I2S problem...
 
> ---
> It's been a while since I did this, no idea what else is needed
> here or if this is correct at all.
> 
> Cc: Hartley Sweeten <[email-masked]>
> Cc: Alexander Sverdlin <[email-masked]>
> Cc: Hubert Feurstein <[email-masked]>
> Cc: Lukasz Majewski <[email-masked]>
> Signed-off-by: Arnd Bergmann <[email-masked]>
> ---
>  arch/arm/Kconfig                               | 2 ++
>  arch/arm/mach-ep93xx/adssphere.c               | 1 +
>  arch/arm/mach-ep93xx/edb93xx.c                 | 8 ++++++++
>  arch/arm/mach-ep93xx/gesbc9312.c               | 1 +
>  arch/arm/mach-ep93xx/{include/mach => }/irqs.h | 7 -------
>  arch/arm/mach-ep93xx/micro9.c                  | 4 ++++
>  arch/arm/mach-ep93xx/simone.c                  | 1 +
>  arch/arm/mach-ep93xx/snappercl15.c             | 1 +
>  arch/arm/mach-ep93xx/soc.h                     | 1 +
>  arch/arm/mach-ep93xx/ts72xx.c                  | 3 ++-
>  arch/arm/mach-ep93xx/vision_ep9307.c           | 1 +
>  11 files changed, 22 insertions(+), 8 deletions(-)
>  rename arch/arm/mach-ep93xx/{include/mach => }/irqs.h (94%)

-- 
Alexander Sverdlin.

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel