stockmind / gpd-pocket-ubuntu-respin

Collection of scripts and tweaks to adapt Ubuntu and Linux Mint ISO images to let them run smooth on GPD Pocket
349 stars 35 forks source link

4.18-rc1 Kernel NULL pointer / fusb302 / USB C charging broken #125

Open sobukus opened 6 years ago

sobukus commented 6 years ago

This just flew in on a fresh boot:

[   27.151910] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8
[   27.157935] PGD 0 P4D 0 
[   27.157942] Oops: 0002 [#1] SMP PTI
[   27.157950] CPU: 3 PID: 55 Comm: kworker/3:1 Not tainted 4.18.0-rc1-thor+ #1
[   27.175646] Hardware name: Default string Default string/Default string, BIOS 5.11 06/28/2017
[   27.175656] Workqueue: events deferred_probe_work_func
[   27.175662] RIP: 0010:down_write+0x1b/0x40
[   27.175663] Code: 83 f8 01 74 08 48 c7 43 20 01 00 00 00 5b c3 0f 1f 44 00 00 53 48 8d 1f e8 32 d7 ff ff 48 ba 01 00 00 00 ff ff ff ff 48 89 d8 <f0> 48 0f c1 10 85 d2 74 05 e8 57 25 ff ff 65 48 8b 04 25 00 5c 01 
[   27.193527] RSP: 0018:ffffb922c1097cd0 EFLAGS: 00010246
[   27.193529] RAX: 00000000000000a8 RBX: 00000000000000a8 RCX: ffff8f4bf0db8028
[   27.193530] RDX: ffffffff00000001 RSI: ffffffffbca19a90 RDI: 00000000000000a8
[   27.193531] RBP: ffff8f4bf3f6f620 R08: ffffffffbbe42560 R09: ffffffffc09daf80
[   27.193532] R10: 0000000000280000 R11: ffff8f4bfffd0e90 R12: ffffffffbbe42560
[   27.193534] R13: 0000000000008124 R14: ffff8f4bf0db8028 R15: ffffffffbc2d1e08
[   27.193535] FS:  0000000000000000(0000) GS:ffff8f4bffd80000(0000) knlGS:0000000000000000
[   27.193537] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   27.193538] CR2: 00000000000000a8 CR3: 0000000273ede000 CR4: 00000000001006e0
[   27.193539] Call Trace:
[   27.193549]  start_creating+0x62/0x110
[   27.193556]  __debugfs_create_file+0x33/0x110
[   27.193561]  fusb302_probe+0x1c1/0x520 [fusb302]
[   27.193565]  ? tcpm_get_current_limit+0x100/0x100 [fusb302]
[   27.193568]  i2c_device_probe+0x1ec/0x270
[   27.193571]  driver_probe_device+0x30e/0x480
[   27.193574]  ? __driver_attach+0x110/0x110
[   27.193577]  bus_for_each_drv+0x6b/0xb0
[   27.193579]  __device_attach+0xe1/0x160
[   27.193581]  bus_probe_device+0x83/0xa0
[   27.193584]  deferred_probe_work_func+0x43/0x160
[   27.193588]  process_one_work+0x194/0x380
[   27.193590]  worker_thread+0x30/0x3c0
[   27.193593]  ? process_one_work+0x380/0x380
[   27.193595]  kthread+0x116/0x130
[   27.193597]  ? kthread_create_worker_on_cpu+0x70/0x70
[   27.193600]  ret_from_fork+0x35/0x40
[   27.193602] Modules linked in: pi3usb30532 snd_soc_sst_cht_bsw_rt5645(+) fusb302 tcpm typec joydev gpio_keys intel_rapl intel_powerclamp coretemp kvm_intel kvm irqbypass intel_cstate snd_intel_sst_acpi snd_intel_sst_core snd_soc_rt5645 snd_soc_sst_atom_hifi2_platform snd_soc_acpi bq24190_charger snd_soc_acpi_intel_match snd_soc_rl6231 snd_seq_dummy snd_soc_core snd_seq_oss snd_compress snd_hdmi_lpe_audio snd_seq_midi ac97_bus extcon_intel_cht_wc snd_pcm_dmaengine snd_seq_midi_event snd_rawmidi mei_txe snd_pcm intel_xhci_usb_role_switch roles processor_thermal_device mei lpc_ich intel_soc_dts_iosf snd_seq snd_seq_device snd_timer intel_cht_int33fe intel_hid snd sparse_keymap dw_dmac goodix max17042_battery hci_uart tpm_crb soundcore tpm_tis btqca tpm_tis_core spi_pxa2xx_platform int3400_thermal tpm
[   27.193646]  acpi_thermal_rel dptf_power int3406_thermal int3403_thermal int340x_thermal_zone soc_button_array gpd_pocket_fan intel_int0002_vgpio acpi_pad parport_pc ppdev lp parport brcmfmac brcmutil cfg80211 dm_crypt overlay mmc_block uas usb_storage i915 crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit btusb drm_kms_helper btrtl btbcm btintel ghash_clmulni_intel drm bluetooth i2c_cht_wc rfkill sdhci_acpi video sdhci mmc_core ecdh_generic
[   27.193677] CR2: 00000000000000a8
[   27.193681] ---[ end trace 4c74a1a7abc6fab4 ]---
[   27.193683] RIP: 0010:down_write+0x1b/0x40
[   27.193684] Code: 83 f8 01 74 08 48 c7 43 20 01 00 00 00 5b c3 0f 1f 44 00 00 53 48 8d 1f e8 32 d7 ff ff 48 ba 01 00 00 00 ff ff ff ff 48 89 d8 <f0> 48 0f c1 10 85 d2 74 05 e8 57 25 ff ff 65 48 8b 04 25 00 5c 01 
[   27.193715] RSP: 0018:ffffb922c1097cd0 EFLAGS: 00010246
[   27.193717] RAX: 00000000000000a8 RBX: 00000000000000a8 RCX: ffff8f4bf0db8028
[   27.193718] RDX: ffffffff00000001 RSI: ffffffffbca19a90 RDI: 00000000000000a8
[   27.193719] RBP: ffff8f4bf3f6f620 R08: ffffffffbbe42560 R09: ffffffffc09daf80
[   27.193720] R10: 0000000000280000 R11: ffff8f4bfffd0e90 R12: ffffffffbbe42560
[   27.193721] R13: 0000000000008124 R14: ffff8f4bf0db8028 R15: ffffffffbc2d1e08
[   27.193723] FS:  0000000000000000(0000) GS:ffff8f4bffd80000(0000) knlGS:0000000000000000
[   27.193724] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   27.193725] CR2: 00000000000000a8 CR3: 0000000273ede000 CR4: 00000000001006e0

Since the charger did not work from time to time with the 4.16-rc3 kernel (resulting in nasty slow battery drain while being connected to AC … after a reboot, charging works again), I guess this could be related.

And yes: I see no fusb302 charger in /sys/class/power_supply. With the original USB C charger connected, I only get 5 V 500 mA current into the device … meaning a discharging battery despite AC connection.

@jwrdegoede: Got ideas?

jwrdegoede commented 6 years ago

Hi,

I've tested battery monitoring / charging on my GPD win with 4.18-rc2. I found an issue where non PD chargers (such as the default GPD win charger) would only charge at 5V 500mA instead of 5V 2000mA, this is fixed in my tree now and submitted upstream.

I've not found any problems with battery monitoring, nor seen the oops some people are reporting.

Regards,

Hans

sobukus commented 6 years ago

Thanks for your continued work. I do wonder if we'll ever get the kinks out of that system. I did not see the oops again yet, just very likely breakage once I try to use some suspend mode.

sobukus commented 6 years ago

Regarding suspend breakage: i2c timeouts followed by the battery/charger status being broken, including a flood of the i2c timeout messages that prevents a normal reboot and has me resorting to sysrq. This happens rather often and is a major dealbreaker for me so dar.

rbrewer123 commented 5 years ago

@sobukus I was having a similar kernel oops with kernel 4.19. The following bios setting change improved it: go to the Boot tab, and change the "USB Support" setting to "Full Initial".

With this change I can boot my kernel without the oops and things run pretty well, but I still don't have charging for some reason.

I seem to have lost charging in my older kernel that I thought had charging. I'm suspecting a hardware issue, but cannot confirm that yet.

rbrewer123 commented 5 years ago

@sobukus it turns out there is no hardware problem. I was forcing the fusb302 and bq24190_charger modules to load early in the boot, which was causing problems. Now the charging stuff seems to be detected normally and I'm getting good charging speeds. I'm now running a NixOS setup with kernel 4.19 that is very close to what @sboehler is using https://github.com/sboehler/nixos-config and my system seems to be pretty stable.

sobukus commented 5 years ago

Sadly, I got some final hardware problem with the GPD Pocket: It died on me (assisted by a certain amount of drinking water). I wish you all success with Linux on the thing.