Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Shevchenko andy-shev

View GitHub Profile
@dododevs
dododevs / macbook-air-13-sd.md
Created Feb 15, 2021
Macbook Air 13" 6,2 (mid 2013) SD Card Reader on Linux
View macbook-air-13-sd.md

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
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[]) {