Jump to content
186 posts in this topic

Recommended Posts

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

  • 1 month later...

can a 9.7 build be made without the debug? I don't know how to do it, but I'd try to learn if I could be pointed in the right direction. I saw the "nightly" section in the download section on github, but I'm no programmer, so I didn't know what to do with the info there. Thank you, johnm

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
On 11/13/2021 at 5:58 PM, mnfesq said:

Any progress on RTL8411b initialization?  Just checking. Thanks.

 

Try the latest one at https://github.com/0xFireWolf/RealtekCardReader/actions/runs/1628818002.

You can find the pre-compiled DEBUG driver under the Artifacts section.

As always, please attach the complete kernel log. :)

On 12/19/2021 at 7:28 PM, dm4n said:

Hi,

 

Where can I find the brand and model of my SD Card Reader? The info isn't showing in System Report under Card Reader, PCI or USB sections.

 

Thanks

 

Please attach the IOReg or use AIDA64 under Windows to find the model.

  • Like 1
Link to comment
Share on other sites

hi firewolf.
i have a problem. i can't restart my laptop. i have to force reboot with power button.
also system response is slow.
is it debug version with flow log?
thanks in advance

EDIT1
i tested latest commit version.
normal boot
- sdcard is perfectly working.
- also system reboot is fast
after wakeup from sleep.
- sdcard is pefectly working. after wakeup, eject sd card popup. but mounted sdcard icon in desktop
- system reboot is very slow at least minimum 30sec to maximum 1minute


Sent from my SM-N960N using Tapatalk



Link to comment
Share on other sites

On 12/27/2021 at 5:38 PM, Sherlocks said:

hi firewolf.
i have a problem. i can't restart my laptop. i have to force reboot with power button.
also system response is slow.
is it debug version with flow log?
thanks in advance

EDIT1
i tested latest commit version.
normal boot
- sdcard is perfectly working.
- also system reboot is fast
after wakeup from sleep.
- sdcard is pefectly working. after wakeup, eject sd card popup. but mounted sdcard icon in desktop
- system reboot is very slow at least minimum 30sec to maximum 1minute


Sent from my SM-N960N using Tapatalk


 

 

Try the new `-rtsxnopm` boot argument to disable the power management routine.

- Is your card reader recognized properly after the laptop wakes up?

- If you insert the card after the laptop wakes up, is the card working?

- Do you still have the reboot issue after the laptop wakes up?

Link to comment
Share on other sites

On 12/29/2021 at 11:41 AM, Austere.J said:

 

Try the new `-rtsxnopm` boot argument to disable the power management routine.

- Is your card reader recognized properly after the laptop wakes up?

- If you insert the card after the laptop wakes up, is the card working?

- Do you still have the reboot issue after the laptop wakes up?

 

hi firewolf. sorry for late.

happy new year!

 

report

tried rtsxnopm

- Is your card reader recognized properly after the laptop wakes up?

  -> yes

- If you insert the card after the laptop wakes up, is the card working?

  -> yes

- Do you still have the reboot issue after the laptop wakes up?

  -> yes. still very slow.

 

most of features is working. just latest build lead to slow boot and reboot after wakeup

here is log

 

rtsx-afterwake.log rtsx-boot.log

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 2 months later...
On 9/13/2021 at 4:45 AM, Austere.J said:

@Sherlocks@whatnameisit@gnpaone Please try this build.

RealtekCardReader_0.9.7_2232117+SLW_DEBUG.zipFetching info...

 

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?

 

Hello, This kext works, but after sleep  is wery long shutdown or restart, how to fix it?

  • Like 2
Link to comment
Share on other sites

×
×
  • Create New...