Ricoh R5C822 - MMC cards not detected in built-in memory card reader

Bug #111089 reported by Laura Cowen on 2007-04-29
80
This bug affects 13 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Medium
Unassigned
Declined for Gutsy by Henrik Nilsen Omma
Nominated for Hardy by Onlinelli
Nominated for Intrepid by marc.lethereau
Nominated for Lucid by Pierre-Louis
linux-source-2.6.22 (Ubuntu)
Low
Unassigned
Declined for Gutsy by Henrik Nilsen Omma
Nominated for Hardy by Onlinelli
Nominated for Intrepid by marc.lethereau
Nominated for Lucid by Pierre-Louis

Bug Description

I have a Samsung Q35 Red laptop which comes with an on-board card-reader. The card reader supports several different memory card types, including SD and MMC. Before I wiped Windows XP to install Ubuntu, both SD and MMC were detected and worked successfully (the only card types I have). But when I installed Ubuntu Edgy, and now Ubuntu Feisty, my SD card is detected without any problems but my MMC card (1 GB, which is the one I actually use) is not detected at all.

I can read from the MMC card using a USB card reader without any problem. It just seems to be the on-board card reader that's not working properly.

Laura,

Which kernel and Ubuntu version where you running on? Can you try testing with either 7.04 or Gutsy if you have the chance?

Thanks,

Chris

This bug appears that it might be a duplicate of 63553.

The Samsung Q35 appears to use the Ricoh R5C822 chipset.

Changed in linux-source-2.6.22:
status: Unconfirmed → Needs Info

The same problem occurs in my Dell Inspiron 9400. SD cards are recognized, but Memory Stick (Pro) Duo is not (512 MB and 2 GB tested). In Windows, the Memory Sticks are recognized.

 lspci | grep Ricoh gives:

03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd Unknown device 0832
03:01.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
03:01.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 01)
03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)
03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)

Running Kubuntu 7.04 with all available updates.

Onlinelli (cornelius-maihoefer) wrote :

PS: also not working on Gutsy Tribe 4... i.e. with kernel. 2.6.22

Henrik Nilsen Omma (henrik) wrote :

Hi, could you run 'lspci -vvnn' as suggested on https://wiki.ubuntu.com/KernelTeamBugPolicies ? Thanks.

Changed in linux-source-2.6.22:
assignee: ccheney → nobody
importance: Undecided → Low
Onlinelli (cornelius-maihoefer) wrote :

thanks for the notice .... done

Onlinelli (cornelius-maihoefer) wrote :

sorry, something's been missing

Laura Cowen (lauracowen) wrote :

And here's mine...

Changed in linux-source-2.6.22:
status: Incomplete → Triaged

Hello, it doesn't work on my laptop too. It's an HP Pavilion dv6391. I am using Gutsy.

Sebastian Urban (surban) wrote :

Same problem here on IBM/Lenovo ThinkPad R61i.

Hello,

   I tried to modprobe mmc_block , tifm_sd but still nothing happens.

mtvoid (mtvoid) wrote :

I had the same issue of not being able to access MMC cards, but I just discovered a fix on this blog:
http://intr.overt.org/blog/?p=59
Now the card reader supports MMC too! Maybe a feature release of Ubuntu can now incorporate this fix into the kernel package, so that one doesn't have to manually set the registers?

Hello,

  Thanks a lot Manan ! That worked indeed, here are the commands I run:

sudo setpci -s 07:05.1 0xCA=0x57 # Write Enable
sudo setpci -s 07:05.1 0xCB=0x02 # (MMC Disable)
sudo setpci -s 07:05.1 0xCA=0x00 # (Write Disable)

Actually the first two commands alone were enough to make my MMC card
work ! I don't know what the third commad is for, but I included it
since it was on the site Manan quoted.

Note, the slot '07:05.1' may differ on your machine.

On Sun, Oct 28, 2007 at 04:24:23PM -0000, Manan wrote:
> I had the same issue of not being able to access MMC cards, but I just discovered a fix on this blog:
> http://intr.overt.org/blog/?p=59
> Now the card reader supports MMC too! Maybe a feature release of
> Ubuntu can now incorporate this fix into the kernel package, so that
> one doesn't have to manually set the registers?

--
 أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0x9DCA0B27 (@ subkeys.pgp.net)
 GPG Fingerprint: 087D 3767 8CAC 65B1 8F6C 156E D325 C3C8 9DCA 0B27

Neil Martin (neil-martin28) wrote :

I can confirm that the above commands that disable the MMC controller, forcing the SD controller to do the job instead work on the Ricoh RC822 inside the Dell Inspiron 4600 (1505n) also. I can read/write MMC cards without problems after issuing them.

Regards,

Neil.

Neil Martin (neil-martin28) wrote :

I should also add that the change stays after a reboot but is lost after a power cycle. To Ahmed: I believe the last setting disables writes to that device's registers, in effect, stoping you changing any more low level settings with the setpci command until it's write-enabled again.

Rgds,

Neil.

Hmm.. did not work so far with me:

Which of the slots should I choose?

03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
03:01.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 01)
03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)
03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)

03:01.2 would be the MMC Controller to disable?
but
sudo setpci -s 03:01.2 0xCA=0x57
sudo setpci -s 03:01.1 0xCB=0x02
sudo setpci -s 03:01.1 0xCA=0x00

did not work do the job. (Inspiron 9400)

Regards, Onlinelli

mtvoid (mtvoid) wrote :

The registers are set on the Firewire Controller, 03:01.0 should therefore work for you.

Hello,

  With these 3 commands mentioned earlier, I was also able to read/write to an SD card few days ago.

matehortua (matehortua) wrote :

hi, the same problem here
i can't read card, i didnt have this problem with 7.04 but when i upgrade to 7.10 im having it
nothing hapens when i insert a MMCARD, /var/log/meessages doesnt show anything

INSPIRON 6400

Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19) (prog-if 01)
        Subsystem: Dell Unknown device 01bd
        Flags: bus master, medium devsel, latency 64, IRQ 23
        Memory at ef9fd400 (32-bit, non-prefetchable) [size=256]
        Capabilities: [80] Power Management version 2

tnx

kirus (sepp-heid) wrote :

The following works on my NEXOC OSIRIS E619 with Kubuntu 7.10:

sudo modprobe -r sdhci
sudo setpci -s 0e:06.0 0xCA=0x57
sudo setpci -s 0e:06.0 0xCB=0x02
sudo setpci -s 0e:06.0 0xCA=0x00
sudo modprobe sdhci

seqizz (gurkanGur) (seqizz) wrote :

try this;

#!/bin/bash
modprobe -r sdhci
setpci -s `lspci | grep “IEEE” | awk ‘{print $1}’` 0xCA=0×57
setpci -s `lspci | grep “IEEE” | awk ‘{print $1}’` 0xCB=0×02
# setpci -s `lspci | grep “IEEE” | awk ‘{print $1}’` 0xCA=0×00
modprobe sdhci

no special command needed ;)

Brian Murray (brian-murray) wrote :

I am assigning this bug to the 'ubuntu-kernel-team' per their bug policy. For future reference you can learn more about their bug policy at https://wiki.ubuntu.com/KernelTeamBugPolicies .

Changed in linux-source-2.6.22:
assignee: nobody → ubuntu-kernel-team

Hello,

  I tried Hardy Alpha2, and this bug is fixed there (with no need to use
  the setpci commands).

--
 أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0x9DCA0B27 (@ subkeys.pgp.net)
 GPG Fingerprint: 087D 3767 8CAC 65B1 8F6C 156E D325 C3C8 9DCA 0B27

Domenico Urbano (domurb) wrote :

The suggested commands:

sudo setpci -s 07:05.1 0xCA=0x57 # Write Enable
sudo setpci -s 07:05.1 0xCB=0x02 # (MMC Disable)
sudo setpci -s 07:05.1 0xCA=0x00 # (Write Disable)

Worked perfectly for my HP Pavillon dv6385ea.

@Gurkan Gur: i think that your script is wrong, as it would do something to the FireWire controller. This will be better:

#!/bin/bash
modprobe -r sdhci
setpci -s `lspci | grep "SD\/SDIO\/MMC\/MS\/MSPro" | awk '{print $1}'` 0xCA=0x57
setpci -s `lspci | grep "SD\/SDIO\/MMC\/MS\/MSPro" | awk '{print $1}'` 0xCB=0x02
# setpci -s `lspci | grep "SD\/SDIO\/MMC\/MS\/MSPro" | awk '{print $1}'` 0xCA=0x00
modprobe sdhci

Neskie Manuel (neskiem) wrote :

I also followed the above blog directions from http://intr.overt.org/blog/?p=59
They worked fro a Dell Inspiron 6400.

This is the PCI device i changed below with the setpci command
03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller

setpci -s '03:01.0' 0xCA=0x57 #enables you to write to the device
setpci -s '03:01.0' 0xCB=0x02 #set register to disable MMC
setpci -s '03:01.0' 0xCA=0x00 #disables write to device

Now I can read and write MMC cards.

Laura Cowen (lauracowen) wrote :

I tried this on my Samsung Q35 but I it didn't seem to make any difference.

lspci shows:

05:09.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 09)

so I tried:

sudo setpci -s ‘05:09.1′ 0xCA=0×57
sudo setpci -s ‘05:09.1′ 0xCB=0×02
sudo setpci -s ‘05:09.1′ 0xCA=0×00

But didn't seem to make any difference. Nothing in dmesg or /var/log/messages.

I actually still have the problem. The suggested work-arounds didn't help so far.

mtvoid (mtvoid) wrote :

Onlinelli: What setpci commands are you using? Are you sure you are setting registers on the FireWire controller, and not the MMC controller?
Laura: I'm not sure, but maybe the fix is specific to the R5C832 controller? You have an R5C552. Maybe there is a similar fix for it, but with different register addresses?

Also, it seemed to me that this issue had been fixed within the kernel in some recent kernel release, because now I see in the dmesg log:
ricoh-mmc: Ricoh MMC Controller disabling driver
But I still have to set the registers in order to detect the MMC cards. Is this the case for others too?

I'm running the latest Kubuntu-Hardy.

03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
03:01.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)
03:01.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)

so I tried,
sudo modprobe -r sdhci
sudo setpci -s '03:01.0' 0xCA=0x57
sudo setpci -s '03:01.0' 0xCB=0x02
sudo setpci -s '03:01.0' 0xCA=0x00
sudo modprobe sdhci

and also the scripts provided above. But I had no effect. If I by mistake tried the same with 03:01.1 on my old gutsy, it should not do any harm to a fresh installed ubuntu, shouldn't it?

lspci | grep -i rico
02:06.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b9)
02:06.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b9)
02:06.2 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 03)
02:06.3 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 20)
02:06.4 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 10)

same here, I don't see anything in /var/log/messages after inserting the sd card. Works out of the box on Win, please fix it.

Forgot i also use hard and updated tomorrow.

Linux compaq 2.6.24-12-generic #1 SMP Wed Mar 12 23:01:54 UTC 2008 i686 GNU/Linux

seqizz (gurkanGur) (seqizz) wrote :

@Domenico
2 scripts are working too ..

Thanks :)

Mika Fischer (zoop) wrote :

This is still an issue in hardy! Is there anything we can do to get it fixed?

Mika Fischer (zoop) wrote :

It seems that there is now a driver which is supposed to do what the setpci commands mentioned above do. It is called ricoh-mmc.

You can check if it's working via "dmesg | grep ricoh-mmc".

In my case unfortunately it does NOT work:
[ 34.433416] ricoh-mmc: Ricoh MMC Controller disabling driver
[ 34.433421] ricoh-mmc: Copyright(c) Philip Langdale
[ 34.523742] ricoh-mmc: Ricoh MMC controller found at 0000:04:09.3 [1180:0843] (rev 0)
[ 34.523748] ricoh-mmc: Main firewire function not found. Cannot disable controller.

This is the reason why the MMC cards are not recognized by my card reader.

Any way to find the reason for the failure?

Mika Fischer (zoop) wrote :

OK, the problem is that the ricoh-mmc driver in hardy only works for R5C832 chips. In the latest git it also works for RL5C476 chips (http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=882c49164d72c45f37d7fa1bb3de7c31cf1a5fab)

Unfortunately I have a R5C552:
04:09.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 09)

I'll contact the author of the patch, how he got the info about the RL5C476 chip (there you need to poke different registers!) and whether R5C552 could also be supported.

Mika Fischer (zoop) wrote :

Wrong again! I actually DO have the RL5C476 chipset, so this patch would help me:
04:09.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b4)

Mika Fischer (zoop) wrote :

OK, I've compiled and tested the driver with this patch and can confirm that it fixes the issue for me.

Beginning with the Hardy Heron 8.04 development cycle, all open Ubuntu kernel bugs need to be reported against the "linux" kernel package. We are automatically migrating this bug to the new "linux" package. However, development has already began for the upcoming Intrepid Ibex 8.10 release. It would be helpful if you could test the upcoming release and verify if this is still an issue - http://www.ubuntu.com/testing . If the issue still exists, please update this report by changing the Status of the "linux" task from "Incomplete" to "New". We appreciate your patience and understanding as we make this transition. Thanks!

Matt Zimmerman (mdz) on 2008-08-16
Changed in linux:
assignee: nobody → ubuntu-kernel-team
importance: Undecided → Medium
status: Incomplete → Triaged
Matt Zimmerman (mdz) wrote :

This should be able to be closed in Intrepid if someone can confirm that the commit referenced in https://bugs.edge.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/111089/comments/37 has been merged into our kernel tree. Mika Fischer's symptoms match those of the original reporter, and this patch was confirmed to fix Mika's problem.

Tim Gardner (timg-tpi) wrote :

Fixed by Intrepid commit 882c49164d72c45f37d7fa1bb3de7c31cf1a5fab

Changed in linux:
status: Triaged → Invalid
Matt Zimmerman (mdz) on 2008-08-20
Changed in linux:
status: Invalid → Fix Released

Per a decision made by the Ubuntu Kernel Team, bugs will longer be assigned to the ubuntu-kernel-team in Launchpad as part of the bug triage process. The ubuntu-kernel-team is being unassigned from this bug report. Refer to https://wiki.ubuntu.com/KernelTeamBugPolicies for more information. Thanks.

Scott Bronson (bronson) wrote :

This appears to be a bug again on Jaunty.

https://bugs.launchpad.net/ubuntu/+bug/311781

Piyush (piyushgarg80) wrote :

MMC Card is not working in Karmic. SD card works out of the box.
System Thinkpad T61p
Release 9.10
Kernel 2.6 .31-10-generic
gnome 2.28.1

user@localhost:~$ sudo lspci | grep Ricoh
15:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ba)
15:00.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 04)
15:00.2 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 21)
15:00.3 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev ff)
15:00.4 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 11)
15:00.5 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 11)

Eric Appleman (erappleman) wrote :

Memory Stick Pro Duo driver still needed.

Comment #43 refers to a non-existent policy!

As reported on https://bugs.launchpad.net/ubuntu/+bug/311781 :

I have just tried latest daily kernel 3.5.0-999-generic_3.5.0-999.201206260421_amd64 but no different for the card reader.

Detailed test results:
- For both SD and MMC cards they are properly detected and auto-monted when inserted. You can see content list together with right size of the files but you can not open files greater then few kilobytes. This means that I can create and open text files but none of the pictures or videos
- XD and Sony Memory Stick cards are not recognised at all.
- Behaviour is exactly the same with Fedora 17

With current 3.2.0-25-generic kernel at least this card reader is not crashing OS.

root@u1204x64-HP-Pavilion-dv6500-Ania-Algis:~# lspci |grep Ricoh
07:05.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
07:05.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
07:05.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
07:05.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 12)
root@u1204x64-HP-Pavilion-dv6500-Ania-Algis:~#

You can find full report for this laptop on http://launchpadlibrarian.net/108734512/u1204x64-HP-Pavilion-dv6500-Ania-Algis.xml.bz2 and https://wiki.ubuntu.com/Testing/Laptop/precise/HPPaviliondv6500

Regards

Dariusz

Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu laptop testing tracker.

A list of all reports related to this bug can be found here:
http://laptop.qa.ubuntu.com/qatracker/reports/bugs/111089

tags: added: laptop-testing
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers