Cryolitia / gpd-fan-driver

GNU General Public License v2.0
12 stars 2 forks source link

register addresses for gpd win4 7840U #6

Closed bm16ton closed 5 months ago

bm16ton commented 5 months ago

Hello! awesome project! Was just starting my own and grabbing resources and I see in code win4 7840U has its driver data pointed to gpd_wm2_quirk, which is different then all the other resources ive found who are using the numbers found in you win4 quirk. Wondering if that correct or maybe a typo? Just curious , cuz I get nervous reading/writing in areas that I personally shouldnt be. Id like to write the driver for the wmi interface, hopefully Ill find time and also be able to understand it well enuff to do so.

Cryolitia commented 5 months ago

As far as the documents I got, GPD Win4 6800U has its own quirk, and GPD Win 4 7840U has the same quirk with GPD Win Max 2 2023 7840U.

However, I have no Win 4 device to verify it.

Cryolitia commented 5 months ago

I have only found wm2 to test so far. I'll appreciate it if you could verify it on other devices and tell me the result.

bm16ton commented 5 months ago

Oh certainly, I was a little nervous about trying it and possibly having writes going to unknown/possibly wrong areas, but alas my love of being helpful has won! Ill compile and test right now, give me 15-20min. and Ill report back

On Mon, Jun 17, 2024 at 6:01 PM PukNgae Cryolitia @.***> wrote:

I have only found wm2 to test so far. I'll appreciate it if you could verify it on other devices and tell me the result.

— Reply to this email directly, view it on GitHub https://github.com/Cryolitia/gpd-fan-driver/issues/6#issuecomment-2174507081, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAWMPZG3RET6ULYVROYPXLZH5MERAVCNFSM6AAAAABJM46PXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZUGUYDOMBYGE . You are receiving this because you authored the thread.Message ID: @.***>

bm16ton commented 5 months ago

Well it seemed to dislike my dmi decode and errors on insmod, heres the dmesg;

[ 2519.176683] ------------[ cut here ]------------ [ 2519.176694] UBSAN: array-index-out-of-bounds in drivers/firmware/dmi_scan.c:850:23 [ 2519.176703] index 96 is out of range for type 'char *[23]' [ 2519.176708] CPU: 4 PID: 7534 Comm: insmod Tainted: G O 6.9.4-16ton #6 [ 2519.176717] Hardware name: GPD G1618-04/G1618-04, BIOS 0.58 04/18/2024 [ 2519.176721] Call Trace: [ 2519.176726] [ 2519.176732] dump_stack_lvl+0x70/0x90 [ 2519.176744] dump_stack+0x14/0x20 [ 2519.176751] ubsan_handle_out_of_bounds+0xab/0xe0 [ 2519.176762] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176771] ? strstr+0x71/0xb0 [ 2519.176783] dmi_matches+0x213/0x230 [ 2519.176793] dmi_first_match+0x29/0x50 [ 2519.176799] ? pfx_gpd_fan_init+0x10/0x10 [gpd_fan] [ 2519.176812] gpd_fan_init+0x27/0xff0 [gpd_fan] [ 2519.176826] ? kvfree+0x2c/0x40 [ 2519.176835] ? vfree.part.0+0xeb/0x250 [ 2519.176845] do_one_initcall+0x84/0x310 [ 2519.176852] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176859] ? kmalloc_trace+0x129/0x2d0 [ 2519.176868] ? do_init_module+0x22/0x220 [ 2519.176879] do_init_module+0x63/0x220 [ 2519.176886] load_module+0x24f6/0x25b0 [ 2519.176906] init_module_from_file+0x92/0xd0 [ 2519.176913] ? init_module_from_file+0x92/0xd0 [ 2519.176926] idempotent_init_module+0x104/0x290 [ 2519.176938] __x64_sys_finit_module+0x5f/0xc0 [ 2519.176947] x64_sys_call+0x1a11/0x2030 [ 2519.176953] do_syscall_64+0x6f/0x140 [ 2519.176964] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176973] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176979] ? putname+0x54/0x70 [ 2519.176989] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176995] ? do_sys_openat2+0x7d/0xc0 [ 2519.177007] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177013] ? __x64_sys_openat+0x54/0xa0 [ 2519.177022] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177028] ? syscall_exit_to_user_mode+0x81/0x170 [ 2519.177037] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177044] ? do_syscall_64+0x7b/0x140 [ 2519.177051] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177058] ? do_user_addr_fault+0x2fe/0x6b0 [ 2519.177065] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177072] ? irqentry_exit_to_user_mode+0x5d/0x140 [ 2519.177080] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177087] ? irqentry_exit+0x3f/0x50 [ 2519.177094] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177100] ? exc_page_fault+0x80/0xc0 [ 2519.177109] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 2519.177116] RIP: 0033:0x7fbc09f2725d [ 2519.177124] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05

<48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8b bb 0d 00 f7 d8 64 89 01 48 [ 2519.177130] RSP: 002b:00007ffd551c9628 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 2519.177139] RAX: ffffffffffffffda RBX: 000055cb92356750 RCX: 00007fbc09f2725d [ 2519.177144] RDX: 0000000000000000 RSI: 000055cb90a81e52 RDI: 0000000000000003 [ 2519.177148] RBP: 00007ffd551c96e0 R08: 0000000000000040 R09: 0000000000000000 [ 2519.177153] R10: 00007fbc0a003b20 R11: 0000000000000246 R12: 000055cb90a81e52 [ 2519.177157] R13: 0000000000000000 R14: 000055cb92359ed0 R15: 0000000000000000 [ 2519.177169] [ 2519.177172] ---[ end trace ]--- [ 2519.177176] ------------[ cut here ]------------ [ 2519.177179] UBSAN: array-index-out-of-bounds in drivers/firmware/dmi_scan.c:856:25 [ 2519.177185] index 96 is out of range for type 'char *[23]' [ 2519.177189] CPU: 4 PID: 7534 Comm: insmod Tainted: G O 6.9.4-16ton #6 [ 2519.177196] Hardware name: GPD G1618-04/G1618-04, BIOS 0.58 04/18/2024 [ 2519.177200] Call Trace: [ 2519.177204] [ 2519.177207] dump_stack_lvl+0x70/0x90 [ 2519.177215] dump_stack+0x14/0x20 [ 2519.177221] __ubsan_handle_out_of_bounds+0xab/0xe0 [ 2519.177230] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177237] ? strstr+0x71/0xb0 [ 2519.177245] dmi_matches+0x1c3/0x230 [ 2519.177253] dmi_first_match+0x29/0x50 [ 2519.177259] ? __pfx_gpd_fan_init+0x10/0x10 [gpd_fan] [ 2519.177272] gpd_fan_init+0x27/0xff0 [gpd_fan] [ 2519.177285] ? kvfree+0x2c/0x40 [ 2519.177292] ? vfree.part.0+0xeb/0x250 [ 2519.177301] do_one_initcall+0x84/0x310 [ 2519.177307] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177314] ? kmalloc_trace+0x129/0x2d0 [ 2519.177322] ? do_init_module+0x22/0x220 [ 2519.177331] do_init_module+0x63/0x220 [ 2519.177338] load_module+0x24f6/0x25b0 [ 2519.177358] init_module_from_file+0x92/0xd0 [ 2519.177365] ? init_module_from_file+0x92/0xd0 [ 2519.177378] idempotent_init_module+0x104/0x290 [ 2519.177390] __x64_sys_finit_module+0x5f/0xc0 [ 2519.177398] x64_sys_call+0x1a11/0x2030 [ 2519.177404] do_syscall_64+0x6f/0x140 [ 2519.177414] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177423] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177429] ? putname+0x54/0x70 [ 2519.177437] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177444] ? do_sys_openat2+0x7d/0xc0 [ 2519.177454] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177460] ? __x64_sys_openat+0x54/0xa0 [ 2519.177468] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177475] ? syscall_exit_to_user_mode+0x81/0x170 [ 2519.177483] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177490] ? do_syscall_64+0x7b/0x140 [ 2519.177497] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177504] ? do_user_addr_fault+0x2fe/0x6b0 [ 2519.177509] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177516] ? irqentry_exit_to_user_mode+0x5d/0x140 [ 2519.177525] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177531] ? irqentry_exit+0x3f/0x50 [ 2519.177538] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177545] ? exc_page_fault+0x80/0xc0 [ 2519.177554] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 2519.177559] RIP: 0033:0x7fbc09f2725d [ 2519.177565] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8b bb 0d 00 f7 d8 64 89 01 48 [ 2519.177571] RSP: 002b:00007ffd551c9628 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 2519.177578] RAX: ffffffffffffffda RBX: 000055cb92356750 RCX: 00007fbc09f2725d [ 2519.177582] RDX: 0000000000000000 RSI: 000055cb90a81e52 RDI: 0000000000000003 [ 2519.177586] RBP: 00007ffd551c96e0 R08: 0000000000000040 R09: 0000000000000000 [ 2519.177590] R10: 00007fbc0a003b20 R11: 0000000000000246 R12: 000055cb90a81e52 [ 2519.177594] R13: 0000000000000000 R14: 000055cb92359ed0 R15: 0000000000000000 [ 2519.177605] [ 2519.177609] ---[ end trace ]--- [ 2519.177614] BUG: unable to handle page fault for address: 0000003854524742 [ 2519.177618] #PF: supervisor read access in kernel mode [ 2519.177623] #PF: error_code(0x0000) - not-present page [ 2519.177627] PGD 0 P4D 0 [ 2519.177635] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 2519.177641] CPU: 4 PID: 7534 Comm: insmod Tainted: G O 6.9.4-16ton #6 [ 2519.177647] Hardware name: GPD G1618-04/G1618-04, BIOS 0.58 04/18/2024 [ 2519.177651] RIP: 0010:strstr+0x32/0xb0 [ 2519.177658] Code: 41 56 41 55 41 54 53 80 3e 00 0f 84 80 00 00 00 49 89 f5 48 89 f0 48 83 c0 01 80 38 00 75 f7 4c 29 e8 49 89 fc 48 89 c3 74 43 <80> 3f 00 74 4e 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 48 39 [ 2519.177663] RSP: 0018:ffff9ff089e8b8e8 EFLAGS: 00010212 [ 2519.177669] RAX: 000000000000001f RBX: 000000000000001f RCX: 00000000ffffffff [ 2519.177674] RDX: 0000003854524742 RSI: ffffffffc1d9b9d1 RDI: 0000003854524742 [ 2519.177678] RBP: ffff9ff089e8b908 R08: 0000000000000000 R09: 727420646e65205b [ 2519.177682] R10: 5d20656361727420 R11: 646e65205b2d2d2d R12: 0000003854524742 [ 2519.177686] R13: ffffffffc1d9b9d1 R14: 0000000000000000 R15: 0000000000000000 [ 2519.177691] FS: 00007fbc0a7ba080(0000) GS:ffff8e637ff00000(0000) knlGS:0000000000000000 [ 2519.177696] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2519.177701] CR2: 0000003854524742 CR3: 00000001ebba6000 CR4: 0000000000750ef0 [ 2519.177706] PKRU: 55555554 [ 2519.177710] Call Trace: [ 2519.177713] [ 2519.177717] ? show_regs+0x63/0x70 [ 2519.177726] ? __die+0x23/0x70 [ 2519.177734] ? page_fault_oops+0x150/0x510 [ 2519.177745] ? do_user_addr_fault+0x2cc/0x6b0 [ 2519.177753] ? exc_page_fault+0x6f/0xc0 [ 2519.177762] ? asm_exc_page_fault+0x2b/0x30 [ 2519.177774] ? strstr+0x32/0xb0 [ 2519.177781] ? strstr+0x71/0xb0 [ 2519.177789] dmi_matches+0x9b/0x230 [ 2519.177797] dmi_first_match+0x29/0x50 [ 2519.177802] ? __pfx_gpd_fan_init+0x10/0x10 [gpd_fan] [ 2519.177815] gpd_fan_init+0x27/0xff0 [gpd_fan] [ 2519.177828] ? kvfree+0x2c/0x40 [ 2519.177835] ? vfree.part.0+0xeb/0x250 [ 2519.177843] do_one_initcall+0x84/0x310 [ 2519.177849] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177856] ? kmalloc_trace+0x129/0x2d0 [ 2519.177864] ? do_init_module+0x22/0x220 [ 2519.177873] do_init_module+0x63/0x220 [ 2519.177880] load_module+0x24f6/0x25b0 [ 2519.177900] init_module_from_file+0x92/0xd0 [ 2519.177907] ? init_module_from_file+0x92/0xd0 [ 2519.177920] idempotent_init_module+0x104/0x290 [ 2519.177932] __x64_sys_finit_module+0x5f/0xc0 [ 2519.177940] x64_sys_call+0x1a11/0x2030 [ 2519.177946] do_syscall_64+0x6f/0x140 [ 2519.177956] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177965] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177971] ? putname+0x54/0x70 [ 2519.177979] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177985] ? do_sys_openat2+0x7d/0xc0 [ 2519.177995] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178002] ? __x64_sys_openat+0x54/0xa0 [ 2519.178010] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178016] ? syscall_exit_to_user_mode+0x81/0x170 [ 2519.178025] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178031] ? do_syscall_64+0x7b/0x140 [ 2519.178039] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178045] ? do_user_addr_fault+0x2fe/0x6b0 [ 2519.178051] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178057] ? irqentry_exit_to_user_mode+0x5d/0x140 [ 2519.178066] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178072] ? irqentry_exit+0x3f/0x50 [ 2519.178080] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178086] ? exc_page_fault+0x80/0xc0 [ 2519.178095] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 2519.178101] RIP: 0033:0x7fbc09f2725d [ 2519.178106] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8b bb 0d 00 f7 d8 64 89 01 48 [ 2519.178111] RSP: 002b:00007ffd551c9628 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 2519.178117] RAX: ffffffffffffffda RBX: 000055cb92356750 RCX: 00007fbc09f2725d [ 2519.178122] RDX: 0000000000000000 RSI: 000055cb90a81e52 RDI: 0000000000000003 [ 2519.178126] RBP: 00007ffd551c96e0 R08: 0000000000000040 R09: 0000000000000000 [ 2519.178130] R10: 00007fbc0a003b20 R11: 0000000000000246 R12: 000055cb90a81e52 [ 2519.178134] R13: 0000000000000000 R14: 000055cb92359ed0 R15: 0000000000000000 [ 2519.178145] [ 2519.178148] Modules linked in: gpd_fan(O+) nls_utf8 befs rfcomm ib_core xt_conntrack nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack_netlink nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xfrm_user xfrm_algo xt_addrtype nft_compat nf_tables br_netfilter bridge stp llc ccm overlay algif_hash algif_skcipher af_alg qrtr bnep xpad ff_memless snd_hda_codec_realtek intel_rapl_msr snd_hda_codec_generic snd_hda_scodec_component btusb btrtl amd_atl btintel intel_rapl_common btbcm btmtk binfmt_misc snd_hda_codec_hdmi snd_hda_intel edac_mce_amd joydev snd_intel_dspcfg snd_intel_sdw_acpi kvm_amd snd_hda_codec snd_hda_core kvm snd_hwdep crct10dif_pclmul amdgpu ghash_clmulni_intel snd_pcm nls_iso8859_1 sha512_ssse3 iwlmvm sha256_ssse3 snd_seq_midi amdxcp sha1_ssse3 snd_seq_midi_event drm_exec gpu_sched mac80211 aesni_intel crypto_simd drm_buddy snd_rawmidi cryptd libarc4 drm_suballoc_helper drm_ttm_helper snd_seq ttm rapl snd_seq_device wmi_bmof drm_display_helper snd_timer cec iwlwifi rc_core snd drm_kms_helper bmi260_i2c(O) cfg80211 [ 2519.178319] i2c_piix4 ccp k10temp i2c_algo_bit soundcore bmi260_core(O) industrialio_triggered_buffer kfifo_buf industrialio input_leds goodix_ts serio_raw mac_hid msr parport_pc ppdev lp parport efi_pstore drm nfnetlink dmi_sysfs ip_tables x_tables btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 cdc_ether usbnet r8152 mii uas usb_storage hid_generic usbhid xhci_pci crc32_pclmul xhci_pci_renesas thunderbolt nvme xhci_hcd nvme_core video wmi [ 2519.178427] CR2: 0000003854524742 [ 2519.178433] ---[ end trace 0000000000000000 ]--- [ 2519.404860] RIP: 0010:strstr+0x32/0xb0 [ 2519.404872] Code: 41 56 41 55 41 54 53 80 3e 00 0f 84 80 00 00 00 49 89 f5 48 89 f0 48 83 c0 01 80 38 00 75 f7 4c 29 e8 49 89 fc 48 89 c3 74 43 <80> 3f 00 74 4e 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 48 39 [ 2519.404877] RSP: 0018:ffff9ff089e8b8e8 EFLAGS: 00010212 [ 2519.404882] RAX: 000000000000001f RBX: 000000000000001f RCX: 00000000ffffffff [ 2519.404886] RDX: 0000003854524742 RSI: ffffffffc1d9b9d1 RDI: 0000003854524742 [ 2519.404890] RBP: ffff9ff089e8b908 R08: 0000000000000000 R09: 727420646e65205b [ 2519.404893] R10: 5d20656361727420 R11: 646e65205b2d2d2d R12: 0000003854524742 [ 2519.404896] R13: ffffffffc1d9b9d1 R14: 0000000000000000 R15: 0000000000000000 [ 2519.404900] FS: 00007fbc0a7ba080(0000) GS:ffff8e637ff00000(0000) knlGS:0000000000000000 [ 2519.404904] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2519.404908] CR2: 0000003854524742 CR3: 00000001ebba6000 CR4: 0000000000750ef0 [ 2519.404911] PKRU: 55555554 [ 2519.404914] note: insmod[7534] exited with irqs disabled hrm wonder if its something else unrelated to your driver that I may have done on my machine. Ill hopefully find time today to look into this On Wed, Jun 19, 2024 at 10:25 AM benjamin maddocks ***@***.***> wrote: > Oh certainly, I was a little nervous about trying it and possibly having > writes going to unknown/possibly wrong areas, but alas my love of being > helpful has won! Ill compile and test right now, give me 15-20min. and Ill > report back > > > On Mon, Jun 17, 2024 at 6:01 PM PukNgae Cryolitia < > ***@***.***> wrote: > >> I have only found wm2 to test so far. I'll appreciate it if you could >> verify it on other devices and tell me the result. >> >> — >> Reply to this email directly, view it on GitHub >> , >> or unsubscribe >> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> >
bm16ton commented 5 months ago

ok got it to work with your offsets but had to address the dmi decode thing, heres the patch diff --git a/gpd-fan.c b/gpd-fan.c index f4781bc..5faaf41 100644 --- a/gpd-fan.c +++ b/gpd-fan.c @@ -345,7 +345,7 @@ static const struct dmi_system_id gpd_devices[] = { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "GPD"), DMI_MATCH(DMI_PRODUCT_NAME, "G1618-04"),

On Wed, Jun 19, 2024 at 10:30 AM benjamin maddocks @.***> wrote:

Well it seemed to dislike my dmi decode and errors on insmod, heres the dmesg;

[ 2519.176683] ------------[ cut here ]------------ [ 2519.176694] UBSAN: array-index-out-of-bounds in drivers/firmware/dmi_scan.c:850:23 [ 2519.176703] index 96 is out of range for type 'char *[23]' [ 2519.176708] CPU: 4 PID: 7534 Comm: insmod Tainted: G O 6.9.4-16ton #6 [ 2519.176717] Hardware name: GPD G1618-04/G1618-04, BIOS 0.58 04/18/2024 [ 2519.176721] Call Trace: [ 2519.176726] [ 2519.176732] dump_stack_lvl+0x70/0x90 [ 2519.176744] dump_stack+0x14/0x20 [ 2519.176751] ubsan_handle_out_of_bounds+0xab/0xe0 [ 2519.176762] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176771] ? strstr+0x71/0xb0 [ 2519.176783] dmi_matches+0x213/0x230 [ 2519.176793] dmi_first_match+0x29/0x50 [ 2519.176799] ? pfx_gpd_fan_init+0x10/0x10 [gpd_fan] [ 2519.176812] gpd_fan_init+0x27/0xff0 [gpd_fan] [ 2519.176826] ? kvfree+0x2c/0x40 [ 2519.176835] ? vfree.part.0+0xeb/0x250 [ 2519.176845] do_one_initcall+0x84/0x310 [ 2519.176852] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176859] ? kmalloc_trace+0x129/0x2d0 [ 2519.176868] ? do_init_module+0x22/0x220 [ 2519.176879] do_init_module+0x63/0x220 [ 2519.176886] load_module+0x24f6/0x25b0 [ 2519.176906] init_module_from_file+0x92/0xd0 [ 2519.176913] ? init_module_from_file+0x92/0xd0 [ 2519.176926] idempotent_init_module+0x104/0x290 [ 2519.176938] __x64_sys_finit_module+0x5f/0xc0 [ 2519.176947] x64_sys_call+0x1a11/0x2030 [ 2519.176953] do_syscall_64+0x6f/0x140 [ 2519.176964] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176973] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176979] ? putname+0x54/0x70 [ 2519.176989] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176995] ? do_sys_openat2+0x7d/0xc0 [ 2519.177007] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177013] ? __x64_sys_openat+0x54/0xa0 [ 2519.177022] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177028] ? syscall_exit_to_user_mode+0x81/0x170 [ 2519.177037] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177044] ? do_syscall_64+0x7b/0x140 [ 2519.177051] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177058] ? do_user_addr_fault+0x2fe/0x6b0 [ 2519.177065] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177072] ? irqentry_exit_to_user_mode+0x5d/0x140 [ 2519.177080] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177087] ? irqentry_exit+0x3f/0x50 [ 2519.177094] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177100] ? exc_page_fault+0x80/0xc0 [ 2519.177109] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 2519.177116] RIP: 0033:0x7fbc09f2725d [ 2519.177124] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05

<48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8b bb 0d 00 f7 d8 64 89 01 48 [ 2519.177130] RSP: 002b:00007ffd551c9628 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 2519.177139] RAX: ffffffffffffffda RBX: 000055cb92356750 RCX: 00007fbc09f2725d [ 2519.177144] RDX: 0000000000000000 RSI: 000055cb90a81e52 RDI: 0000000000000003 [ 2519.177148] RBP: 00007ffd551c96e0 R08: 0000000000000040 R09: 0000000000000000 [ 2519.177153] R10: 00007fbc0a003b20 R11: 0000000000000246 R12: 000055cb90a81e52 [ 2519.177157] R13: 0000000000000000 R14: 000055cb92359ed0 R15: 0000000000000000 [ 2519.177169] [ 2519.177172] ---[ end trace ]--- [ 2519.177176] ------------[ cut here ]------------ [ 2519.177179] UBSAN: array-index-out-of-bounds in drivers/firmware/dmi_scan.c:856:25 [ 2519.177185] index 96 is out of range for type 'char *[23]' [ 2519.177189] CPU: 4 PID: 7534 Comm: insmod Tainted: G O 6.9.4-16ton #6 [ 2519.177196] Hardware name: GPD G1618-04/G1618-04, BIOS 0.58 04/18/2024 [ 2519.177200] Call Trace: [ 2519.177204] [ 2519.177207] dump_stack_lvl+0x70/0x90 [ 2519.177215] dump_stack+0x14/0x20 [ 2519.177221] __ubsan_handle_out_of_bounds+0xab/0xe0 [ 2519.177230] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177237] ? strstr+0x71/0xb0 [ 2519.177245] dmi_matches+0x1c3/0x230 [ 2519.177253] dmi_first_match+0x29/0x50 [ 2519.177259] ? __pfx_gpd_fan_init+0x10/0x10 [gpd_fan] [ 2519.177272] gpd_fan_init+0x27/0xff0 [gpd_fan] [ 2519.177285] ? kvfree+0x2c/0x40 [ 2519.177292] ? vfree.part.0+0xeb/0x250 [ 2519.177301] do_one_initcall+0x84/0x310 [ 2519.177307] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177314] ? kmalloc_trace+0x129/0x2d0 [ 2519.177322] ? do_init_module+0x22/0x220 [ 2519.177331] do_init_module+0x63/0x220 [ 2519.177338] load_module+0x24f6/0x25b0 [ 2519.177358] init_module_from_file+0x92/0xd0 [ 2519.177365] ? init_module_from_file+0x92/0xd0 [ 2519.177378] idempotent_init_module+0x104/0x290 [ 2519.177390] __x64_sys_finit_module+0x5f/0xc0 [ 2519.177398] x64_sys_call+0x1a11/0x2030 [ 2519.177404] do_syscall_64+0x6f/0x140 [ 2519.177414] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177423] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177429] ? putname+0x54/0x70 [ 2519.177437] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177444] ? do_sys_openat2+0x7d/0xc0 [ 2519.177454] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177460] ? __x64_sys_openat+0x54/0xa0 [ 2519.177468] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177475] ? syscall_exit_to_user_mode+0x81/0x170 [ 2519.177483] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177490] ? do_syscall_64+0x7b/0x140 [ 2519.177497] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177504] ? do_user_addr_fault+0x2fe/0x6b0 [ 2519.177509] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177516] ? irqentry_exit_to_user_mode+0x5d/0x140 [ 2519.177525] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177531] ? irqentry_exit+0x3f/0x50 [ 2519.177538] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177545] ? exc_page_fault+0x80/0xc0 [ 2519.177554] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 2519.177559] RIP: 0033:0x7fbc09f2725d [ 2519.177565] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8b bb 0d 00 f7 d8 64 89 01 48 [ 2519.177571] RSP: 002b:00007ffd551c9628 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 2519.177578] RAX: ffffffffffffffda RBX: 000055cb92356750 RCX: 00007fbc09f2725d [ 2519.177582] RDX: 0000000000000000 RSI: 000055cb90a81e52 RDI: 0000000000000003 [ 2519.177586] RBP: 00007ffd551c96e0 R08: 0000000000000040 R09: 0000000000000000 [ 2519.177590] R10: 00007fbc0a003b20 R11: 0000000000000246 R12: 000055cb90a81e52 [ 2519.177594] R13: 0000000000000000 R14: 000055cb92359ed0 R15: 0000000000000000 [ 2519.177605] [ 2519.177609] ---[ end trace ]--- [ 2519.177614] BUG: unable to handle page fault for address: 0000003854524742 [ 2519.177618] #PF: supervisor read access in kernel mode [ 2519.177623] #PF: error_code(0x0000) - not-present page [ 2519.177627] PGD 0 P4D 0 [ 2519.177635] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 2519.177641] CPU: 4 PID: 7534 Comm: insmod Tainted: G O 6.9.4-16ton #6 [ 2519.177647] Hardware name: GPD G1618-04/G1618-04, BIOS 0.58 04/18/2024 [ 2519.177651] RIP: 0010:strstr+0x32/0xb0 [ 2519.177658] Code: 41 56 41 55 41 54 53 80 3e 00 0f 84 80 00 00 00 49 89 f5 48 89 f0 48 83 c0 01 80 38 00 75 f7 4c 29 e8 49 89 fc 48 89 c3 74 43 <80> 3f 00 74 4e 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 48 39 [ 2519.177663] RSP: 0018:ffff9ff089e8b8e8 EFLAGS: 00010212 [ 2519.177669] RAX: 000000000000001f RBX: 000000000000001f RCX: 00000000ffffffff [ 2519.177674] RDX: 0000003854524742 RSI: ffffffffc1d9b9d1 RDI: 0000003854524742 [ 2519.177678] RBP: ffff9ff089e8b908 R08: 0000000000000000 R09: 727420646e65205b [ 2519.177682] R10: 5d20656361727420 R11: 646e65205b2d2d2d R12: 0000003854524742 [ 2519.177686] R13: ffffffffc1d9b9d1 R14: 0000000000000000 R15: 0000000000000000 [ 2519.177691] FS: 00007fbc0a7ba080(0000) GS:ffff8e637ff00000(0000) knlGS:0000000000000000 [ 2519.177696] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2519.177701] CR2: 0000003854524742 CR3: 00000001ebba6000 CR4: 0000000000750ef0 [ 2519.177706] PKRU: 55555554 [ 2519.177710] Call Trace: [ 2519.177713] [ 2519.177717] ? show_regs+0x63/0x70 [ 2519.177726] ? __die+0x23/0x70 [ 2519.177734] ? page_fault_oops+0x150/0x510 [ 2519.177745] ? do_user_addr_fault+0x2cc/0x6b0 [ 2519.177753] ? exc_page_fault+0x6f/0xc0 [ 2519.177762] ? asm_exc_page_fault+0x2b/0x30 [ 2519.177774] ? strstr+0x32/0xb0 [ 2519.177781] ? strstr+0x71/0xb0 [ 2519.177789] dmi_matches+0x9b/0x230 [ 2519.177797] dmi_first_match+0x29/0x50 [ 2519.177802] ? __pfx_gpd_fan_init+0x10/0x10 [gpd_fan] [ 2519.177815] gpd_fan_init+0x27/0xff0 [gpd_fan] [ 2519.177828] ? kvfree+0x2c/0x40 [ 2519.177835] ? vfree.part.0+0xeb/0x250 [ 2519.177843] do_one_initcall+0x84/0x310 [ 2519.177849] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177856] ? kmalloc_trace+0x129/0x2d0 [ 2519.177864] ? do_init_module+0x22/0x220 [ 2519.177873] do_init_module+0x63/0x220 [ 2519.177880] load_module+0x24f6/0x25b0 [ 2519.177900] init_module_from_file+0x92/0xd0 [ 2519.177907] ? init_module_from_file+0x92/0xd0 [ 2519.177920] idempotent_init_module+0x104/0x290 [ 2519.177932] __x64_sys_finit_module+0x5f/0xc0 [ 2519.177940] x64_sys_call+0x1a11/0x2030 [ 2519.177946] do_syscall_64+0x6f/0x140 [ 2519.177956] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177965] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177971] ? putname+0x54/0x70 [ 2519.177979] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177985] ? do_sys_openat2+0x7d/0xc0 [ 2519.177995] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178002] ? __x64_sys_openat+0x54/0xa0 [ 2519.178010] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178016] ? syscall_exit_to_user_mode+0x81/0x170 [ 2519.178025] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178031] ? do_syscall_64+0x7b/0x140 [ 2519.178039] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178045] ? do_user_addr_fault+0x2fe/0x6b0 [ 2519.178051] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178057] ? irqentry_exit_to_user_mode+0x5d/0x140 [ 2519.178066] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178072] ? irqentry_exit+0x3f/0x50 [ 2519.178080] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178086] ? exc_page_fault+0x80/0xc0 [ 2519.178095] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 2519.178101] RIP: 0033:0x7fbc09f2725d [ 2519.178106] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8b bb 0d 00 f7 d8 64 89 01 48 [ 2519.178111] RSP: 002b:00007ffd551c9628 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 2519.178117] RAX: ffffffffffffffda RBX: 000055cb92356750 RCX: 00007fbc09f2725d [ 2519.178122] RDX: 0000000000000000 RSI: 000055cb90a81e52 RDI: 0000000000000003 [ 2519.178126] RBP: 00007ffd551c96e0 R08: 0000000000000040 R09: 0000000000000000 [ 2519.178130] R10: 00007fbc0a003b20 R11: 0000000000000246 R12: 000055cb90a81e52 [ 2519.178134] R13: 0000000000000000 R14: 000055cb92359ed0 R15: 0000000000000000 [ 2519.178145] [ 2519.178148] Modules linked in: gpd_fan(O+) nls_utf8 befs rfcomm ib_core xt_conntrack nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack_netlink nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xfrm_user xfrm_algo xt_addrtype nft_compat nf_tables br_netfilter bridge stp llc ccm overlay algif_hash algif_skcipher af_alg qrtr bnep xpad ff_memless snd_hda_codec_realtek intel_rapl_msr snd_hda_codec_generic snd_hda_scodec_component btusb btrtl amd_atl btintel intel_rapl_common btbcm btmtk binfmt_misc snd_hda_codec_hdmi snd_hda_intel edac_mce_amd joydev snd_intel_dspcfg snd_intel_sdw_acpi kvm_amd snd_hda_codec snd_hda_core kvm snd_hwdep crct10dif_pclmul amdgpu ghash_clmulni_intel snd_pcm nls_iso8859_1 sha512_ssse3 iwlmvm sha256_ssse3 snd_seq_midi amdxcp sha1_ssse3 snd_seq_midi_event drm_exec gpu_sched mac80211 aesni_intel crypto_simd drm_buddy snd_rawmidi cryptd libarc4 drm_suballoc_helper drm_ttm_helper snd_seq ttm rapl snd_seq_device wmi_bmof drm_display_helper snd_timer cec iwlwifi rc_core snd drm_kms_helper bmi260_i2c(O) cfg80211 [ 2519.178319] i2c_piix4 ccp k10temp i2c_algo_bit soundcore bmi260_core(O) industrialio_triggered_buffer kfifo_buf industrialio input_leds goodix_ts serio_raw mac_hid msr parport_pc ppdev lp parport efi_pstore drm nfnetlink dmi_sysfs ip_tables x_tables btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 cdc_ether usbnet r8152 mii uas usb_storage hid_generic usbhid xhci_pci crc32_pclmul xhci_pci_renesas thunderbolt nvme xhci_hcd nvme_core video wmi [ 2519.178427] CR2: 0000003854524742 [ 2519.178433] ---[ end trace 0000000000000000 ]--- [ 2519.404860] RIP: 0010:strstr+0x32/0xb0 [ 2519.404872] Code: 41 56 41 55 41 54 53 80 3e 00 0f 84 80 00 00 00 49 89 f5 48 89 f0 48 83 c0 01 80 38 00 75 f7 4c 29 e8 49 89 fc 48 89 c3 74 43 <80> 3f 00 74 4e 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 48 39 [ 2519.404877] RSP: 0018:ffff9ff089e8b8e8 EFLAGS: 00010212 [ 2519.404882] RAX: 000000000000001f RBX: 000000000000001f RCX: 00000000ffffffff [ 2519.404886] RDX: 0000003854524742 RSI: ffffffffc1d9b9d1 RDI: 0000003854524742 [ 2519.404890] RBP: ffff9ff089e8b908 R08: 0000000000000000 R09: 727420646e65205b [ 2519.404893] R10: 5d20656361727420 R11: 646e65205b2d2d2d R12: 0000003854524742 [ 2519.404896] R13: ffffffffc1d9b9d1 R14: 0000000000000000 R15: 0000000000000000 [ 2519.404900] FS: 00007fbc0a7ba080(0000) GS:ffff8e637ff00000(0000) knlGS:0000000000000000 [ 2519.404904] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2519.404908] CR2: 0000003854524742 CR3: 00000001ebba6000 CR4: 0000000000750ef0 [ 2519.404911] PKRU: 55555554 [ 2519.404914] note: insmod[7534] exited with irqs disabled hrm wonder if its something else unrelated to your driver that I may have done on my machine. Ill hopefully find time today to look into this On Wed, Jun 19, 2024 at 10:25 AM benjamin maddocks ***@***.***> wrote: > Oh certainly, I was a little nervous about trying it and possibly having > writes going to unknown/possibly wrong areas, but alas my love of being > helpful has won! Ill compile and test right now, give me 15-20min. and Ill > report back > > > On Mon, Jun 17, 2024 at 6:01 PM PukNgae Cryolitia < > ***@***.***> wrote: > >> I have only found wm2 to test so far. I'll appreciate it if you could >> verify it on other devices and tell me the result. >> >> — >> Reply to this email directly, view it on GitHub >> , >> or unsubscribe >> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> >
bm16ton commented 5 months ago

Actually now ive been thinking on it, I should probly test to make sure it isnt stoping on the "default string" option and is in fact using the "Ver. 1.0" option. Its so hot today dunno if ill get back to it today. Ill update once I know for absolute certain

On Wed, Jun 19, 2024 at 5:23 PM benjamin maddocks @.***> wrote:

ok got it to work with your offsets but had to address the dmi decode thing, heres the patch diff --git a/gpd-fan.c b/gpd-fan.c index f4781bc..5faaf41 100644 --- a/gpd-fan.c +++ b/gpd-fan.c @@ -345,7 +345,7 @@ static const struct dmi_system_id gpd_devices[] = { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "GPD"), DMI_MATCH(DMI_PRODUCT_NAME, "G1618-04"),

  • DMI_MATCH(DMI_PRODUCT_VERSION, "Default string"),
  • DMI_MATCH(DMI_BOARD_VERSION, "Default string"), }, .driver_data = (void *) &gpd_win4_quirk, }, @@ -354,7 +354,7 @@ static const struct dmi_system_id gpd_devices[] = { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "GPD"), DMI_MATCH(DMI_PRODUCT_NAME, "G1618-04"),
  • DMI_MATCH(DMI_PRODUCT_VERSION, "Ver. 1.0"),
  • DMI_MATCH(DMI_BOARD_VERSION, "Ver. 1.0"), }, .driver_data = (void *) &gpd_wm2_quirk, },

On Wed, Jun 19, 2024 at 10:30 AM benjamin maddocks @.***> wrote:

Well it seemed to dislike my dmi decode and errors on insmod, heres the dmesg;

[ 2519.176683] ------------[ cut here ]------------ [ 2519.176694] UBSAN: array-index-out-of-bounds in drivers/firmware/dmi_scan.c:850:23 [ 2519.176703] index 96 is out of range for type 'char *[23]' [ 2519.176708] CPU: 4 PID: 7534 Comm: insmod Tainted: G O 6.9.4-16ton #6 [ 2519.176717] Hardware name: GPD G1618-04/G1618-04, BIOS 0.58 04/18/2024 [ 2519.176721] Call Trace: [ 2519.176726] [ 2519.176732] dump_stack_lvl+0x70/0x90 [ 2519.176744] dump_stack+0x14/0x20 [ 2519.176751] ubsan_handle_out_of_bounds+0xab/0xe0 [ 2519.176762] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176771] ? strstr+0x71/0xb0 [ 2519.176783] dmi_matches+0x213/0x230 [ 2519.176793] dmi_first_match+0x29/0x50 [ 2519.176799] ? pfx_gpd_fan_init+0x10/0x10 [gpd_fan] [ 2519.176812] gpd_fan_init+0x27/0xff0 [gpd_fan] [ 2519.176826] ? kvfree+0x2c/0x40 [ 2519.176835] ? vfree.part.0+0xeb/0x250 [ 2519.176845] do_one_initcall+0x84/0x310 [ 2519.176852] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176859] ? kmalloc_trace+0x129/0x2d0 [ 2519.176868] ? do_init_module+0x22/0x220 [ 2519.176879] do_init_module+0x63/0x220 [ 2519.176886] load_module+0x24f6/0x25b0 [ 2519.176906] init_module_from_file+0x92/0xd0 [ 2519.176913] ? init_module_from_file+0x92/0xd0 [ 2519.176926] idempotent_init_module+0x104/0x290 [ 2519.176938] __x64_sys_finit_module+0x5f/0xc0 [ 2519.176947] x64_sys_call+0x1a11/0x2030 [ 2519.176953] do_syscall_64+0x6f/0x140 [ 2519.176964] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176973] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176979] ? putname+0x54/0x70 [ 2519.176989] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.176995] ? do_sys_openat2+0x7d/0xc0 [ 2519.177007] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177013] ? __x64_sys_openat+0x54/0xa0 [ 2519.177022] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177028] ? syscall_exit_to_user_mode+0x81/0x170 [ 2519.177037] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177044] ? do_syscall_64+0x7b/0x140 [ 2519.177051] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177058] ? do_user_addr_fault+0x2fe/0x6b0 [ 2519.177065] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177072] ? irqentry_exit_to_user_mode+0x5d/0x140 [ 2519.177080] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177087] ? irqentry_exit+0x3f/0x50 [ 2519.177094] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177100] ? exc_page_fault+0x80/0xc0 [ 2519.177109] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 2519.177116] RIP: 0033:0x7fbc09f2725d [ 2519.177124] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05

<48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8b bb 0d 00 f7 d8 64 89 01 48 [ 2519.177130] RSP: 002b:00007ffd551c9628 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 2519.177139] RAX: ffffffffffffffda RBX: 000055cb92356750 RCX: 00007fbc09f2725d [ 2519.177144] RDX: 0000000000000000 RSI: 000055cb90a81e52 RDI: 0000000000000003 [ 2519.177148] RBP: 00007ffd551c96e0 R08: 0000000000000040 R09: 0000000000000000 [ 2519.177153] R10: 00007fbc0a003b20 R11: 0000000000000246 R12: 000055cb90a81e52 [ 2519.177157] R13: 0000000000000000 R14: 000055cb92359ed0 R15: 0000000000000000 [ 2519.177169] [ 2519.177172] ---[ end trace ]--- [ 2519.177176] ------------[ cut here ]------------ [ 2519.177179] UBSAN: array-index-out-of-bounds in drivers/firmware/dmi_scan.c:856:25 [ 2519.177185] index 96 is out of range for type 'char *[23]' [ 2519.177189] CPU: 4 PID: 7534 Comm: insmod Tainted: G O 6.9.4-16ton #6 [ 2519.177196] Hardware name: GPD G1618-04/G1618-04, BIOS 0.58 04/18/2024 [ 2519.177200] Call Trace: [ 2519.177204] [ 2519.177207] dump_stack_lvl+0x70/0x90 [ 2519.177215] dump_stack+0x14/0x20 [ 2519.177221] __ubsan_handle_out_of_bounds+0xab/0xe0 [ 2519.177230] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177237] ? strstr+0x71/0xb0 [ 2519.177245] dmi_matches+0x1c3/0x230 [ 2519.177253] dmi_first_match+0x29/0x50 [ 2519.177259] ? __pfx_gpd_fan_init+0x10/0x10 [gpd_fan] [ 2519.177272] gpd_fan_init+0x27/0xff0 [gpd_fan] [ 2519.177285] ? kvfree+0x2c/0x40 [ 2519.177292] ? vfree.part.0+0xeb/0x250 [ 2519.177301] do_one_initcall+0x84/0x310 [ 2519.177307] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177314] ? kmalloc_trace+0x129/0x2d0 [ 2519.177322] ? do_init_module+0x22/0x220 [ 2519.177331] do_init_module+0x63/0x220 [ 2519.177338] load_module+0x24f6/0x25b0 [ 2519.177358] init_module_from_file+0x92/0xd0 [ 2519.177365] ? init_module_from_file+0x92/0xd0 [ 2519.177378] idempotent_init_module+0x104/0x290 [ 2519.177390] __x64_sys_finit_module+0x5f/0xc0 [ 2519.177398] x64_sys_call+0x1a11/0x2030 [ 2519.177404] do_syscall_64+0x6f/0x140 [ 2519.177414] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177423] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177429] ? putname+0x54/0x70 [ 2519.177437] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177444] ? do_sys_openat2+0x7d/0xc0 [ 2519.177454] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177460] ? __x64_sys_openat+0x54/0xa0 [ 2519.177468] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177475] ? syscall_exit_to_user_mode+0x81/0x170 [ 2519.177483] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177490] ? do_syscall_64+0x7b/0x140 [ 2519.177497] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177504] ? do_user_addr_fault+0x2fe/0x6b0 [ 2519.177509] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177516] ? irqentry_exit_to_user_mode+0x5d/0x140 [ 2519.177525] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177531] ? irqentry_exit+0x3f/0x50 [ 2519.177538] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177545] ? exc_page_fault+0x80/0xc0 [ 2519.177554] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 2519.177559] RIP: 0033:0x7fbc09f2725d [ 2519.177565] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8b bb 0d 00 f7 d8 64 89 01 48 [ 2519.177571] RSP: 002b:00007ffd551c9628 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 2519.177578] RAX: ffffffffffffffda RBX: 000055cb92356750 RCX: 00007fbc09f2725d [ 2519.177582] RDX: 0000000000000000 RSI: 000055cb90a81e52 RDI: 0000000000000003 [ 2519.177586] RBP: 00007ffd551c96e0 R08: 0000000000000040 R09: 0000000000000000 [ 2519.177590] R10: 00007fbc0a003b20 R11: 0000000000000246 R12: 000055cb90a81e52 [ 2519.177594] R13: 0000000000000000 R14: 000055cb92359ed0 R15: 0000000000000000 [ 2519.177605] [ 2519.177609] ---[ end trace ]--- [ 2519.177614] BUG: unable to handle page fault for address: 0000003854524742 [ 2519.177618] #PF: supervisor read access in kernel mode [ 2519.177623] #PF: error_code(0x0000) - not-present page [ 2519.177627] PGD 0 P4D 0 [ 2519.177635] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 2519.177641] CPU: 4 PID: 7534 Comm: insmod Tainted: G O 6.9.4-16ton #6 [ 2519.177647] Hardware name: GPD G1618-04/G1618-04, BIOS 0.58 04/18/2024 [ 2519.177651] RIP: 0010:strstr+0x32/0xb0 [ 2519.177658] Code: 41 56 41 55 41 54 53 80 3e 00 0f 84 80 00 00 00 49 89 f5 48 89 f0 48 83 c0 01 80 38 00 75 f7 4c 29 e8 49 89 fc 48 89 c3 74 43 <80> 3f 00 74 4e 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 48 39 [ 2519.177663] RSP: 0018:ffff9ff089e8b8e8 EFLAGS: 00010212 [ 2519.177669] RAX: 000000000000001f RBX: 000000000000001f RCX: 00000000ffffffff [ 2519.177674] RDX: 0000003854524742 RSI: ffffffffc1d9b9d1 RDI: 0000003854524742 [ 2519.177678] RBP: ffff9ff089e8b908 R08: 0000000000000000 R09: 727420646e65205b [ 2519.177682] R10: 5d20656361727420 R11: 646e65205b2d2d2d R12: 0000003854524742 [ 2519.177686] R13: ffffffffc1d9b9d1 R14: 0000000000000000 R15: 0000000000000000 [ 2519.177691] FS: 00007fbc0a7ba080(0000) GS:ffff8e637ff00000(0000) knlGS:0000000000000000 [ 2519.177696] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2519.177701] CR2: 0000003854524742 CR3: 00000001ebba6000 CR4: 0000000000750ef0 [ 2519.177706] PKRU: 55555554 [ 2519.177710] Call Trace: [ 2519.177713] [ 2519.177717] ? show_regs+0x63/0x70 [ 2519.177726] ? __die+0x23/0x70 [ 2519.177734] ? page_fault_oops+0x150/0x510 [ 2519.177745] ? do_user_addr_fault+0x2cc/0x6b0 [ 2519.177753] ? exc_page_fault+0x6f/0xc0 [ 2519.177762] ? asm_exc_page_fault+0x2b/0x30 [ 2519.177774] ? strstr+0x32/0xb0 [ 2519.177781] ? strstr+0x71/0xb0 [ 2519.177789] dmi_matches+0x9b/0x230 [ 2519.177797] dmi_first_match+0x29/0x50 [ 2519.177802] ? __pfx_gpd_fan_init+0x10/0x10 [gpd_fan] [ 2519.177815] gpd_fan_init+0x27/0xff0 [gpd_fan] [ 2519.177828] ? kvfree+0x2c/0x40 [ 2519.177835] ? vfree.part.0+0xeb/0x250 [ 2519.177843] do_one_initcall+0x84/0x310 [ 2519.177849] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177856] ? kmalloc_trace+0x129/0x2d0 [ 2519.177864] ? do_init_module+0x22/0x220 [ 2519.177873] do_init_module+0x63/0x220 [ 2519.177880] load_module+0x24f6/0x25b0 [ 2519.177900] init_module_from_file+0x92/0xd0 [ 2519.177907] ? init_module_from_file+0x92/0xd0 [ 2519.177920] idempotent_init_module+0x104/0x290 [ 2519.177932] __x64_sys_finit_module+0x5f/0xc0 [ 2519.177940] x64_sys_call+0x1a11/0x2030 [ 2519.177946] do_syscall_64+0x6f/0x140 [ 2519.177956] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177965] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177971] ? putname+0x54/0x70 [ 2519.177979] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.177985] ? do_sys_openat2+0x7d/0xc0 [ 2519.177995] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178002] ? __x64_sys_openat+0x54/0xa0 [ 2519.178010] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178016] ? syscall_exit_to_user_mode+0x81/0x170 [ 2519.178025] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178031] ? do_syscall_64+0x7b/0x140 [ 2519.178039] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178045] ? do_user_addr_fault+0x2fe/0x6b0 [ 2519.178051] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178057] ? irqentry_exit_to_user_mode+0x5d/0x140 [ 2519.178066] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178072] ? irqentry_exit+0x3f/0x50 [ 2519.178080] ? srso_alias_return_thunk+0x5/0xfbef5 [ 2519.178086] ? exc_page_fault+0x80/0xc0 [ 2519.178095] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 2519.178101] RIP: 0033:0x7fbc09f2725d [ 2519.178106] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8b bb 0d 00 f7 d8 64 89 01 48 [ 2519.178111] RSP: 002b:00007ffd551c9628 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 2519.178117] RAX: ffffffffffffffda RBX: 000055cb92356750 RCX: 00007fbc09f2725d [ 2519.178122] RDX: 0000000000000000 RSI: 000055cb90a81e52 RDI: 0000000000000003 [ 2519.178126] RBP: 00007ffd551c96e0 R08: 0000000000000040 R09: 0000000000000000 [ 2519.178130] R10: 00007fbc0a003b20 R11: 0000000000000246 R12: 000055cb90a81e52 [ 2519.178134] R13: 0000000000000000 R14: 000055cb92359ed0 R15: 0000000000000000 [ 2519.178145] [ 2519.178148] Modules linked in: gpd_fan(O+) nls_utf8 befs rfcomm ib_core xt_conntrack nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack_netlink nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xfrm_user xfrm_algo xt_addrtype nft_compat nf_tables br_netfilter bridge stp llc ccm overlay algif_hash algif_skcipher af_alg qrtr bnep xpad ff_memless snd_hda_codec_realtek intel_rapl_msr snd_hda_codec_generic snd_hda_scodec_component btusb btrtl amd_atl btintel intel_rapl_common btbcm btmtk binfmt_misc snd_hda_codec_hdmi snd_hda_intel edac_mce_amd joydev snd_intel_dspcfg snd_intel_sdw_acpi kvm_amd snd_hda_codec snd_hda_core kvm snd_hwdep crct10dif_pclmul amdgpu ghash_clmulni_intel snd_pcm nls_iso8859_1 sha512_ssse3 iwlmvm sha256_ssse3 snd_seq_midi amdxcp sha1_ssse3 snd_seq_midi_event drm_exec gpu_sched mac80211 aesni_intel crypto_simd drm_buddy snd_rawmidi cryptd libarc4 drm_suballoc_helper drm_ttm_helper snd_seq ttm rapl snd_seq_device wmi_bmof drm_display_helper snd_timer cec iwlwifi rc_core snd drm_kms_helper bmi260_i2c(O) cfg80211 [ 2519.178319] i2c_piix4 ccp k10temp i2c_algo_bit soundcore bmi260_core(O) industrialio_triggered_buffer kfifo_buf industrialio input_leds goodix_ts serio_raw mac_hid msr parport_pc ppdev lp parport efi_pstore drm nfnetlink dmi_sysfs ip_tables x_tables btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 cdc_ether usbnet r8152 mii uas usb_storage hid_generic usbhid xhci_pci crc32_pclmul xhci_pci_renesas thunderbolt nvme xhci_hcd nvme_core video wmi [ 2519.178427] CR2: 0000003854524742 [ 2519.178433] ---[ end trace 0000000000000000 ]--- [ 2519.404860] RIP: 0010:strstr+0x32/0xb0 [ 2519.404872] Code: 41 56 41 55 41 54 53 80 3e 00 0f 84 80 00 00 00 49 89 f5 48 89 f0 48 83 c0 01 80 38 00 75 f7 4c 29 e8 49 89 fc 48 89 c3 74 43 <80> 3f 00 74 4e 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 48 39 [ 2519.404877] RSP: 0018:ffff9ff089e8b8e8 EFLAGS: 00010212 [ 2519.404882] RAX: 000000000000001f RBX: 000000000000001f RCX: 00000000ffffffff [ 2519.404886] RDX: 0000003854524742 RSI: ffffffffc1d9b9d1 RDI: 0000003854524742 [ 2519.404890] RBP: ffff9ff089e8b908 R08: 0000000000000000 R09: 727420646e65205b [ 2519.404893] R10: 5d20656361727420 R11: 646e65205b2d2d2d R12: 0000003854524742 [ 2519.404896] R13: ffffffffc1d9b9d1 R14: 0000000000000000 R15: 0000000000000000 [ 2519.404900] FS: 00007fbc0a7ba080(0000) GS:ffff8e637ff00000(0000) knlGS:0000000000000000 [ 2519.404904] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2519.404908] CR2: 0000003854524742 CR3: 00000001ebba6000 CR4: 0000000000750ef0 [ 2519.404911] PKRU: 55555554 [ 2519.404914] note: insmod[7534] exited with irqs disabled hrm wonder if its something else unrelated to your driver that I may have done on my machine. Ill hopefully find time today to look into this On Wed, Jun 19, 2024 at 10:25 AM benjamin maddocks ***@***.***> wrote: > Oh certainly, I was a little nervous about trying it and possibly having > writes going to unknown/possibly wrong areas, but alas my love of being > helpful has won! Ill compile and test right now, give me 15-20min. and Ill > report back > > > On Mon, Jun 17, 2024 at 6:01 PM PukNgae Cryolitia < > ***@***.***> wrote: > >> I have only found wm2 to test so far. I'll appreciate it if you could >> verify it on other devices and tell me the result. >> >> — >> Reply to this email directly, view it on GitHub >> , >> or unsubscribe >> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> >
Cryolitia commented 5 months ago

Oh certainly, I was a little nervous about trying it and possibly having writes going to unknown/possibly wrong areas

Actually, I am glad to find someone help me to review and double check the source. I have got part of the GPD's official tool's source code, and made this driver based on that. If you would like, leave your email address and I could send that to you.

but alas my love of being helpful has won! Ill compile and test right now

With appreciate !!!

heres the patch

Whether you would like to PR in person or let me apply it. What's your name and email to address your contribute in git.

bm16ton commented 5 months ago

Sorry for late reply, stupid life got in the way. I would love that source code!! My name is Benjamin Maddocks my email @.*** Being overly thorough I did check that its correctly using the right quirk and it is! I dunno if its even worth mentioning but I did write a led driver for the rgb, using the kernels plumbing for such things so the available triggers can be used. The whole hid thing is slower then id like for using triggers. I also have another driver I haven't posted that allows controlling the led's and setting the led mode and I just need to finish adding the keys so the keys can be redefined as well. I also have my fingerprint driver (kernel not userland) that takes a scan and a basic c app that saves it both in raw and png, but I havent added it to fprintd, was hopeful fprintd would simply need a single function that returned the image but it seems like its gonna be more convoluted then that . Back to the fan controller I know the kernel devs would consider the wmi interface the "correct" way and not accept anything else, but jesus ive had a hard time with it. What I have seems correct with my limited knowledge so clearly i'm missing something about the requirements. Also for your driver would it make sense to setup thermal_profile and zones? Ive done no reading/research thus far but I believe we can grab the zones directly from bios (what used to be called bios uhg) and/or offer to set custom ones as well. Tho again without research it may require switching to platform driver to use as parent for hwmon and thermal. Just spit balling but these userland apps seem to like setting up zones. I dont think ive ever collaborated on anything before (old dog learning tricks, is me and coding). I wouldn't mind you applying the PR but I feel like that's probly rude of me. I think I can figure out how to PR, ha, well see.

On Fri, Jun 21, 2024 at 2:16 PM PukNgae Cryolitia @.***> wrote:

Oh certainly, I was a little nervous about trying it and possibly having writes going to unknown/possibly wrong areas

Actually, I am glad to find someone help me to review and double check the source. I have got part of the GPD's official tool's source code, and made this driver based on that. If you would like, leave your email address and I could send that to you.

but alas my love of being helpful has won! Ill compile and test right now

With appreciate !!!

heres the patch

Whether you would like to PR in person or let me apply it. What's your name and email to address your contribute in git.

— Reply to this email directly, view it on GitHub https://github.com/Cryolitia/gpd-fan-driver/issues/6#issuecomment-2183221791, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAWMPZ5C2IHKMGJ56ZANQTZIRUYRAVCNFSM6AAAAABJM46PXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTGIZDCNZZGE . You are receiving this because you authored the thread.Message ID: @.***>

Cryolitia commented 5 months ago

Your email seems to be automatically hiden, see on github website: https://github.com/Cryolitia/gpd-fan-driver/issues/6#issuecomment-2183979515

You could also email me directly at Cryolitia@gmail.com

Cryolitia commented 5 months ago

I don't have a win4, my device is wm2, so I'm sorry that I don't care about win4 stuff. But there's an official GPD discord server and a Linux channel in it. You could discuss it there.

GPD uses many fingerprint sensors from different suppliers for different devices. It would be helpful if you could dertermine which are you talking by lsusb

Could you please clarify what are you talking about "thermal_profile and zones"

I have seen your PR eariler, good job!