Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 2009 patch to support v6.5.11 of linux #16

Closed
wants to merge 1 commit into from
Closed

Conversation

mikeeq
Copy link
Contributor

@mikeeq mikeeq commented Nov 16, 2023

2009 was failing a build for Fedora:

+ '[' '!' -f /root/rpmbuild/SOURCES/2009-apple-gmux-allow-switching-to-igpu-at-probe.patch ']'
Patch20: 2009-apple-gmux-allow-switching-to-igpu-at-probe.patch
+ case "$patch" in
+ git --work-tree=. apply
error: patch failed: drivers/platform/x86/apple-gmux.c:105
error: drivers/platform/x86/apple-gmux.c: patch does not apply
error: Bad exit status from /var/tmp/rpm-tmp.TjXQUq (%prep)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.TjXQUq (%prep)

@Redecorating
Copy link
Member

we might need a separate branch for linux 6.5 as I don't think it's going to be possible to have the same patchset work on 6.5 and 6.6

@mikeeq
Copy link
Contributor Author

mikeeq commented Nov 17, 2023

@Redecorating correct, but maybe it also fits into the linux 6.6, haven't checked that.

Do you know what could be an issue with builds newer than v6.5.2, they don't boot for me, they fail really early during the boot with a kernel panic on apple_hid/bce load.

v6.5.2 works for me but there's no screen brightness control.

EDIT: It's the same for v6.6

Patch20: 2009-apple-gmux-allow-switching-to-igpu-at-probe.patch
+ case "$patch" in
+ git --work-tree=. apply
error: patch failed: drivers/pci/vgaarb.c:145
error: drivers/pci/vgaarb.c: patch does not apply
error: Bad exit status from /var/tmp/rpm-tmp.6L3duw (%prep)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.6L3duw (%prep)

@Redecorating
Copy link
Member

what's that panic say? if you have the logs of the panic that could indicate what went wrong

@mikeeq
Copy link
Contributor Author

mikeeq commented Nov 17, 2023

what's that panic say? if you have the logs of the panic that could indicate what went wrong

PXL_20231117_071553307 MP

