-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force ejected after wake from sleep and can't initialize disk #12
Comments
This is the console log about:
|
I have the same problem, my card is 5227 model |
Card ejection on sleep is the expected behavior, and it comes from the OpenBSD code (see comment here) which this kext is a port of. The card not being recognized after wakeup is a different issue. As far as I know (I do not use sleep), after sleep/wakeup and card eject/insert, the card is being recognized and mounted, at least for chip RTS525A, with the -rtsx_mimic_linux boot option enabled. The errors you show are timeouts, meaning that the chip is probably not responding to commands after sleep/wakeup. Other chips (like 5227 or 522A) probably need a more proper initialization after wake, which is what -rtsx_mimic_linux does for 525A. You can try using this boot parameter and see if it also works for your chip, although I doubt it. I cannot support any chip other than 525A (lack of time + impossibility to test), but if anyone is willing to take the task of adding support for other chips, I'll be happy to accept pull requests. |
Will do a test with that boot-arg tonight and let you know |
tested with that boot-arg with no results, is the same. I can do many many code test, but i need to see clearly where to start, as a hobby coder, i need help to start with it. I can do local tests and the pull requests. What i need is the initialization code on BSD driver (point me where) and the exact same instructions on this port. Thanks in advance |
Or maybe we can unload and reload kext after wake from sleep? |
You need to understand the BSD driver, but most importantly, you need to study the Linux driver.
Studying these two files and this kext's source (including the BSD driver of course), should give you an idea on what's beeing done by Linux and not by BSD, particularly regarding the initialization. Regarding unloading/loading the kext on sleep/wake, I'm afraid the result would be basically the same, since on every wake, the chip is initialized as if the kext was just loaded.
Good luck! |
@cholonam thanks, yes, the boot-arg -rtsx_mimic_linux did fix the problem on 5229 card and now you can use the sd card after wake from sleep without problems. However after wake from sleep, ejecting the card won't work until you wait for the message for force eject to appear and then you press on force eject, then the card will eject fine. I was wondering if removing that part of the code for suspending related so the driver stops on suspend, will that make any change to the driver, will the card remain mounted after wake from sleep ? |
I'll try to take a look at it when I have some time. However I must warn you that sleep/wake support is not on my high priority list (I'm happy just with the kext not crashing on sleep since I never sleep my system). Maybe using a program like Sleepwatcher to unmount/unload the kext on sleep and load the kext on wake works for you? |
@cholonam the latest kext release 2.3 causes a kernel panic / instant reboot during Apple Boot Logo progress bar reaching around 75%. That didn't happen on previous release, how would be the best way to collect logs:
|
What if you boot without the kext and load the kext once booted? What's yous OS version? I can boot with the debug kext without problem. Maybe try to boot in text mode (-v) and see if any message gives you a hint. |
Sorry, turned out something else (other kext) was causing the issue. The kext has actually improved a lot, if i eject the card physically before sleep, then after i wake the laptop and i plug the SD Card, it will work without a problem. Force eject problem has been fixed i believe. However, sleeping with card plugged in does cause some issues. Will do a deep testing tomorrow with logs included as well and give more precise and clear, well described problems. But for now with the mimic linux boot arg, it is working fine, as soon as i finish the job with the card, there is no reason to keep it plugged in for no reason. |
Elitebook 840 g4, 522a version.
Works perfectly after boot or reboot, but when wake after sleep, the sdcard ejects itself and when physically ejected and reinserted there's a message of "can't read the disk"
The text was updated successfully, but these errors were encountered: