Skip to content

Instantly share code, notes, and snippets.


Andy Shevchenko andy-shev

View GitHub Profile
dododevs /
Created Feb 15, 2021
Macbook Air 13" 6,2 (mid 2013) SD Card Reader on Linux

Macbook Air 13" 6,2 (mid-2013) SD Card Reader on Linux

The problem

Macbook Air 6,2's hardware comes with a decently annoying issue: the processor's southbridge (codenamed Lynx Point) has a problem with the internal SD card reader (with USB 3.0 devices in general) which makes it unusable after returning from S3 state (suspend-to-ram). The device spontaneously detaches and doesn't appear to come back on when the system resumes. More on that on Wikipedia.

On Mac OS X and macOS the issue doesn't seem to be present - the driver probably takes care of it - but Linux distributions don't currently have a viable solution.

However, there is a workaround.

The workaround

sentinelt / gist:3f1a984533556cf890d9
Created Feb 6, 2015
Program to set arbitrary speed
View gist:3f1a984533556cf890d9
* Allows to set arbitrary speed for the serial device on Linux.
* stty allows to set only predefined values: 9600, 19200, 38400, 57600, 115200, 230400, 460800.
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <asm/termios.h>
int main(int argc, char* argv[]) {