ov 17 07:18:41 mikeeMac systemd[1]: Finished modprobe@dm_mod.service - Load Kernel Module dm_mod.
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: bcm5974: bad trackpad package, length: 8
Nov 17 07:18:41 mikeeMac kernel: list_del corruption, ffff95d94ccf9858->next is LIST_POISON1 (dead000000000100)
Nov 17 07:18:41 mikeeMac kernel: ------------[ cut here ]------------
Nov 17 07:18:41 mikeeMac kernel: kernel BUG at lib/list_debug.c:53!
Nov 17 07:18:41 mikeeMac kernel: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
Nov 17 07:18:41 mikeeMac kernel: CPU: 0 PID: 1001 Comm: (udev-worker) Tainted: G         C         6.5.4-300.mbp.fc39.x86_64 #1
Nov 17 07:18:41 mikeeMac kernel: Hardware name: Apple Inc. MacBookPro16,2/Mac-5F9802EFE386AA28, BIOS 1968.100.17.0.0 (iBridge: 20.16.4252.0.0,0) 03/04/2023
Nov 17 07:18:41 mikeeMac kernel: RIP: 0010:__list_del_entry_valid+0x7f/0xc0
Nov 17 07:18:41 mikeeMac kernel: idma64 idma64.0: Found Intel integrated DMA 64-bit
Nov 17 07:18:41 mikeeMac kernel: Code: b9 94 a8 e8 53 60 99 ff 0f 0b 48 89 fe 48 c7 c7 80 b9 94 a8 e8 42 60 99 ff 0f 0b 48 89 fe 48 c7 c7 b0 b9 94 a8 e8 31 60 99 ff <0f> 0b 48 89 fe 48 89 ca 48 c7 c7 e8 b9 94 a8 e8 1d 60 99 ff 0f 0b
Nov 17 07:18:41 mikeeMac kernel: RSP: 0018:ffffa9f1c06dfcc8 EFLAGS: 00010046
Nov 17 07:18:41 mikeeMac kernel: RAX: 000000000000004e RBX: ffff95d94ccf9840 RCX: 0000000000000000
Nov 17 07:18:41 mikeeMac kernel: RDX: 0000000000000000 RSI: ffff95dcafe21540 RDI: ffff95dcafe21540
Nov 17 07:18:41 mikeeMac kernel: RBP: ffff95d94ccf9858 R08: 0000000000000000 R09: ffffa9f1c06dfb70
Nov 17 07:18:41 mikeeMac kernel: R10: 0000000000000003 R11: ffffffffa9345d28 R12: 0000000000000246
Nov 17 07:18:41 mikeeMac kernel: R13: 0000000000000000 R14: ffff95d94dcdacc8 R15: ffff95d940edb940
Nov 17 07:18:41 mikeeMac kernel: FS:  00007f2a23f49980(0000) GS:ffff95dcafe00000(0000) knlGS:0000000000000000
Nov 17 07:18:41 mikeeMac kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Nov 17 07:18:41 mikeeMac kernel: CR2: 000055ae75e8b028 CR3: 000000010bfea001 CR4: 0000000000770ef0
Nov 17 07:18:41 mikeeMac kernel: PKRU: 55555554
Nov 17 07:18:41 mikeeMac kernel: Call Trace:
Nov 17 07:18:41 mikeeMac kernel:  <TASK>
Nov 17 07:18:41 mikeeMac kernel:  ? die+0x36/0x90
Nov 17 07:18:41 mikeeMac kernel:  ? do_trap+0xda/0x100
Nov 17 07:18:41 mikeeMac kernel:  ? __list_del_entry_valid+0x7f/0xc0
Nov 17 07:18:41 mikeeMac kernel:  ? do_error_trap+0x6a/0x90
Nov 17 07:18:41 mikeeMac kernel:  ? __list_del_entry_valid+0x7f/0xc0
Nov 17 07:18:41 mikeeMac kernel:  ? exc_invalid_op+0x50/0x70
Nov 17 07:18:41 mikeeMac kernel:  ? __list_del_entry_valid+0x7f/0xc0
Nov 17 07:18:41 mikeeMac kernel:  ? asm_exc_invalid_op+0x1a/0x20
Nov 17 07:18:41 mikeeMac kernel:  ? __list_del_entry_valid+0x7f/0xc0
Nov 17 07:18:41 mikeeMac kernel:  ? __list_del_entry_valid+0x7f/0xc0
Nov 17 07:18:41 mikeeMac kernel:  usb_hcd_unlink_urb_from_ep+0x26/0x50
Nov 17 07:18:41 mikeeMac kernel:  bce_vhci_urb_request_cancel+0x6b/0x140 [apple_bce]
Nov 17 07:18:41 mikeeMac kernel:  usb_hcd_unlink_urb+0x7a/0xd0
Nov 17 07:18:41 mikeeMac kernel:  usb_kill_urb.part.0+0x2b/0xd0
Nov 17 07:18:41 mikeeMac kernel:  bcm5974_close+0x2d/0x60 [bcm5974]
Nov 17 07:18:41 mikeeMac kernel:  input_close_device+0x71/0x90
Nov 17 07:18:41 mikeeMac kernel:  evdev_release+0x10c/0x120
Nov 17 07:18:41 mikeeMac kernel:  __fput+0xf2/0x2a0
Nov 17 07:18:41 mikeeMac kernel:  task_work_run+0x5a/0x90
Nov 17 07:18:41 mikeeMac kernel:  exit_to_user_mode_prepare+0x1e6/0x1f0
Nov 17 07:18:41 mikeeMac kernel:  syscall_exit_to_user_mode+0x1b/0x40
Nov 17 07:18:41 mikeeMac kernel:  do_syscall_64+0x6c/0x90
Nov 17 07:18:41 mikeeMac kernel:  ? evdev_ioctl+0x72/0x90
Nov 17 07:18:41 mikeeMac kernel:  ? syscall_exit_to_user_mode+0x2b/0x40
Nov 17 07:18:41 mikeeMac kernel:  ? do_syscall_64+0x6c/0x90
Nov 17 07:18:41 mikeeMac kernel:  ? do_syscall_64+0x6c/0x90
Nov 17 07:18:41 mikeeMac kernel:  ? syscall_exit_to_user_mode+0x2b/0x40
Nov 17 07:18:41 mikeeMac kernel:  ? do_syscall_64+0x6c/0x90
Nov 17 07:18:41 mikeeMac kernel:  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
Nov 17 07:18:41 mikeeMac kernel: RIP: 0033:0x7f2a24921554
Nov 17 07:18:41 mikeeMac kernel: Code: 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 80 3d 15 ce 0d 00 00 74 13 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3c c3 0f 1f 00 55 48 89 e5 48 83 ec 10 89 7d
Nov 17 07:18:41 mikeeMac kernel: RSP: 002b:00007ffeac943fc8 EFLAGS: 00000202 ORIG_RAX: 0000000000000003
Nov 17 07:18:41 mikeeMac kernel: RAX: 0000000000000000 RBX: 0000000000000011 RCX: 00007f2a24921554
Nov 17 07:18:41 mikeeMac kernel: RDX: 0000000000000000 RSI: 0000000080184541 RDI: 0000000000000011
Nov 17 07:18:41 mikeeMac kernel: RBP: 00007ffeac943fe0 R08: 0000000000000069 R09: 0000000000000000
Nov 17 07:18:41 mikeeMac kernel: R10: 0000000000000000 R11: 0000000000000202 R12: 00007f2a23f497f0
Nov 17 07:18:41 mikeeMac kernel: R13: 0000000000000000 R14: 0000000000000005 R15: 000055ae74feefd0
Nov 17 07:18:41 mikeeMac kernel:  </TASK>
Nov 17 07:18:41 mikeeMac kernel: Modules linked in: btintel processor_thermal_rapl idma64 snd_hwdep i2c_i801 mei_me mmc_core bluetooth sbs(+) i2c_smbus intel_rapl_common mei thunderbolt(+) joydev int340x_thermal_zone sbshc intel_soc_dts_iosf apple_mfi_f>
Nov 17 07:18:41 mikeeMac kernel: ---[ end trace 0000000000000000 ]---
Nov 17 07:18:41 mikeeMac kernel: RIP: 0010:__list_del_entry_valid+0x7f/0xc0
Nov 17 07:18:41 mikeeMac kernel: Code: b9 94 a8 e8 53 60 99 ff 0f 0b 48 89 fe 48 c7 c7 80 b9 94 a8 e8 42 60 99 ff 0f 0b 48 89 fe 48 c7 c7 b0 b9 94 a8 e8 31 60 99 ff <0f> 0b 48 89 fe 48 89 ca 48 c7 c7 e8 b9 94 a8 e8 1d 60 99 ff 0f 0b
Nov 17 07:18:41 mikeeMac kernel: RSP: 0018:ffffa9f1c06dfcc8 EFLAGS: 00010046
Nov 17 07:18:41 mikeeMac kernel: RAX: 000000000000004e RBX: ffff95d94ccf9840 RCX: 0000000000000000
Nov 17 07:18:41 mikeeMac kernel: RDX: 0000000000000000 RSI: ffff95dcafe21540 RDI: ffff95dcafe21540
Nov 17 07:18:41 mikeeMac kernel: RBP: ffff95d94ccf9858 R08: 0000000000000000 R09: ffffa9f1c06dfb70
Nov 17 07:18:41 mikeeMac kernel: R10: 0000000000000003 R11: ffffffffa9345d28 R12: 0000000000000246
Nov 17 07:18:41 mikeeMac kernel: R13: 0000000000000000 R14: ffff95d94dcdacc8 R15: ffff95d940edb940
Nov 17 07:18:41 mikeeMac kernel: FS:  00007f2a23f49980(0000) GS:ffff95dcafe00000(0000) knlGS:0000000000000000
Nov 17 07:18:41 mikeeMac kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Nov 17 07:18:41 mikeeMac kernel: CR2: 000055ae75e8b028 CR3: 000000010bfea001 CR4: 0000000000770ef0
Nov 17 07:18:41 mikeeMac kernel: PKRU: 55555554
Nov 17 07:18:41 mikeeMac kernel: note: (udev-worker)[1001] exited with irqs disabled
Nov 17 07:18:41 mikeeMac kernel: note: (udev-worker)[1001] exited with preempt_count 2
Nov 17 07:18:41 mikeeMac audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-fsck@dev-disk-by\x2duuid-ED5B\x2d3C96 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal>
Nov 17 07:18:41 mikeeMac systemd[1]: Finished systemd-fsck@dev-disk-by\x2duuid-ED5B\x2d3C96.service - File System Check on /dev/disk/by-uuid/ED5B-3C96.
Nov 17 07:18:41 mikeeMac systemd-udevd[996]: event7: Worker [1001] terminated by signal 11 (SEGV).
Nov 17 07:18:41 mikeeMac kernel: thunderbolt 0000:00:0d.3: can't derive routing for PCI INT A
Nov 17 07:18:41 mikeeMac kernel: thunderbolt 0000:00:0d.3: PCI INT A: not connected

@Redecorating
Copy link
Member

related to this t2linux/apple-bce-drv#11 i think. not sure if your copy of apple-bce has those changes but that pr still doesn't fix the urb cancellation issues properly (it fixes touchbar but breaks closing the camera device)

@mikeeq
Copy link
Contributor Author

mikeeq commented Nov 17, 2023

related to this t2linux/apple-bce-drv#11 i think. not sure if your copy of apple-bce has those changes but that pr still doesn't fix the urb cancellation issues properly (it fixes touchbar but breaks closing the camera device)

I'm using the one from this repo (https://github.com/t2linux/linux-t2-patches)

@392a5237
Copy link

The screen backlight does not work. Bluetooth doesn't work. No sleep.
v6.5.8-300.fc39

@Redecorating
Copy link
Member

Redecorating commented Nov 19, 2023

@mikeeq can you try adding this patch and see if it helps? c9188b1

Edit: Also 94bd455 oops

hmm doesn't build atm i'll try and fix it

Ok hopefully main...revert_urb_partial_fix will let you see if reverting those usb changes fixes your booting issue

@Redecorating
Copy link
Member

Also I've made https://github.com/t2linux/linux-t2-patches/tree/6.5 which should be compatible with 6.5.11. I'm not too sure if that's got the same changes as your branch here, but I think you might have copied directly from the terminal after using git diff, which changes tabs into spaces because your diff for this PR seems to change all the tabs to spaces in the patch.

@392a5237
Copy link

392a5237 commented Nov 20, 2023

The assembly started on branch 6.5

@392a5237
Copy link

392a5237 commented Nov 20, 2023

Also I've made https://github.com/t2linux/linux-t2-patches/tree/6.5 which should be compatible with 6.5.11. I'm not too sure if that's got the same changes as your branch here, but I think you might have copied directly from the terminal after using git diff, which changes tabs into spaces because your diff for this PR seems to change all the tabs to spaces in the patch.

6.5.11 - the backlight started working. But bluetooth doesn't work.
MacBookAir9.1.6.5.11.txt

Thunderbolt hotswap does not work. Doc Dell WD19TB

@sharpenedblade
Copy link
Contributor

Thunderbolt hotswap does not work

did you set pcie_ports=native

@mikeeq
Copy link
Contributor Author

mikeeq commented Nov 20, 2023

@mikeeq can you try adding this patch and see if it helps? c9188b1

Edit: Also 94bd455 oops

hmm doesn't build atm i'll try and fix it

Ok hopefully main...revert_urb_partial_fix will let you see if reverting those usb changes fixes your booting issue

https://github.com/mikeeq/mbp-fedora-kernel/pull/97/files

APPLE_SMC_DRIVER_BRANCH_NAME=revert_urb_partial_fix
APPLE_SMC_DRIVER_COMMIT_HASH=83ff92b6ee601be94e29295475fc7d70ff686a02

that's building, booting and working - all besides touchbar :D

@Redecorating
Copy link
Member

right, so for now we're in a bit of an awkward state where if we revert that, people will be grumpy about touchbar breaking. If we don't, camera will break sometimes and some macs like yours won't boot.

@AdityaGarg8
Copy link
Member

right, so for now we're in a bit of an awkward state where if we revert that, people will be grumpy about touchbar breaking. If we don't, camera will break sometimes and some macs like yours won't boot.

I guess we've come to a conclusion on that

@AdityaGarg8 AdityaGarg8 closed this May 7, 2024
@AdityaGarg8 AdityaGarg8 deleted the fix/2009_v6.5.11 branch August 5, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants