Skip to content

Instantly share code, notes, and snippets.

@samgooi4189
Last active April 19, 2024 04:20
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save samgooi4189/2e6e18fd1d562acaf39246e5e386d7cb to your computer and use it in GitHub Desktop.
Save samgooi4189/2e6e18fd1d562acaf39246e5e386d7cb to your computer and use it in GitHub Desktop.
Fixing Broadcom Corporation BCM57765/57785 SDXC/MMC Card Reader
Follow the WORKAROUND:
1. Add a comand to /etc/rc.local, add the following line above "exit 0":
setpci -s 00:1c.2 0x50.B=0x41
2. Add the same comand to /etc/apm/resume.d/21aspm (which does not exist yet):
setpci -s 00:1c.2 0x50.B=0x41
3. Add the following to /etc/modprobe.d/sdhci.conf:
options sdhci debug_quirks2=4
4. Re-generate initrd:
sudo update-initramfs -u -k all
5. Reboot or reload sdhci module:
sudo rmmod sdhci-pci sdhci
sudo modprobe sdhci
sudo modprobe sdhci-pci
If SD card still not detected after reboot, type this in command line:
$ sudo setpci -s 00:1c.2 0x50.B=0x41
Tested on Acer V5-171
Reference:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1307674
https://wiki.allensmith.net/kb:linux:14lts-bcm57765-bmc57785
@elhenro
Copy link

elhenro commented Oct 28, 2017

Thank you so much for sharing! Fixed my sd card reader on MacBookPro 10,2, Ubuntu 17.10.

@eduandress
Copy link

Thank you! The only solution for my v5-131 card reader on Ubuntu 17.10... I almost give up.

@naumovvs
Copy link

thanks a lot. it works for my acer aspire V5

@4nt
Copy link

4nt commented Jul 17, 2018

Thank you! this worked perfectly in my acer V5-171-9661 with debian stretch. Reading/writing my 128GB SD card without problems.

@webhive
Copy link

webhive commented Aug 7, 2018

Thank you very much!!! It work on my Acer Aspire V3-571G

@antonioverdugo
Copy link

Thank you very much!!!

@necrodos
Copy link

Hi, I'm having this exact issue on a V5-131 on Ubuntu 18.04 but I can't seem to find any of the files mentioned here, can you help me find a way to make my sd card reader work?

@necrodos
Copy link

necrodos commented Nov 5, 2018

hi, it's me again I made it to work, with the tutorial in this URL: https://askubuntu.com/questions/886620/how-can-i-execute-command-on-startup-rc-local-alternative-on-ubuntu-16-10
and then, the rest of the instructions in this tutorial... I hven't got it to format any device but read/write cappabilities are fine, is this normal??

@DanielZolett
Copy link

Thank you. You helped a lot.

This tutorial really works. lol

@viniciusdaniel
Copy link

Thank You so much!
Worked on Apire V3-571 running Xubuntu 18.04.

Plus for first step of this solution, /etc/rc.local don't existis on 18.04, so first create sudo touch /etc/rc.local and make it executable sudo chmod +x /etc/rc.local

After just edit /etc/rc.local and add the content of first step like bellow:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

setpci -s 00:1c.2 0x50.B=0x41

exit 0

[]'s

@PunisherHD92
Copy link

PunisherHD92 commented Dec 16, 2019

Hello, I confirm it makes the SD reader visible on my Acer V5 171 (kernel 5.4.2) ...
Alas, read speed is very slow on my high capacity SDXC card (256GB). I get about 1 MB/s.
The card is 256GB, UHS-1, rated 100 MB/s, and works flawlessly on another PC.

@enrigo
Copy link

enrigo commented Mar 19, 2020

Hi,
the fix doesn't work 100% on my ACER AO 756 running Leap 15.1:

  • mount: ok
  • read: ok
  • write: only few and small files at a time. If I increase the size and/or the nr. of files to be copied on the SD card, the process starts but after a while it hangs.
    Any hint?

@Orynik
Copy link

Orynik commented Aug 13, 2020

Thank you very much!
But in my case me needed in the 3rd paragraph change command by:
options sdhci debug_quirks=0x40 debug_quirks2=0x4

@gitpalashub
Copy link

Thank You so much!
Worked on Apire V3-571 running Xubuntu 18.04.

Plus for first step of this solution, /etc/rc.local don't existis on 18.04, so first create sudo touch /etc/rc.local and make it executable sudo chmod +x /etc/rc.local

After just edit /etc/rc.local and add the content of first step like bellow:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

setpci -s 00:1c.2 0x50.B=0x41

exit 0

[]'s

I was having the same problem, there was no such file as "rc.local". As soon as I created the file, my SDHC card showed up. It was quite frustrating. But the thing with linux is that we get to learn new things.

@scm-unimelb
Copy link

Thank you. Worked on iMac14,2 after trying many other solutions to make SD card / reader recognisable....

Kernel: 5.4.0-47-generic x86_64 bits: 64 compiler: gcc v: 7.5.0
Desktop: Cinnamon 4.4.8 wm: muffin dm: LightDM Distro: Linux Mint 19.3 Tricia
base: Ubuntu 18.04 bionic

@guilbep
Copy link

guilbep commented Oct 22, 2020

Thank you. Worked perfectly on mac mini 5,1 mid-2011. Also thanks @viniciusdaniel https://gist.github.com/samgooi4189/2e6e18fd1d562acaf39246e5e386d7cb#gistcomment-3066660

Kernel 5.4.0-52-generic x86_64
Base: Ubuntu 20.04.1 LTS

lshw

    description: Lunch Box Computer
    product: Macmini5,1 (System SKU#)
    vendor: Apple Inc.
    version: 1.0

@wandercn
Copy link

感谢,我使用 options sdhci debug_quirks=0x40 debug_quirks2=0x4 解决了问题,就是写的速度比慢点,好歹能用。
我的环境:
`
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

macbookpro 13 retina late 2012 + Ubuntu20.0.4
`

lsm@lsm-MacBookPro:~$ lspci|grep SD
02:00.1 SD Host controller: Broadcom Inc. and subsidiaries BCM57765/57785 SDXC/MMC Card Reader (rev 21)
获取到SD卡槽的编号为02:00.1 ,从上面的命令查询的结果的开头编号部分,如下的命令里会使用到这个编号02:00.1。
`Follow the WORKAROUND:

  1. Add a comand to /etc/rc.local, add the following line above "exit 0": (这步我省略了)
    setpci -s 02:00.1 0x50.B=0x41
  2. Add the same comand to /etc/apm/resume.d/21aspm (which does not exist yet):
    setpci -s 02:00.1 0x50.B=0x41
  3. Add the following to /etc/modprobe.d/sdhci.conf:
    options sdhci debug_quirks=0x40 debug_quirks2=0x4
  4. Re-generate initrd:
    sudo update-initramfs -u -k all
  5. Reboot or reload sdhci module:
    sudo rmmod sdhci-pci sdhci
    sudo modprobe sdhci
    sudo modprobe sdhci-pci

`

@lusacramento
Copy link

Obrigado! Resolveu no meu Mac Book Pro 2011/2012 late

@ancho85
Copy link

ancho85 commented Aug 15, 2022

for setpci to work, secure boot must be disabled at bios level.

@thanksmintmate
Copy link

Guy you have a paid beer if you come to Milan Italy. It worked also on a Acer AO756 , you are great!!!

@rjhornsby
Copy link

thanks! Got a 2011 Macbook pro (8,1) working because of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment