User avatar
procount
Posts: 1968
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

My Hyperpixel Kernel driver problems - IRQ & Pi4

Wed Dec 04, 2019 2:08 pm

I've reached an impasse in creating my kernel module driver for the Pimoroni Hyperpixel4.0 touchscreen display (DPI18).
Please see https://github.com/procount/pimhyp4 for the driver source code, DTS overlay and example config.txt file. the README.md file provides a bit more info.

Mostly it works on Pi3 (console and desktop) and Pi4 legacy display(console and desktop), but I have 2 specific issues:

1. if dtoverlay=vc4-fkms-v3d is enabled on PI4, the desktop is not shown on the LCD. The LCD continues to display the last boot messages that were present before switching to the new fkms drivers. However, the arandr screen config utility seems to know the DSI screen is present and can rotate it for proper display over VNC, it's just now showing on the LCD. It displays correctly when using the legacy display on Pi4.

2. After a while of dragging my finger around on the desktop, I get an error. After that the touchscreen is unresponsive and often the display will blank out. It seems to be due to an i2c error, followed by unhandled IRQ which consequently gets disabled. Here are the associated debug messages from DMESG.

Code: Select all

[   83.191891] i2c i2c-7: sendbytes: NAK bailout.
[   83.191912] pimhyp4-TS 7-0014: I2C transfer error: -5
[   83.976064] i2c i2c-7: sendbytes: NAK bailout.
[   83.976084] pimhyp4-TS 7-0014: I2C transfer error: -5
[   88.355184] i2c i2c-7: sendbytes: NAK bailout.
[   88.355204] pimhyp4-TS 7-0014: I2C transfer error: -5
[   89.717497] irq 57: nobody cared (try booting with the "irqpoll" option)
[   89.717508] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G         C        4.19.75-v7l #6
[   89.717511] Hardware name: BCM2835
[   89.717533] [<c0212c74>] (unwind_backtrace) from [<c020d2cc>] (show_stack+0x20/0x24)
[   89.717542] [<c020d2cc>] (show_stack) from [<c097d4f0>] (dump_stack+0xcc/0x110)
[   89.717551] [<c097d4f0>] (dump_stack) from [<c02851e8>] (__report_bad_irq+0x4c/0xd0)
[   89.717558] [<c02851e8>] (__report_bad_irq) from [<c0284fcc>] (note_interrupt+0x124/0x2bc)
[   89.717565] [<c0284fcc>] (note_interrupt) from [<c0281e78>] (handle_irq_event_percpu+0x88/0x90)
[   89.717572] [<c0281e78>] (handle_irq_event_percpu) from [<c0281ed4>] (handle_irq_event+0x54/0x78)
[   89.717579] [<c0281ed4>] (handle_irq_event) from [<c0286148>] (handle_edge_irq+0xcc/0x1fc)
[   89.717585] [<c0286148>] (handle_edge_irq) from [<c0280ca4>] (generic_handle_irq+0x34/0x44)
[   89.717596] [<c0280ca4>] (generic_handle_irq) from [<c0628ba8>] (bcm2835_gpio_irq_handle_bank+0x94/0xcc)
[   89.717605] [<c0628ba8>] (bcm2835_gpio_irq_handle_bank) from [<c0628c54>] (bcm2835_gpio_irq_handler+0x74/0x12c)
[   89.717611] [<c0628c54>] (bcm2835_gpio_irq_handler) from [<c0280ca4>] (generic_handle_irq+0x34/0x44)
[   89.717618] [<c0280ca4>] (generic_handle_irq) from [<c0281408>] (__handle_domain_irq+0x6c/0xc4)
[   89.717625] [<c0281408>] (__handle_domain_irq) from [<c0202234>] (gic_handle_irq+0x4c/0x88)
[   89.717632] [<c0202234>] (gic_handle_irq) from [<c02019bc>] (__irq_svc+0x5c/0x7c)
[   89.717635] Exception stack(0xc1001ed0 to 0xc1001f18)
[   89.717640] 1ec0:                                     c0209a54 00000000 40000093 40000093
[   89.717645] 1ee0: ffffe000 c1004db8 c1004e00 00000001 00000001 c10962da c0b87ef4 c1001f2c
[   89.717649] 1f00: c1000000 c1001f20 00000000 c0209a58 40000013 ffffffff
[   89.717656] [<c02019bc>] (__irq_svc) from [<c0209a58>] (arch_cpu_idle+0x34/0x4c)
[   89.717664] [<c0209a58>] (arch_cpu_idle) from [<c0999158>] (default_idle_call+0x40/0x48)
[   89.717673] [<c0999158>] (default_idle_call) from [<c0254200>] (do_idle+0x134/0x174)
[   89.717681] [<c0254200>] (do_idle) from [<c0254500>] (cpu_startup_entry+0x28/0x2c)
[   89.717688] [<c0254500>] (cpu_startup_entry) from [<c09927e4>] (rest_init+0xb8/0xbc)
[   89.717697] [<c09927e4>] (rest_init) from [<c0e01000>] (start_kernel+0x4b0/0x4e0)
[   89.717702] handlers:
[   89.717707] [<5927cfa3>] irq_default_primary_handler threaded [<8d7f360e>] pimhyp4_ts_irq_handler [pimhyp4]
[   89.717728] Disabling IRQ #57
I did previously have an "irq type mismatch" error during intialisation. This seemed to be due to https://github.com/procount/pimhyp4/blo ... ay.dts#L64 and https://github.com/procount/pimhyp4/blo ... y.dts#L156 where the interrutps were defined as `interrupts = <27 2>;`. Changing this to `interrupts = <27 1>;` seemed to fix it to agree with https://github.com/procount/pimhyp4/blo ... hyp4.c#L82 but I'm not sure about it.

I'm still a novice at writing kernel drivers, so go easy on me, but any help would be appreciated.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Return to “Device Tree”