When I resume my Lenovo Yoga 3 Pro with UbuntuGNOME 16.04 the SD card in the reader is gone and is not remounted. In fact, the whole built in card reader is gone and doesn't show up in 'sudo lsusb' at all. I have to reboot the laptop to get the reader back and card mounted. Interestingly enough it works if use 'sudo acpitool --suspend' to suspend the laptop. When I resume after using acpitool instead on the bult in suspend the reader is there and the card gets mounted. I would really like to find out why acpitool does it correctly while Ubuntu itself "looses" the SD card reader and card. Maybe there's some kind of command I can run at resume to have the reader and card found again?
I have found a solution, or workaround rather, for this problem. The card reader on this laptop is a USB3 device and as such prone to some problems under Linux. However, I have also found out that if I remove and start the card reader USB3 device in succession it's detected and mounted as normal. My finding is based on the information found here:
So if I run a script containing the following:
#!/bin/sh cd /sys/bus/pci/drivers/xhci_hcd echo -n "0000:00:14.0" > unbind echo -n "0000:00:14.0" > bind
the card reader is detected and the card mounted as normal. I found the device ID "0000:00:14.0" with "sudo lsusb -v".
What I have not been able to do is have this run every time the laptop resumes from suspend. I assume it has to be run from /etc/pm/sleep.d but I have not been able to write a working script. If someone could show how I can write a script that is run every time the laptop resumes containing the three lines of code it would be very helpful. Right now I simply run the script when I resume to get the SD card back.