AMD Rayon R7 5800H Install Monterey kernel Panic

zxc2689963

Active member
AMD OS X Member
Feb 27, 2022
135
92
28
Hello everyone, the Monterey kernel panic problem has been solved for AMD R7 5800H notebook installation. It is a great thing that the CPU can now run on 8 cores. Thank you guys very much.Thank them for discovering the problem and providing kernel patches @ExtremeX@Visual

Brand: Lenovo
Model: Legion 5 6th Gen
CPU: AMD Ryzen 7 5800h
GPU: AMD Radeon RX 6600m 8GB ( Separate GPU mode)
HDD: Samsung SSD 970 EVO Plus 1TB (1000 GB, PCI-E 3.0 x4)
WDS500G3X0C-00SJG0 (500 GB, PCI-E 3.0 x4)
Network: RealTek Semiconductor RTL8168/8111 PCI-E Gigabit Ethernet NIC
Intel(R) Wi-Fi 6E AX210 160MHz
Ram: x2 8GB 3200mhz ddr4
Display: 15.6 1080p 165HZ

Updated October 5, 2023
Problems solved:
1. You do not need to disable XHCI
2. The microphone problem is rectified
3. Monitor brightness can be adjusted, only in Ventura

Unresolved issues:
Failure to wake from sleep

 

Attachments

Last edited:
Solution
Panic from Monterey 12.6
View attachment 7258
Thanks. I looked at the sched_prim.c file in the XNU Kernel source code (nice of Apple to let us know exactly where to search) and found that it's related to the TSC (Time Stamp Counter) Syncronization of the CPU cores. The section of the code which gives the panic is: https://github.com/apple-oss-distributions/xnu/blob/xnu-8020.140.41/osfmk/kern/sched_prim.c#L2836
Unfortunately Apple didn't update the XNU Source Code for macOS 12.6 yet, but I still managed to find the place where it calls the panic.
Image 1 is the code of XNU that panics if the time between cores does not match (not syncronized properly).

As seen when comparing the Big Sur and Monterey code (Image 2), Big Sur...
I didn't find any solution and focused on making EFI as compatible as possible, reducing the number of boot failures. So far so good, I can live with up to 5 forced restarts to enter the system with everything working.

So I went to try to make Sleep/Wake work. The system is going into sleep (machine turns off and the power LED is blinking, normal).

But when waking up, the date is usually 1 month ahead, time is also wrong and the system becomes unusable.

Can anyone point me to solutions for sleep/wake issues on an AMD platform?
Could you make your USB work?
 
Could you make your USB work?
As mentioned, I haven't found a solution.

But, as already reported by other users, if you don't use the GenericUSBXHCI kext, the system successfully boots (with all USB ports working) randomly.

With luck, no more than 5 consecutive attempts. Sometimes I have several consecutive success boots with Ventura. But there is no rule.

Trying to make sleep work so I don't have to do daily reboots, but it seems that there is something with the RTC of this notebook that is not compatible...
 
As mentioned, I haven't found a solution.

But, as already reported by other users, if you don't use the GenericUSBXHCI kext, the system successfully boots (with all USB ports working) randomly.

With luck, no more than 5 consecutive attempts. Sometimes I have several consecutive success boots with Ventura. But there is no rule.

Trying to make sleep work so I don't have to do daily reboots, but it seems that there is something with the RTC of this notebook that is not compatible...
Did you install from USB? I tried use USB flash to install. But it died out on entering installations. It went problematic when the bios tried to hand in the usb control to the flash.
 
Did you install from USB? I tried use USB flash to install. But it died out on entering installations. It went problematic when the bios tried to hand in the usb control to the flash.

My journey to Ventura:

I understand your question. If you're referring my trying in Proxmox, I abandoned that idea and went with "native" installs.

- I started with a Big Sur 11.2.3 USB stick using MacPro7,1 EFI (from the first post). I disabled all kexts or ssdts related to USB. On this machine, if you keep resetting when the boot hangs, one time you are lucky and it passes until the system starts (the installation or the installed system).

I think everyone is using GenericUSBXHCI.kext precisely because of this problem of the hang on boot, with something related to USB controllers.

After Big Sur was installed, using the wired network, I downloaded the Monterey installation and installed it on a new APFS volume. From Monterey, I did the same for Ventura, with the particularity of using a pendrive to start Ventura with this EFI (MacBookPro15,2) and the other 2 use the EFI that is in the NVME itself (MacPro7,1).

I have Windows and the 3 MacOS only for testing USB...
 
Hello, my GitHub repo has received a number of updates including a new workaround to the USB issue, with SSDT-XHC0-DISABLE, we are disabling the XHC0 controller which houses: the internal camera, the USB port on the left and the USB-C port. Disabling this controller results in a perfect boot with the other USB ports fully working.
 
Hello, my GitHub repo has received a number of updates including a new workaround to the USB issue, with SSDT-XHC0-DISABLE, we are disabling the XHC0 controller which houses: the internal camera, the USB port on the left and the USB-C port. Disabling this controller results in a perfect boot with the other USB ports fully working.
In mine, it kept freezing when loading the kext USBToolBox (XHC1: waitingForMatchingService), both in Monterey and in Ventura.

On my model (variant with the 5600H), the notebook's keyboard is also on the XHC0.

Thank you! Happy to know that there are more people insisting on a solution!!
 

Attachments

  • WhatsApp Image 2023-03-02 at 16.25.25.jpeg
    WhatsApp Image 2023-03-02 at 16.25.25.jpeg
    320.7 KB · Views: 16
  • xhc0.jpg
    xhc0.jpg
    85 KB · Views: 14
  • Like
Reactions: MinhHoangg
In mine, it kept freezing when loading the kext USBToolBox (XHC1: waitingForMatchingService), both in Monterey and in Ventura.

On my model (variant with the 5600H), the notebook's keyboard is also on the XHC0.

Thank you! Happy to know that there are more people insisting on a solution!!
Keyboard being USB connected is impossible, it's PS/2. I'm not sure why it doesn't work for you, perhaps try disabling UTB? -utboff boot arg. Or try unplugging all USB devices when it gets stuck.
 
Keyboard being USB connected is impossible, it's PS/2. I'm not sure why it doesn't work for you, perhaps try disabling UTB? -utboff boot arg. Or try unplugging all USB devices when it gets stuck.
With the -ubtoff argument it freezes at the same point as always.

About the keyboard, I don't understand either, when it works is precisely by loading the kext voodoops2, but I had already tested disabling port by port in the BIOS advanced options (using a Patch via pendrive to enable these advanced options). When I disabled the HS04 (ITE Device) the keyboard didn't work and I had to connect an external one. In these advanced BIOS options there is also no way to completely disable a controller, it does not let you disable any USB-C port (each controller has 2 of these).
 
With the -ubtoff argument it freezes at the same point as always.

About the keyboard, I don't understand either, when it works is precisely by loading the kext voodoops2, but I had already tested disabling port by port in the BIOS advanced options (using a Patch via pendrive to enable these advanced options). When I disabled the HS04 (ITE Device) the keyboard didn't work and I had to connect an external one. In these advanced BIOS options there is also no way to completely disable a controller, it does not let you disable any USB-C port (each controller has 2 of these).
ITE is an embedded device which controls onboard components, it's not the keyboard.
 
  • Like
Reactions: kalkmann
ITE is an embedded device which controls onboard components, it's not the keyboard.
Yes, I think the RGB, right? But anyway, it doesn't work here if I disable XHC0 or the specific port.

Hopefully mine is an isolated case.
 
Yes, I think the RGB, right? But anyway, it doesn't work here if I disable XHC0 or the specific port.

Hopefully mine is an isolated case.
Can you send your DSDT?
 

Attachments

  • Like
Reactions: ExtremeXT
Same case for me
This is the port that if I disable it via advanced bios (penboot patch - Counting from port 0, equivalent to HS4 with the ITE device mentioned in print above), it kills the keyboard and I have to connect an external keyboard.

 
Last edited:
This is the port that if I disable it via advanced bios (penboot patch - Counting from port 0, equivalent to HS4 with the ITE device mentioned in print above), it kills the keyboard and I have to connect an external keyboard.

my bios doesn't have the advanced option to disable a USB port
 
Hello, my GitHub repo has received a number of updates including a new workaround to the USB issue, with SSDT-XHC0-DISABLE, we are disabling the XHC0 controller which houses: the internal camera, the USB port on the left and the USB-C port. Disabling this controller results in a perfect boot with the other USB ports fully working.
Our models have a different USB configuration. Using the UMAF tool, I disabled the XHC1 and problem solved.

As a result, I was left without USB-A on the right, USB-C on the left, and internal bluetooth (Intel AX-210).

The rear 3 USB-A ports and 1 USB-C port, keyboard and camera are working.
 
Our models have a different USB configuration. Using the UMAF tool, I disabled the XHC1 and problem solved.

As a result, I was left without USB-A on the right, USB-C on the left, and internal bluetooth (Intel AX-210).

The rear 3 USB-A ports and 1 USB-C port, keyboard and camera are working.
You have the Legion 7 slim?
 
  • Like
Reactions: Jo-Toku
  AdBlock Detected
Sure, ad-blocking software does a great job at blocking ads, but it also blocks some useful and important features of our website. For the best possible site experience please take a moment to disable your AdBlocker.