Skip to content

[tg5040] Spontaneous reboot: kernel panic in sunxi_i2c_handler after i2c3 timeout polling the analog joystick (0x29) #824

Description

@hiepnm93

Device

  • NextUI 20260719-0 (73e160c, 2026-07-20), kernel 4.9.191 #912, sun50iw10 (H700), Tools arch folder tg5040
  • Device shows as "TRIMUI Player1" joystick (js0/event3)

Symptom

The console spontaneously reboots every few hours of uptime, regardless of what is running (it happened while idle in the menu and while in-game). /sys/fs/pstore records Panic: Total 3 times over one session, at ~35min, ~75min and ~3h11m of uptime. Battery was fine (~78%).

Evidence (pstore, identical every time)

sunxi_i2c_do_xfer()1916 - [i2c3] xfer timeout (dev addr:0x29)
Unable to handle kernel NULL pointer dereference at virtual address 00000014
Internal error: Oops: 96000006 [#1] PREEMPT SMP
PC is at sunxi_i2c_handler+0x4dc/0x924
LR is at sunxi_i2c_handler+0x418/0x924
...
Kernel panic - not syncing: Fatal exception in interrupt
SMP: failed to stop secondary CPUs 0-1

Fault happens in interrupt context (el1_irqgic_handle_irqsunxi_i2c_handler), which is why it takes the whole kernel down.

What device 0x29 on i2c3 is

I probed the buses from userspace (/dev/i2c-*):

  • i2c-6: 0x34 (AXP2202 PMIC) + 0x41 (used by poweroff_next)
  • i2c-0, i2c-2: nothing
  • i2c-3: only 0x29 answers — sequential read returns 07 e1 07 f8 f8 f8 ...

There is no DT child on twi@0x05002c00; the kernel polls 0x29 continuously and the value pattern matches the analog stick reader behind the "TRIMUI Player1" js0 device. So the flow is: joystick poll over i2c3 → chip occasionally misses a transfer (xfer timeout) → sunxi_i2c_handler dereferences a null pointer in the timeout/IRQ path → fatal panic in interrupt → reboot.

Suggestion

The i2c3/0x29 timeout itself is transient (the stick keeps working after reboot), so the fatal part is purely the driver's timeout path in sunxi_i2c_handler: it should bail out of the IRQ (complete the transfer with -ETIMEDOUT, re-arm the controller) instead of touching the timed-out transfer state and oopsing. Happy to test a build if useful.

Environment notes

  • Modules loaded at panic: xradio_wlan xradio_core ... vin_v4l2 ov5648_mipi vin_io videobuf2 ... dc_sunxi(O) pvrsrvkm(O)
  • Nothing unusual running; reproducible across several days of normal use

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions