Jump to content
173 posts in this topic

Recommended Posts

@Sherlocks @gnpaone @whatnameisit Based on your kernel panic reports, I think you guys all have the same issue. In theory, that page fault should never happen.

 

I need more information, so please try this experimental build under the following scenarios.

RealtekCardReader_0.9.7_a359519+EXPSL_DEBUG.zip

 

Scenario 1:

1) Boot your computer without the SD card.

2) Put your computer into sleep.

3) Wait for a while, say 5 minutes, and wake up the computer.

--> Check: Can you wake up the computer properly? Is there a kernel panic?

4) If not, insert your card and check whether the card is working properly.

5) If everything is working fine, you do not need to dump the kernel log.

 

Scenario 2:

1) Boot your computer without the SD card.

2) When you see the desktop, insert the SD card. Your card should be working properly.

2) Put your computer into sleep with the card inserted. Do not remove the card while the computer is sleeping.

3) Wait for a while, say 5 minutes, and wake up the computer. Do not remove the card after the computer wakes up.

--> Check: Can you wake up the computer properly? Is there a kernel panic?

4) If there is no kernel panic, dump the kernel log now. Is your card mounted automatically after the computer wakes up? (Probably not at this moment.)

5) If the card is not mounted, remove the card and insert it back. You should be able to see your card now.

 

If you observe any kernel panics, please reboot your computer and dump the IOReg before and after the card is inserted.

 

--------------------------------------------------------------------------------

 

@mnfesq @SavageAUS Now it's a known, common issue that cards cannot be initialized with RTL8411B card reader. I will review the controller code when I am available.

 

@Fortitude Yes, this time it's better. Your kernel logs report several errors, but I think the fatal one is that the driver fail to tune your UHS-I card.

Please try again with the boot argument `-iosd3v3` to initialize the card at 3.3V. Do you have other cards to test with?

 

I am a little busy recently, so I may not respond timely.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Yeah I tried the latest Realtek + Friend kexts with no luck. Will wait for you to update for our chips. Appreciate your work. If I can help by providing anything for 8411 let me know.


Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

2 hours ago, Austere.J said:

@Sherlocks @gnpaone @whatnameisit Based on your kernel panic reports, I think you guys all have the same issue. In theory, that page fault should never happen.

 

I need more information, so please try this experimental build under the following scenarios.

RealtekCardReader_0.9.7_a359519+EXPSL_DEBUG.zip 220.36 kB · 4 downloads

 

Scenario 1:

1) Boot your computer without the SD card.

2) Put your computer into sleep.

3) Wait for a while, say 5 minutes, and wake up the computer.

--> Check: Can you wake up the computer properly? Is there a kernel panic?

4) If not, insert your card and check whether the card is working properly.

5) If everything is working fine, you do not need to dump the kernel log.

 

Scenario 2:

1) Boot your computer without the SD card.

2) When you see the desktop, insert the SD card. Your card should be working properly.

2) Put your computer into sleep with the card inserted. Do not remove the card while the computer is sleeping.

3) Wait for a while, say 5 minutes, and wake up the computer. Do not remove the card after the computer wakes up.

--> Check: Can you wake up the computer properly? Is there a kernel panic?

4) If there is no kernel panic, dump the kernel log now. Is your card mounted automatically after the computer wakes up? (Probably not at this moment.)

5) If the card is not mounted, remove the card and insert it back. You should be able to see your card now.

 

If you observe any kernel panics, please reboot your computer and dump the IOReg before and after the card is inserted.

 

--------------------------------------------------------------------------------

 

@mnfesq @SavageAUS Now it's a known, common issue that cards cannot be initialized with RTL8411B card reader. I will review the controller code when I am available.

 

@Fortitude Yes, this time it's better. Your kernel logs report several errors, but I think the fatal one is that the driver fail to tune your UHS-I card.

Please try again with the boot argument `-iosd3v3` to initialize the card at 3.3V. Do you have other cards to test with?

 

I am a little busy recently, so I may not respond timely.

 

thank you

i tested attached file.

 

here is process.

1. boot macos without inserted sdcard.

1. rtsx-boot-withoutsdcard.log

 

2. go sleep without inserted sdcard, then wakeup without inserted sdcard. it's no problem.

2. rtsx-afterwakeup_withoutsdcard.log

 

3. no reboot and no shutdown. go sleep again with inserted sdcard, then wakeup with inserted sdcard. get normal screen. it is no problem.

3. rtsx_afterwakeupwithsdcard, it works.log

 

4. go sleep again with inserted sdcard(i didn't touch sdcard after inserted 1 time), then wakeup, i got black screen.  i can't get kernel panic log. just black screen

 

 

thanks in advance.

Link to comment
Share on other sites

Adding `-iosd3v3` seemed to do the trick! My SD is now being mounted.

There’s just one problem though… The read/write speeds of my SD card are incredibly slow compared to Windows.

 

CrystalDiskMark.thumb.png.001654bb0c8689745ee709bc31ec5d10.png

305088356_BlackmagicDiskSpeedTest.thumb.png.b9fc58b3036de945dedf789b58a875ab.png

 

I’ve attached another kernel log with an SD card inserted and -iosd3v3` added.

rtsx-5260 Slow Read:Write.log

 

Aside from that, the driver seems to be very stable! Thank you so much for taking the time to write this driver!

If it helps, the only SD card that I have is this one, but I’m happy to buy any others in the future that you’d recommend for testing:

sandisk-extreme-plus-u3-90mbs-64gb.jpg.354f73d381373c4682f17965827ca45e.jpg

Link to comment
Share on other sites

20 minutes ago, Fortitude said:

Adding `-iosd3v3` seemed to do the trick! My SD is now being mounted.

There’s just one problem though… The read/write speeds are incredibly slow compared to Windows.

@Fortitude Well, the benchmarking method of CrystalDisk is different compared to BlackMagic Disk benchmark, so please try CrystalDisk available for mac

AmorphousDiskMark.app.zip

Edited by gnpaone
Link to comment
Share on other sites

Here's my results of AmorphousDiskMark when my SD card is inserted into the internal card reader:

1825157002_AmorphousDiskMarkSpeedTest.thumb.png.a819372af1b1121a7e07ee8a6028d5bd.png

 

And here's my results when attaching my SD card to a USB adapter and running the Blackmagic Disk benchmark again:

853845013_BlackmagicDIskTestSD-USBAdapter.thumb.png.f3ad6c4f30f360fe3c04c611d8dbc13c.png

 

Read/Write speeds are much slower than they should be in the internal card reader.

Edited by Fortitude
Link to comment
Share on other sites

19 minutes ago, Fortitude said:

I attached my SD card to a USB adapter and ran the Blackmagic Disk benchmark again.

No not like that, I mean use the app provided by me earlier to test in Mac, just for apples to apples comparison as windows results were posted by you already. I gave the same app. Blackmagic speed test is a bit complicated, for example your first and second pictures show different levels of the test so definitely the speed indication is different for different levels and the test order is not standard. 

Link to comment
Share on other sites

4 hours ago, Austere.J said:

Scenario 1:

1) Boot your computer without the SD card.

2) Put your computer into sleep.

3) Wait for a while, say 5 minutes, and wake up the computer.

--> Check: Can you wake up the computer properly? Is there a kernel panic?

4) If not, insert your card and check whether the card is working properly.

5) If everything is working fine, you do not need to dump the kernel log.

 

Scenario 2:

1) Boot your computer without the SD card.

2) When you see the desktop, insert the SD card. Your card should be working properly.

2) Put your computer into sleep with the card inserted. Do not remove the card while the computer is sleeping.

3) Wait for a while, say 5 minutes, and wake up the computer. Do not remove the card after the computer wakes up.

--> Check: Can you wake up the computer properly? Is there a kernel panic?

4) If there is no kernel panic, dump the kernel log now. Is your card mounted automatically after the computer wakes up? (Probably not at this moment.)

5) If the card is not mounted, remove the card and insert it back. You should be able to see your card now.

 

If you observe any kernel panics, please reboot your computer and dump the IOReg before and after the card is inserted.

@Austere.J I did test the kext provided by you. There are pretty interesting results this time.

 

Scenario 1:

Everything went well and Mac behaved normally. Nothing unusual. So here it works fine.

 

Scenario 2:

Here's where the twist occurs. I did tests two times (well the reason is only to gather IOReg dumps with and without sdcard inserted during force reboot after kernel panic as you asked in the last). This time the kernel log is very different compared to kernel logs provided by all of us in earlier posts.

As commented by @Sherlocks in the last comment (well I am online when he is posting 😉), I got the black screen similar to him (screenshot is uploaded) but not even once it woke from sleep with sdcard inserted (both tests - first is putting my Mac to sleep without shutting down my Mac after Scenario 1 (it's the same case as said by @Sherlocks where he told his Mac woke from sleep with sdcard inserted), second is formally shutting down my Mac after Scenario 1 and following the steps mentioned in Scenario 2).

 

General log (same as before):

Sleep Wake failure in EFI

Failure code:: 0x00000000 0x0000001f

Please IGNORE the below stackshot

================================================================
Date/Time:        2021-09-08 15:56:36.662 +0530
OS Version:       ??? ??? (Build ???)
Architecture:     x86_64
Report Version:   32

Data Source:      Stackshots
Shared Cache:     0C9EB0DE-F5CE-3AFC-8F08-0C6DB1E7FC44 slid base address 0x7fff20109000, slide 0x109000

Event:            Sleep Wake Failure
Duration:         0.00s
Steps:            1

Boot args:        -wegnoegpu msgbuf=10485760 chunklist-security-epoch=0 -chunklist-no-rev2-dev

Time Awake Since Boot: 21s



Process:          swd [367]
Architecture:     x86_64
Footprint:        400 KB
Time Since Fork:  1s
Num samples:      1 (1)

  Thread 0x97b    1 sample (1)    priority 4 (base 4)
  <thread QoS background (requested background), thread darwinbg, process darwinbg, IO tier 2>
  1  start + 1 (libdyld.dylib + 89917) [0x7fff20432f3d] 1
    1  ??? [0x106499454] 1
      1  ??? [0x1064991e8] 1
        1  __stack_snapshot_with_config + 10 (libsystem_kernel.dylib + 146934) [0x7fff20404df6] 1
         *1  ??? [0xffffff80002331f6] 1
           *1  ??? [0xffffff800094001e] 1
             *1  ??? [0xffffff800084a211] 1
               *1  ??? [0xffffff800025651f] 1
                 *1  ??? [0xffffff800028d86d] (running) 1

  Binary Images:
        0x7fff203e1000 -     0x7fff20410fff  libsystem_kernel.dylib (7195.141.2) <B51DEA59-1260-35C6-B7B6-AA6D8459ECEC>  /usr/lib/system/libsystem_kernel.dylib
        0x7fff2041d000 -     0x7fff20458fff  libdyld.dylib (852.2)               <11007DE4-ABE1-3079-BF1C-4D0EADA884DD>  /usr/lib/system/libdyld.dylib
Model: MacBookPro16,1, BootROM 1554.100.64.0.0, 4 processors, Quad-Core Intel Core i5, 2.4 GHz, 16 GB, SMC 
Graphics: kHW_IntelUHDGraphics630Item, Intel UHD Graphics 630, spdisplays_builtin
Memory Module: BANK 0/ChannelA-DIMM0, 8 GB, DDR4, 2666 MHz, 0000
Memory Module: BANK 2/ChannelB-DIMM0, 8 GB, DDR4, 2666 MHz, SK Hynix
AirPort: spairport_wireless_card_type_airport_extreme (0x8086, 0x84), itlwm: 2.0.0 fw: 48.1335886879.0
Bluetooth: Version 8.0.5d7, 3 services, 26 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
Serial ATA Device: CT1000MX500SSD1, 1 TB
USB Device: USB 3.1 Bus
USB Device: Bluetooth HCI
USB Device: USB2.0 HD UVC WebCam
USB Device: USB2.0-CRW
Thunderbolt Bus: 

Detailed Kernel logs:

First test:

panic(cpu 4 caller 0xffffff800b47100e): RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/IOSDHostDevice.cpp at line 123

Backtrace (CPU 4), Frame : Return Address
0xffffffa0ac9bba10 : 0xffffff800568e04d mach_kernel : _handle_debugger_trap + 0x3fd
0xffffffa0ac9bba60 : 0xffffff80057d4e13 mach_kernel : _kdp_i386_trap + 0x143
0xffffffa0ac9bbaa0 : 0xffffff80057c540a mach_kernel : _kernel_trap + 0x55a
0xffffffa0ac9bbaf0 : 0xffffff8005632a2f mach_kernel : _return_from_trap + 0xff
0xffffffa0ac9bbb10 : 0xffffff800568d86d mach_kernel : _DebuggerTrapWithState + 0xad
0xffffffa0ac9bbc30 : 0xffffff800568db63 mach_kernel : _panic_trap_to_debugger + 0x273
0xffffffa0ac9bbca0 : 0xffffff8005e9dc0a mach_kernel : _panic + 0x54
0xffffffa0ac9bbd10 : 0xffffff800b47100e science.firewolf.rtsx : __ZN14IOSDHostDevice20onSDCardRemovedGatedEPN8IOSDCard10CompletionE + 0xae
0xffffffa0ac9bbd80 : 0xffffff800b475033 science.firewolf.rtsx : __ZN27RealtekCardReaderController20onSDCardRemovedGatedEPN8IOSDCard10CompletionE + 0x53
0xffffffa0ac9bbdb0 : 0xffffff800b47d6bd science.firewolf.rtsx : __ZN30RealtekUSBCardReaderController22fetchDeviceStatusGatedEP18IOTimerEventSource + 0xbd
0xffffffa0ac9bbde0 : 0xffffff8005df47e5 mach_kernel : __ZN18IOTimerEventSource15timeoutSignaledEPvS0_ + 0xa5
0xffffffa0ac9bbe50 : 0xffffff8005df46e6 mach_kernel : __ZN18IOTimerEventSource17timeoutAndReleaseEPvS0_ + 0xc6
0xffffffa0ac9bbe80 : 0xffffff80056d4605 mach_kernel : _thread_call_delayed_timer + 0x4a5
0xffffffa0ac9bbef0 : 0xffffff80056d5574 mach_kernel : _thread_call_delayed_timer + 0x1414
0xffffffa0ac9bbfa0 : 0xffffff800563213e mach_kernel : _call_continuation + 0x2e
      Kernel Extensions in backtrace:
         science.firewolf.rtsx(0.9.7)[EF48247F-5F33-3113-8BD3-35CAFB2C6FE3]@0xffffff800b452000->0xffffff800b558fff
            dependency: com.apple.iokit.IOPCIFamily(2.9)[F7AA4BAF-35CF-3784-A50C-5FD9CDCBE488]@0xffffff800816c000->0xffffff8008194fff
            dependency: com.apple.iokit.IOStorageFamily(2.1)[6CD2A6EC-9FFC-370D-8FEE-C8016E5C6BBA]@0xffffff800826f000->0xffffff8008280fff
            dependency: com.apple.iokit.IOUSBHostFamily(1.2)[3FDCC3CF-64A8-3794-A52C-5D8DE43A8265]@0xffffff800848a000->0xffffff8008518fff

Process name corresponding to current thread: kernel_task
Boot args: -wegnoegpu msgbuf=10485760 chunklist-security-epoch=0 -chunklist-no-rev2-dev

Mac OS version:
20G95

Kernel version:
Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64
Kernel UUID: FECBF22B-FBBE-36DE-9664-F12A7DD41D3D
KernelCache slide: 0x0000000005400000
KernelCache base:  0xffffff8005600000
Kernel slide:      0x0000000005410000
Kernel text base:  0xffffff8005610000
__HIB  text base: 0xffffff8005500000
System model name: MacBookPro16,1
System shutdown begun: NO
Panic diags file available: YES (0x0)
Hibernation exit count: 0

System uptime in nanoseconds: 137200185708
Last Sleep:           absolute           base_tsc          base_nano
  Uptime  : 0x0000001ff1c4b6fe
  Sleep   : 0x0000001fc97bdd35 0x0000000773a1c748 0x0000000000000000
  Wake    : 0x0000001fcb90d17c 0x000000010a0bbdc4 0x0000001fc9f87ddd

Second Test:

panic(cpu 2 caller 0xffffff8006e7100e): RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/IOSDHostDevice.cpp at line 123

Backtrace (CPU 2), Frame : Return Address
0xffffffb0bc633a10 : 0xffffff800108e04d mach_kernel : _handle_debugger_trap + 0x3fd
0xffffffb0bc633a60 : 0xffffff80011d4e13 mach_kernel : _kdp_i386_trap + 0x143
0xffffffb0bc633aa0 : 0xffffff80011c540a mach_kernel : _kernel_trap + 0x55a
0xffffffb0bc633af0 : 0xffffff8001032a2f mach_kernel : _return_from_trap + 0xff
0xffffffb0bc633b10 : 0xffffff800108d86d mach_kernel : _DebuggerTrapWithState + 0xad
0xffffffb0bc633c30 : 0xffffff800108db63 mach_kernel : _panic_trap_to_debugger + 0x273
0xffffffb0bc633ca0 : 0xffffff800189dc0a mach_kernel : _panic + 0x54
0xffffffb0bc633d10 : 0xffffff8006e7100e science.firewolf.rtsx : __ZN14IOSDHostDevice20onSDCardRemovedGatedEPN8IOSDCard10CompletionE + 0xae
0xffffffb0bc633d80 : 0xffffff8006e75033 science.firewolf.rtsx : __ZN27RealtekCardReaderController20onSDCardRemovedGatedEPN8IOSDCard10CompletionE + 0x53
0xffffffb0bc633db0 : 0xffffff8006e7d6bd science.firewolf.rtsx : __ZN30RealtekUSBCardReaderController22fetchDeviceStatusGatedEP18IOTimerEventSource + 0xbd
0xffffffb0bc633de0 : 0xffffff80017f47e5 mach_kernel : __ZN18IOTimerEventSource15timeoutSignaledEPvS0_ + 0xa5
0xffffffb0bc633e50 : 0xffffff80017f46e6 mach_kernel : __ZN18IOTimerEventSource17timeoutAndReleaseEPvS0_ + 0xc6
0xffffffb0bc633e80 : 0xffffff80010d4605 mach_kernel : _thread_call_delayed_timer + 0x4a5
0xffffffb0bc633ef0 : 0xffffff80010d5574 mach_kernel : _thread_call_delayed_timer + 0x1414
0xffffffb0bc633fa0 : 0xffffff800103213e mach_kernel : _call_continuation + 0x2e
      Kernel Extensions in backtrace:
         science.firewolf.rtsx(0.9.7)[EF48247F-5F33-3113-8BD3-35CAFB2C6FE3]@0xffffff8006e52000->0xffffff8006f58fff
            dependency: com.apple.iokit.IOPCIFamily(2.9)[F7AA4BAF-35CF-3784-A50C-5FD9CDCBE488]@0xffffff8003b6c000->0xffffff8003b94fff
            dependency: com.apple.iokit.IOStorageFamily(2.1)[6CD2A6EC-9FFC-370D-8FEE-C8016E5C6BBA]@0xffffff8003c6f000->0xffffff8003c80fff
            dependency: com.apple.iokit.IOUSBHostFamily(1.2)[3FDCC3CF-64A8-3794-A52C-5D8DE43A8265]@0xffffff8003e8a000->0xffffff8003f18fff

Process name corresponding to current thread: kernel_task
Boot args: -wegnoegpu msgbuf=10485760 chunklist-security-epoch=0 -chunklist-no-rev2-dev

Mac OS version:
20G95

Kernel version:
Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64
Kernel UUID: FECBF22B-FBBE-36DE-9664-F12A7DD41D3D
KernelCache slide: 0x0000000000e00000
KernelCache base:  0xffffff8001000000
Kernel slide:      0x0000000000e10000
Kernel text base:  0xffffff8001010000
__HIB  text base: 0xffffff8000f00000
System model name: MacBookPro16,1
System shutdown begun: NO
Panic diags file available: YES (0x0)
Hibernation exit count: 0

System uptime in nanoseconds: 459801982129
Last Sleep:           absolute           base_tsc          base_nano
  Uptime  : 0x0000006b0e557c7a
  Sleep   : 0x0000006ae5f45f96 0x0000000767c2c9ee 0x0000000000000000
  Wake    : 0x0000006ae80ad7da 0x000000010a043356 0x0000006ae6705ceb

It says last sleep: absolute, that means sleep function is executed successfully, so no problem during sleep, problem is during wake.

Both detailed reports are different (first line) so I posted it seperately. This time the log says which line in which file created kernel panic, I think this maybe helpful.

 

Note: All the logs and IOReg dump and screen captures are uploaded below.

rtsx-a359519.zip

Edited by gnpaone
  • Like 1
Link to comment
Share on other sites

17 hours ago, Austere.J said:

 

@mnfesq @SavageAUS Now it's a known, common issue that cards cannot be initialized with RTL8411B card reader. I will review the controller code when I am available.

 

Thanks for your reply.  Might it be as simple as spoofing the PCI-ID?  I've been messing around with that using Rehabman's old FakePCI-ID.kext and making my own injector but me writing my own kext would be like you drafting escrow instructions for a property sale. I do better sticking to what I know.

Link to comment
Share on other sites

On 9/8/2021 at 3:10 AM, Fortitude said:

There’s just one problem though… The read/write speeds of my SD card are incredibly slow compared to Windows.

 

This is expected. Initializing the card at 3.3V means that the card will be running in either the default speed mode (up to 12MB/s) or the high speed mode (up to 25MB/s).

Your test result shows that your UHS-I SDXC card is running in the high speed mode, and it is pretty consistent with the theoretical maximum I/O speed.

Note that the DEBUG version slows down I/O transfers a bit.

 

On 9/8/2021 at 3:10 AM, Fortitude said:

Adding `-iosd3v3` seemed to do the trick! My SD is now being mounted.

 

Now I need to figure out why the driver for RTS5260 fails to tune your card thus cannot initialize the card at 1.8V.

Initializing the card at 1.8V means that the card will be running in UHS-I SDR12/25/50/104 modes.

Those numbers correspond to the theoretical maximum I/O speed in each mode.

 

On 9/8/2021 at 3:10 AM, Fortitude said:

If it helps, the only SD card that I have is this one, but I’m happy to buy any others in the future that you’d recommend for testing:

 

Your card is sufficient enough to test the driver.

Someone reported on Github that his SDHC card is running properly with RTS5260,

so I guess you will be the one who focuses on testing SDXC cards instead. :)

Link to comment
Share on other sites

1 hour ago, Austere.J said:

Initializing the card at 1.8V means that the card will be running in UHS-I SDR12/25/50/104 modes.

 

Oh, I didn't know until now that lower voltage correlated with faster maximum bus speeds.

 

1 hour ago, Austere.J said:

I guess you will be the one who focuses on testing SDXC cards instead. :)

 

Sounds like a plan! 👍

Let me know when there's any new builds that you'd like me to test, and/or if there's any further information that you need to know about my system.

Edited by Fortitude
Link to comment
Share on other sites

On 9/8/2021 at 5:09 PM, gnpaone said:

@Austere.J I did test the kext provided by you. There are pretty interesting results this time.

 

Both detailed reports are different (first line) so I posted it seperately. This time the log says which line in which file created kernel panic, I think this maybe helpful.


panic(cpu 2 caller 0xffffff8006e7100e): RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/IOSDHostDevice.cpp at line 123

Backtrace (CPU 2), Frame : Return Address
0xffffffb0bc633a10 : 0xffffff800108e04d mach_kernel : _handle_debugger_trap + 0x3fd
0xffffffb0bc633a60 : 0xffffff80011d4e13 mach_kernel : _kdp_i386_trap + 0x143
0xffffffb0bc633aa0 : 0xffffff80011c540a mach_kernel : _kernel_trap + 0x55a
0xffffffb0bc633af0 : 0xffffff8001032a2f mach_kernel : _return_from_trap + 0xff
0xffffffb0bc633b10 : 0xffffff800108d86d mach_kernel : _DebuggerTrapWithState + 0xad
0xffffffb0bc633c30 : 0xffffff800108db63 mach_kernel : _panic_trap_to_debugger + 0x273
0xffffffb0bc633ca0 : 0xffffff800189dc0a mach_kernel : _panic + 0x54
0xffffffb0bc633d10 : 0xffffff8006e7100e science.firewolf.rtsx : __ZN14IOSDHostDevice20onSDCardRemovedGatedEPN8IOSDCard10CompletionE + 0xae
0xffffffb0bc633d80 : 0xffffff8006e75033 science.firewolf.rtsx : __ZN27RealtekCardReaderController20onSDCardRemovedGatedEPN8IOSDCard10CompletionE + 0x53
0xffffffb0bc633db0 : 0xffffff8006e7d6bd science.firewolf.rtsx : __ZN30RealtekUSBCardReaderController22fetchDeviceStatusGatedEP18IOTimerEventSource + 0xbd
0xffffffb0bc633de0 : 0xffffff80017f47e5 mach_kernel : __ZN18IOTimerEventSource15timeoutSignaledEPvS0_ + 0xa5
0xffffffb0bc633e50 : 0xffffff80017f46e6 mach_kernel : __ZN18IOTimerEventSource17timeoutAndReleaseEPvS0_ + 0xc6
0xffffffb0bc633e80 : 0xffffff80010d4605 mach_kernel : _thread_call_delayed_timer + 0x4a5
0xffffffb0bc633ef0 : 0xffffff80010d5574 mach_kernel : _thread_call_delayed_timer + 0x1414
0xffffffb0bc633fa0 : 0xffffff800103213e mach_kernel : _call_continuation + 0x2e
      Kernel Extensions in backtrace:
         science.firewolf.rtsx(0.9.7)[EF48247F-5F33-3113-8BD3-35CAFB2C6FE3]@0xffffff8006e52000->0xffffff8006f58fff
            dependency: com.apple.iokit.IOPCIFamily(2.9)[F7AA4BAF-35CF-3784-A50C-5FD9CDCBE488]@0xffffff8003b6c000->0xffffff8003b94fff
            dependency: com.apple.iokit.IOStorageFamily(2.1)[6CD2A6EC-9FFC-370D-8FEE-C8016E5C6BBA]@0xffffff8003c6f000->0xffffff8003c80fff
            dependency: com.apple.iokit.IOUSBHostFamily(1.2)[3FDCC3CF-64A8-3794-A52C-5D8DE43A8265]@0xffffff8003e8a000->0xffffff8003f18fff

Process name corresponding to current thread: kernel_task
Boot args: -wegnoegpu msgbuf=10485760 chunklist-security-epoch=0 -chunklist-no-rev2-dev

Mac OS version:
20G95

Kernel version:
Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64
Kernel UUID: FECBF22B-FBBE-36DE-9664-F12A7DD41D3D
KernelCache slide: 0x0000000000e00000
KernelCache base:  0xffffff8001000000
Kernel slide:      0x0000000000e10000
Kernel text base:  0xffffff8001010000
__HIB  text base: 0xffffff8000f00000
System model name: MacBookPro16,1
System shutdown begun: NO
Panic diags file available: YES (0x0)
Hibernation exit count: 0

System uptime in nanoseconds: 459801982129
Last Sleep:           absolute           base_tsc          base_nano
  Uptime  : 0x0000006b0e557c7a
  Sleep   : 0x0000006ae5f45f96 0x0000000767c2c9ee 0x0000000000000000
  Wake    : 0x0000006ae80ad7da 0x000000010a043356 0x0000006ae6705ceb

 

 

According to changelogs mentioned, assertions were added to check if the host driver reports null and in line 123: 

passert(this->driver != nullptr, "The host driver should not be null.");

I think this is the problem and...

On 9/8/2021 at 12:49 PM, Austere.J said:

I am a little busy recently, so I may not respond timely.

... you are doing a very great job sir 😊, hope this issue get fixed soon. Thanks

Link to comment
Share on other sites

@Sherlocks@whatnameisit@gnpaone Please try this build.

RealtekCardReader_0.9.7_2232117+SLW_DEBUG.zip

 

Scenario 1:

1) Boot your computer without the SD card.

2) Put your computer into sleep.

3) Wait for a while, say 5 minutes, and wake up the computer.

4) Everything should be fine here. Dump the kernel log.

 

Reboot your computer before proceeding to the next scenario, otherwise the kernel log will be incomplete.

 

Scenario 2:

1) Boot your computer without the SD card.

2) When you see the desktop, insert the SD card. Your card should be working properly.

2) Put your computer into sleep with the card inserted. Do not remove the card while the computer is sleeping.

3) Wait for a while, say 5 minutes, and wake up the computer. Do not remove the card after the computer wakes up.

--> Check: Can you wake up the computer properly? Is there a kernel panic?

4) If there is no kernel panic, dump the kernel log.

5) Repeat the steps 3 and 4. Is there a kernel panic again?

Link to comment
Share on other sites

10 hours ago, Austere.J said:

Scenario 1:

1) Boot your computer without the SD card.

2) Put your computer into sleep.

3) Wait for a while, say 5 minutes, and wake up the computer.

4) Everything should be fine here. Dump the kernel log.

 

Reboot your computer before proceeding to the next scenario, otherwise the kernel log will be incomplete.

 

Scenario 2:

1) Boot your computer without the SD card.

2) When you see the desktop, insert the SD card. Your card should be working properly.

2) Put your computer into sleep with the card inserted. Do not remove the card while the computer is sleeping.

3) Wait for a while, say 5 minutes, and wake up the computer. Do not remove the card after the computer wakes up.

--> Check: Can you wake up the computer properly? Is there a kernel panic?

4) If there is no kernel panic, dump the kernel log.

5) Repeat the steps 3 and 4. Is there a kernel panic again?

 

I tried this build. I got a bit better results than before. (I forgot to mention something last time, last time I posted results (typed comments + files) by testing GPT sdcard, I also tested MBR sdcard too and I got same results as mentioned by @Sherlocks and @whatnameisit, it behaved differently as mentioned by me for GPT cards) 

 

Scenario 1:

No Kernel Panic, everything worked fine.

 

Scenario 2:

1. First time sleep with card inserted: After waking up, the card got ejected abruptly as you mentioned in your previous posts. No Kernel Panic. (both MBR and GPT sdcards). I removed sdcard and inserted back to get detected again.

2. Second time sleep with card inserted (did not reboot after first time sleep - as you asked in "5)" in your last post): This time I got Kernel Panic (for both MBR and GPT cards) but interestingly this time Kernel panic log did not give any detailed report, so this time cpu processes are not disturbed and I think it's a good sign (maybe) but the KP reports are definitely different (in terms of process codes) for MBR and GPT cards. 

 

MBR sdcard:

Sleep Wake failure in EFI

Failure code:: 0x00000000 0x0000001f

Please IGNORE the below stackshot

================================================================
Date/Time:        2021-09-13 11:55:27.634 +0530
OS Version:       ??? ??? (Build ???)
Architecture:     x86_64
Report Version:   32

Data Source:      Stackshots
Shared Cache:     0C9EB0DE-F5CE-3AFC-8F08-0C6DB1E7FC44 slid base address 0x7fff201ed000, slide 0x1ed000

Event:            Sleep Wake Failure
Duration:         0.00s
Steps:            1

Boot args:        -wegnoegpu msgbuf=10485760 chunklist-security-epoch=0 -chunklist-no-rev2-dev

Time Awake Since Boot: 21s



Process:          swd [369]
Architecture:     x86_64
Footprint:        412 KB
Time Since Fork:  1s
Num samples:      1 (1)

  Thread 0x9a0    1 sample (1)    priority 4 (base 4)
  <thread QoS background (requested background), thread darwinbg, process darwinbg, IO tier 2>
  1  start + 1 (libdyld.dylib + 89917) [0x7fff20516f3d] 1
    1  ??? [0x105e70454] 1
      1  ??? [0x105e701e8] 1
        1  __stack_snapshot_with_config + 10 (libsystem_kernel.dylib + 146934) [0x7fff204e8df6] 1
         *1  ??? [0xffffff80002331f6] 1
           *1  ??? [0xffffff800094001e] 1
             *1  ??? [0xffffff800084a211] 1
               *1  ??? [0xffffff800025651f] 1
                 *1  ??? [0xffffff800028d86d] (running) 1

  Binary Images:
        0x7fff204c5000 -     0x7fff204f4fff  libsystem_kernel.dylib (7195.141.2) <B51DEA59-1260-35C6-B7B6-AA6D8459ECEC>  /usr/lib/system/libsystem_kernel.dylib
        0x7fff20501000 -     0x7fff2053cfff  libdyld.dylib (852.2)               <11007DE4-ABE1-3079-BF1C-4D0EADA884DD>  /usr/lib/system/libdyld.dylib
Model: MacBookPro16,1, BootROM 1554.100.64.0.0, 4 processors, Quad-Core Intel Core i5, 2.4 GHz, 16 GB, SMC 
Graphics: kHW_IntelUHDGraphics630Item, Intel UHD Graphics 630, spdisplays_builtin
Memory Module: BANK 0/ChannelA-DIMM0, 8 GB, DDR4, 2400 MHz, 0000
Memory Module: BANK 2/ChannelB-DIMM0, 8 GB, DDR4, 2400 MHz, SK Hynix
AirPort: spairport_wireless_card_type_airport_extreme (0x8086, 0x84), itlwm: 2.0.0 fw: 48.1335886879.0
Bluetooth: Version 8.0.5d7, 3 services, 26 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
Serial ATA Device: CT1000MX500SSD1, 1 TB
USB Device: USB 3.1 Bus
USB Device: Bluetooth HCI
USB Device: USB2.0 HD UVC WebCam
USB Device: USB2.0-CRW
Thunderbolt Bus: 

GPT sdcard:

Sleep Wake failure in EFI

Failure code:: 0x00000000 0x0000001f

Please IGNORE the below stackshot

================================================================
Date/Time:        2021-09-13 13:26:10.658 +0530
OS Version:       ??? ??? (Build ???)
Architecture:     x86_64
Report Version:   32

Data Source:      Stackshots
Shared Cache:     0C9EB0DE-F5CE-3AFC-8F08-0C6DB1E7FC44 slid base address 0x7fff20198000, slide 0x198000

Event:            Sleep Wake Failure
Duration:         0.00s
Steps:            1

Boot args:        -wegnoegpu msgbuf=10485760 chunklist-security-epoch=0 -chunklist-no-rev2-dev

Time Awake Since Boot: 21s



Process:          swd [367]
Architecture:     x86_64
Footprint:        384 KB
Time Since Fork:  1s
Num samples:      1 (1)

  Thread 0x964    1 sample (1)    priority 4 (base 4)
  <thread QoS background (requested background), thread darwinbg, process darwinbg, IO tier 2>
  1  start + 1 (libdyld.dylib + 89917) [0x7fff204c1f3d] 1
    1  ??? [0x10a69f454] 1
      1  ??? [0x10a69f1e8] 1
        1  __stack_snapshot_with_config + 10 (libsystem_kernel.dylib + 146934) [0x7fff20493df6] 1
         *1  ??? [0xffffff80002331f6] 1
           *1  ??? [0xffffff800094001e] 1
             *1  ??? [0xffffff800084a211] 1
               *1  ??? [0xffffff800025651f] 1
                 *1  ??? [0xffffff800028d86d] (running) 1

  Binary Images:
        0x7fff20470000 -     0x7fff2049ffff  libsystem_kernel.dylib (7195.141.2) <B51DEA59-1260-35C6-B7B6-AA6D8459ECEC>  /usr/lib/system/libsystem_kernel.dylib
        0x7fff204ac000 -     0x7fff204e7fff  libdyld.dylib (852.2)               <11007DE4-ABE1-3079-BF1C-4D0EADA884DD>  /usr/lib/system/libdyld.dylib
Model: MacBookPro16,1, BootROM 1554.100.64.0.0, 4 processors, Quad-Core Intel Core i5, 2.4 GHz, 16 GB, SMC 
Graphics: kHW_IntelUHDGraphics630Item, Intel UHD Graphics 630, spdisplays_builtin
Memory Module: BANK 0/ChannelA-DIMM0, 8 GB, DDR4, 2400 MHz, 0000
Memory Module: BANK 2/ChannelB-DIMM0, 8 GB, DDR4, 2400 MHz, SK Hynix
AirPort: spairport_wireless_card_type_airport_extreme (0x8086, 0x84), itlwm: 2.0.0 fw: 48.1335886879.0
Bluetooth: Version 8.0.5d7, 3 services, 26 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
Serial ATA Device: CT1000MX500SSD1, 1 TB
USB Device: USB 3.1 Bus
USB Device: Bluetooth HCI
USB Device: USB2.0 HD UVC WebCam
USB Device: USB2.0-CRW
USB Device: 2.4G Receiver
Thunderbolt Bus: 

 

Link to comment
Share on other sites

10 hours ago, Austere.J said:

@Sherlocks@whatnameisit@gnpaone Please try this build.

RealtekCardReader_0.9.7_2232117+SLW_DEBUG.zip 220.61 kB · 4 downloads

 

Scenario 1:

1) Boot your computer without the SD card.

2) Put your computer into sleep.

3) Wait for a while, say 5 minutes, and wake up the computer.

4) Everything should be fine here. Dump the kernel log.

 

Reboot your computer before proceeding to the next scenario, otherwise the kernel log will be incomplete.

 

Scenario 2:

1) Boot your computer without the SD card.

2) When you see the desktop, insert the SD card. Your card should be working properly.

2) Put your computer into sleep with the card inserted. Do not remove the card while the computer is sleeping.

3) Wait for a while, say 5 minutes, and wake up the computer. Do not remove the card after the computer wakes up.

--> Check: Can you wake up the computer properly? Is there a kernel panic?

4) If there is no kernel panic, dump the kernel log.

5) Repeat the steps 3 and 4. Is there a kernel panic again?

 

hey firewolf,

also tried this version as my USB-Cardreader initially recognizing cards after first boot,

but the device will duplicate in device tree after sleep and wont recognize cards at all then :/

 

if i hibernate and then inserting a card afterwards, system just locks up :/

 

attached some ioreg screenshots and pre and post-sleep logs...

 

hope it helps finding a solution :D

 

seems the driver cant establish a connection to the reader afterit has been reinitializing on the usb host after sleep...

 

2021-09-13 10:05:51.091757+0200 0x294      Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual bool IOSDCardEventSource::checkForWork() DInfo: The card event has been processed.
2021-09-13 10:05:51.091763+0200 0x331e     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::onSDCardRemovedSyncGated() DInfo: The host driver has processed the card removal event. Status = 0x00000000.
2021-09-13 10:05:51.091799+0200 0x331e     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekCardReaderController::prepareToSleep() DInfo: The hardware is ready to sleep.
2021-09-13 10:05:51.091803+0200 0x331e     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::prepareToSleep() DInfo: The hardware is ready to sleep.
2021-09-13 10:05:51.091807+0200 0x331e     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual IOReturn RealtekCardReaderController::setPowerState(unsigned long, IOService *) DInfo: The power state has been set to 0.
2021-09-13 10:05:55.290807+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual IOReturn RealtekCardReaderController::setPowerState(unsigned long, IOService *) DInfo: Setting the power state from 0 to 1.
2021-09-13 10:05:55.290813+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::prepareToWakeUp() DInfo: Prepare to wake up...
2021-09-13 10:05:55.290816+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::resetHardware() DInfo: Resetting the card reader...
2021-09-13 10:05:55.290820+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::beginCommandTransfer() DInfo: Begin a command transfer session.
2021-09-13 10:05:55.290831+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfc30; Mask = 0x01; Value = 0x01.
2021-09-13 10:05:55.290842+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfc20; Mask = 0xff; Value = 0x08.
2021-09-13 10:05:55.290848+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfc21; Mask = 0x04; Value = 0x00.
2021-09-13 10:05:55.290854+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd57; Mask = 0x07; Value = 0x01.
2021-09-13 10:05:55.290865+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd52; Mask = 0x03; Value = 0x00.
2021-09-13 10:05:55.290871+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd7b; Mask = 0xe0; Value = 0x00.
2021-09-13 10:05:55.290877+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd64; Mask = 0x03; Value = 0x01.
2021-09-13 10:05:55.290882+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd5c; Mask = 0x02; Value = 0x02.
2021-09-13 10:05:55.290888+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd71; Mask = 0x1c; Value = 0x1c.
2021-09-13 10:05:55.290894+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::performOutboundBulkTransfer(IOMemoryDescriptor *, IOByteCount, UInt32) DInfo: Initiating an outbound bulk transfer with length = 44 bytes and timeout = 100 ms...
2021-09-13 10:05:55.290902+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::performBulkTransferGated(IOUSBHostPipe *, IOMemoryDescriptor *, IOByteCount, UInt32, UInt32) DInfo: Initiating a bulk transfer with length = 44 bytes and timeout = 100 ms...
2021-09-13 10:05:55.290909+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::performBulkTransferGated(IOUSBHostPipe *, IOMemoryDescriptor *, IOByteCount, UInt32, UInt32) DInfo: [00] Requesting the bulk transfer...
2021-09-13 10:05:55.290987+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::performBulkTransferGated(IOUSBHostPipe *, IOMemoryDescriptor *, IOByteCount, UInt32, UInt32) Error: [00] Failed to request the bulk transfer. Error = 0xe00002ed.
2021-09-13 10:05:55.290994+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual IOReturn RealtekUSBCardReaderController::endCommandTransferGated(UInt32, UInt32) Error: Failed to send the host commands to the device. Error = 0xe00002ed.
2021-09-13 10:05:55.291002+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::endCommandTransfer(UInt32, UInt32) Error: Failed to transfer host commands. Error = 0xe00002ed.
2021-09-13 10:05:55.291109+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::clearCardError() Soft Assertion Failed: Failed to clear the card error.
2021-09-13 10:05:55.291114+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/RealtekUSBCardReaderController.cpp at line 728
2021-09-13 10:05:55.291296+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::clearHostError() Soft Assertion Failed: Failed to clear the FSFM error.
2021-09-13 10:05:55.291302+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/RealtekUSBCardReaderController.cpp at line 741
2021-09-13 10:05:55.291373+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::clearHostError() Soft Assertion Failed: Failed to flush the FIFO queue.
2021-09-13 10:05:55.291378+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/RealtekUSBCardReaderController.cpp at line 743
2021-09-13 10:05:55.291384+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::clearHostError() Soft Assertion Failed: Failed to reset the DMA.
2021-09-13 10:05:55.291388+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/RealtekUSBCardReaderController.cpp at line 745
2021-09-13 10:05:55.291394+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::resetHardware() Error: Failed to reset the card reader. Error = 0xe00002ed.
2021-09-13 10:05:55.291398+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::prepareToWakeUp() Error: Failed to reset the hardware when the driver wakes up.
2021-09-13 10:05:55.291403+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual IOReturn RealtekCardReaderController::setPowerState(unsigned long, IOService *) DInfo: The power state has been set to 1.
2021-09-13 10:05:55.293550+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void IOSDHostDriver::stop(IOService *) DInfo: Stopping the SD host driver...
2021-09-13 10:05:55.293627+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void IOSDHostDriver::stop(IOService *) DInfo: The SD host driver has stopped.
2021-09-13 10:05:55.293636+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekSDXCSlot::stop(IOService *) DInfo: Stopping the host device...
2021-09-13 10:05:55.293640+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void IOSDHostDriver::stop(IOService *) DInfo: Stopping the SD host driver...
2021-09-13 10:05:55.293643+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void IOSDHostDriver::stop(IOService *) DInfo: The SD host driver has stopped.
2021-09-13 10:05:55.293647+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekSDXCSlot::stop(IOService *) DInfo: The host device has stopped.

thx :D

RealtekCardReader_0.9.7_2232117+SLW_DEBUG.zip

Link to comment
Share on other sites

9 minutes ago, reelgirly said:

 

hey firewolf,

also tried this version as my USB-Cardreader initially recognizing cards after first boot,

but the device will duplicate in device tree after sleep and wont recognize cards at all then 😕

 

if i hibernate and then inserting a card afterwards, system just locks up 😕

 

attached some ioreg screenshots and pre and post-sleep logs...

 

hope it helps finding a solution :D

 

seems the driver cant establish a connection to the reader afterit has been reinitializing on the usb host after sleep...

 



2021-09-13 10:05:51.091757+0200 0x294      Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual bool IOSDCardEventSource::checkForWork() DInfo: The card event has been processed.
2021-09-13 10:05:51.091763+0200 0x331e     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::onSDCardRemovedSyncGated() DInfo: The host driver has processed the card removal event. Status = 0x00000000.
2021-09-13 10:05:51.091799+0200 0x331e     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekCardReaderController::prepareToSleep() DInfo: The hardware is ready to sleep.
2021-09-13 10:05:51.091803+0200 0x331e     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::prepareToSleep() DInfo: The hardware is ready to sleep.
2021-09-13 10:05:51.091807+0200 0x331e     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual IOReturn RealtekCardReaderController::setPowerState(unsigned long, IOService *) DInfo: The power state has been set to 0.
2021-09-13 10:05:55.290807+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual IOReturn RealtekCardReaderController::setPowerState(unsigned long, IOService *) DInfo: Setting the power state from 0 to 1.
2021-09-13 10:05:55.290813+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::prepareToWakeUp() DInfo: Prepare to wake up...
2021-09-13 10:05:55.290816+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::resetHardware() DInfo: Resetting the card reader...
2021-09-13 10:05:55.290820+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::beginCommandTransfer() DInfo: Begin a command transfer session.
2021-09-13 10:05:55.290831+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfc30; Mask = 0x01; Value = 0x01.
2021-09-13 10:05:55.290842+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfc20; Mask = 0xff; Value = 0x08.
2021-09-13 10:05:55.290848+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfc21; Mask = 0x04; Value = 0x00.
2021-09-13 10:05:55.290854+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd57; Mask = 0x07; Value = 0x01.
2021-09-13 10:05:55.290865+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd52; Mask = 0x03; Value = 0x00.
2021-09-13 10:05:55.290871+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd7b; Mask = 0xe0; Value = 0x00.
2021-09-13 10:05:55.290877+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd64; Mask = 0x03; Value = 0x01.
2021-09-13 10:05:55.290882+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd5c; Mask = 0x02; Value = 0x02.
2021-09-13 10:05:55.290888+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::enqueueWriteRegisterCommand(UInt16, UInt8, UInt8) DInfo: Enqueue: Address = 0xfd71; Mask = 0x1c; Value = 0x1c.
2021-09-13 10:05:55.290894+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::performOutboundBulkTransfer(IOMemoryDescriptor *, IOByteCount, UInt32) DInfo: Initiating an outbound bulk transfer with length = 44 bytes and timeout = 100 ms...
2021-09-13 10:05:55.290902+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::performBulkTransferGated(IOUSBHostPipe *, IOMemoryDescriptor *, IOByteCount, UInt32, UInt32) DInfo: Initiating a bulk transfer with length = 44 bytes and timeout = 100 ms...
2021-09-13 10:05:55.290909+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::performBulkTransferGated(IOUSBHostPipe *, IOMemoryDescriptor *, IOByteCount, UInt32, UInt32) DInfo: [00] Requesting the bulk transfer...
2021-09-13 10:05:55.290987+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::performBulkTransferGated(IOUSBHostPipe *, IOMemoryDescriptor *, IOByteCount, UInt32, UInt32) Error: [00] Failed to request the bulk transfer. Error = 0xe00002ed.
2021-09-13 10:05:55.290994+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual IOReturn RealtekUSBCardReaderController::endCommandTransferGated(UInt32, UInt32) Error: Failed to send the host commands to the device. Error = 0xe00002ed.
2021-09-13 10:05:55.291002+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekCardReaderController::endCommandTransfer(UInt32, UInt32) Error: Failed to transfer host commands. Error = 0xe00002ed.
2021-09-13 10:05:55.291109+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::clearCardError() Soft Assertion Failed: Failed to clear the card error.
2021-09-13 10:05:55.291114+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/RealtekUSBCardReaderController.cpp at line 728
2021-09-13 10:05:55.291296+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::clearHostError() Soft Assertion Failed: Failed to clear the FSFM error.
2021-09-13 10:05:55.291302+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/RealtekUSBCardReaderController.cpp at line 741
2021-09-13 10:05:55.291373+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::clearHostError() Soft Assertion Failed: Failed to flush the FIFO queue.
2021-09-13 10:05:55.291378+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/RealtekUSBCardReaderController.cpp at line 743
2021-09-13 10:05:55.291384+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::clearHostError() Soft Assertion Failed: Failed to reset the DMA.
2021-09-13 10:05:55.291388+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: Assertion triggered in file /Users/FireWolf/Library/Mobile Documents/com~apple~CloudDocs/Workspace/RealtekCardReader/RealtekCardReader/RealtekUSBCardReaderController.cpp at line 745
2021-09-13 10:05:55.291394+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: IOReturn RealtekUSBCardReaderController::resetHardware() Error: Failed to reset the card reader. Error = 0xe00002ed.
2021-09-13 10:05:55.291398+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekUSBCardReaderController::prepareToWakeUp() Error: Failed to reset the hardware when the driver wakes up.
2021-09-13 10:05:55.291403+0200 0x3370     Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual IOReturn RealtekCardReaderController::setPowerState(unsigned long, IOService *) DInfo: The power state has been set to 1.
2021-09-13 10:05:55.293550+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void IOSDHostDriver::stop(IOService *) DInfo: Stopping the SD host driver...
2021-09-13 10:05:55.293627+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void IOSDHostDriver::stop(IOService *) DInfo: The SD host driver has stopped.
2021-09-13 10:05:55.293636+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekSDXCSlot::stop(IOService *) DInfo: Stopping the host device...
2021-09-13 10:05:55.293640+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void IOSDHostDriver::stop(IOService *) DInfo: Stopping the SD host driver...
2021-09-13 10:05:55.293643+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void IOSDHostDriver::stop(IOService *) DInfo: The SD host driver has stopped.
2021-09-13 10:05:55.293647+0200 0x6f       Default     0x0                  0      0    kernel: (RealtekCardReader) RTSX: virtual void RealtekSDXCSlot::stop(IOService *) DInfo: The host device has stopped.

 

After waking from sleep, sdcard will definitely be ejected (as said by @Austere.J and according to your ioreg), you have to remove the card and insert it back for your card reader to initialize again.

 

For the hibernation part, please refer to dortania's post install guide, it's working fine for me

Edited by gnpaone
Link to comment
Share on other sites

1 hour ago, gnpaone said:

After waking from sleep, sdcard will definitely be ejected (as said by @Austere.J and according to your ioreg), you have to remove the card and insert it back for your card reader to initialize again.

 

For the hibernation part, please refer to dortania's post install guide, it's working fine for me

i removed the card before sleeping and inserting again after sleep but then its not recognized anymore...

 

hibernation works fully but not with the kext, as soon i insert sdcard after hibernation the system locks up as said before...

 

so the problem lies somewhere in the kext for our realtek :D

Link to comment
Share on other sites

18 hours ago, reelgirly said:

i removed the card before sleeping and inserting again after sleep but then its not recognized anymore...

 

hibernation works fully but not with the kext, as soon i insert sdcard after hibernation the system locks up as said before...

 

so the problem lies somewhere in the kext for our realtek :D

Can you please post recordings or screenshots of what all u said

Link to comment
Share on other sites

On 9/13/2021 at 6:45 AM, Austere.J said:

@Sherlocks@whatnameisit@gnpaone Please try this build.

RealtekCardReader_0.9.7_2232117+SLW_DEBUG.zip 220.61 kB · 6 downloads

 

Scenario 1:

1) Boot your computer without the SD card.

2) Put your computer into sleep.

3) Wait for a while, say 5 minutes, and wake up the computer.

4) Everything should be fine here. Dump the kernel log.

 

Reboot your computer before proceeding to the next scenario, otherwise the kernel log will be incomplete.

 

Scenario 2:

1) Boot your computer without the SD card.

2) When you see the desktop, insert the SD card. Your card should be working properly.

2) Put your computer into sleep with the card inserted. Do not remove the card while the computer is sleeping.

3) Wait for a while, say 5 minutes, and wake up the computer. Do not remove the card after the computer wakes up.

--> Check: Can you wake up the computer properly? Is there a kernel panic?

4) If there is no kernel panic, dump the kernel log.

5) Repeat the steps 3 and 4. Is there a kernel panic again?

Attaching logs. There are no kernel panics so far.

BTW when you said repeat Steps 3 and 4 in Step 5 of Scenario 2, did you mean keep the card inserted and sleep, wake, and log? I could do that, but I wasn't sure if that's what you wanted.

And as always, thanks for your hard work!

scenario1.log scenario2.log

Edited by whatnameisit
actually attach logs
Link to comment
Share on other sites

×
×
  • Create New...