# Collective:  tifm modules and SD cards vs. udev [SOLVED]

## coplaniuk

I know it's like beating a dead horse...but there are several threads out there (some of them mine) that are not solved concerning the tifm modules and the SD card reader issue.  Since there are at least a number of people still having problems, I wanted to start a thread to pull everything together.

This is what we know:

1.)  It seems to be that people can get all the pertinent modules loaded without error:  tifm_core, tifm_7xx1, tifm_sd, mmc_core, mmc_block

2.)  It's well known that sdhci conflicts with the modules, most people recognize that and don't load it (or even install the module).  all across the board, no one seems to be loading sdhci.

3.)  It appears as though kernel 2.6.20 has better luck.  But even those with this kernel (be it vanilla sources, ck sources or gentoo sources) are still having this problem.

4.)  A query of dmesg shows that the modules are at least recognizing a media insert, and it seems to be responding as follows:

 *Quote:*   

> 
> 
> tifm_7xx1: xd card detected in socket 0
> 
> tifm_7xx1: demand removing card from socket 0
> ...

 

or

 *Quote:*   

> 
> 
> tifm_core: SmartMedia/xD card detected in socket 0:0
> 
> tifm0 : demand removing card from socket 0:0 
> ...

 

5.)  Finally, the real problem seems to be that udev isn't doing anything with the media once its inserted.  No device is added to the /dev/ tree, no node, nothing.  All that seems to be missing is the device.  Note, it was determined that a rule didn't need to be defined for udev (like the one below):

 *Quote:*   

> 
> 
> # Mount and remove mmc partitions manually
> 
> ACTION=="add" KERNEL=="mmcblk[0-9]p[0-9]", RUN+="/usr/bin/pmount %k"
> ...

 

So now that we can all agree on those items, lets get to the bottom of this problem.  Are there any other dependancies that are being missed?  Are there any other conflicting modules?  Is this a module issue?  Or is this a udev issue?  If it's a udev issue, how do we pinpoint the actual problem?  

I have confirmed that I can get the sd card reader working perfectly with the ubuntu LiveCD just by modprobing the five modules above.  If I knew what I was looking for, perhaps someone can help me with that, I can cross-check the configuration of udev or the modules to determine exactly what needs to be done.

Once we finally figure this out -- I'm going to add to the gentoo-wiki everything that we uncover.  It seems like a lot of people are having this problem...so lets get this pinned down.

---------------

Here's a list of nodes I referenced:

Texas Inst. 5-in-1 SD - problems aquiring udev node

[UNSOLVED] Laptop SD Cards reader

nternal SD Card Reader: No device nodes created by udev

TIFM doesn't work as expected

 	PCIxx21 Integrated FlashMedia Controller don't work

SDHCI not assigning device node (Note, this is with a different module which makes me think it's a udev thing)

----------

## coplaniuk

There's a lot of people here who need help.  If you are having these problems as well, please speak up.  Offer any info that wasn't listed above.  If you have a thought (any thought, even incomplete thoughts), share them here.  Post your ideas and we can hopefully pin this down.

----------

## broken_chaos

Although I don't have one of the readers referred to by much of the post, I can say that SDHCI readers (of which I have one in this laptop) *do* work correctly. /dev/mmcblk0 and /dev/mmcblk0p1 are correctly created. I have the required items built into the kernel, and not as modules, since it's built in to the hardware, and would always be loaded anyway.

The only issue I've had was (completely unrelated to this problem) with hal and dbus not correctly identifying that it's been plugged in (and therefore no automounting in KDE/Gnome/etc.). This was solved with an updated to hal-0.5.9 (or probably with a patch for hal-0.5.7.1-r5 that's in the bugzilla).

----------

## coplaniuk

That brings up a good point...I don't have HAL installed on this machine.  i tried installing it to see if it had any impact, but it's possible it didn't get set up properly.  Is HAL Required for the SD reader to work properly?

----------

## Insanity5902

No it isn't

----------

## broken_chaos

No, not required... The only reason I mentioned HAL was that that was the *only* bug I've had with my SDHCI reader. One thing to try is to build it right into the kernel - this probably won't work, but I think it was a bug with earlier revisions of the SDHCI driver, that it wouldn't work quite properly as modules, so there's an off-chance something like that could be happening here.

If it works perfectly on the Ubuntu LiveCD, maybe try getting a copy of it's udev rules files, and post them somewhere for someone to compare, if you can't compare them yourself.

----------

## Insanity5902

I am not sure what the problem is, I have the drivers built as modules in the kernel, and then have downloaded the .8 version from their website.  I compile and install these with the make command it works , no errors, no problems mounting nothing.

coplaniuk: where are you stuck at.

----------

## coplaniuk

Using the 0.8 modules as well as the kernel modules, I get the same behavior.  I can modprobe them without any problems:  tifm_core, tifm_7xx1, tifm_sd, mmc_core, mmc_block.  They all go in without a fight and no errors.  Then I insert the SD card.   dmesg seems to indicate that the card is recognized, as it gives this report:

 *Quote:*   

> 
> 
> tifm_7xx1: xd card detected in socket 0
> 
> tifm_7xx1: demand removing card from socket 0
> ...

  or something like it.  

However, there is no mmc* device in /dev/, nor is there anything that would even be closely related to it.  

I'm a bit uneducated when it comes to udev, but I think the modules are working as expected.  I just think that perhaps somewhere between recognizing the device and creating a /dev/node, it gets lost.  Is that perhaps a udev issue?  Is there a step or a dependancy that I'm missing?

Others have reported similar behavior.

----------

## coplaniuk

I have a favor to ask...if you have your SD working, please check your udev rules for anything that could be mmc or tifm related and post them.  I checked mine and I don't have any mmc/tifm udev rules.

----------

## Insanity5902

Well lets start by assuming it is udev, since the device is reconziged, but not /dev device created.  Note: I don't remember doing anything special to get it to work.

I hope you don't mind but I am going to start from the beginning.  I don't remember what all we have done, so ...

lets start with what version of udev you are running?

grep /etc/udev/rules.d/* for tifm produces nothing

greping for mmc, gives me the following rules.

```
SUBSYSTEM=="mmc", RUN+="modprobe.sh mmc_block"

KERNEL=="mmcblk[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"

KERNEL=="mmcblk[0-9]p[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n"
```

I am running udev-109-r1, the SUBSYSTEM rule is in 50-udev.ruels, and the last two (each starting with KERNEL) are in 60--persistent-storage.rules, I have all MMC and TIFM in the kernel built as moduels, and I don't have SDHCI built at all.

----------

## coplaniuk

Ok...this has shed some enlightenment on the subject.  At least I feel we're making progress...

I'm currently using udev version 104-r2.  I grepped for 'mmc' and 'tifm' in the rules directory.  Nothing was returned at all.  Considering the version difference, I'm going to throw an ~x86 flag into package.keywords for the udev ebuild, and see if that gives me what I need.  That should give me version 109.  My laptop is with me, but doesn't have internet connection here.  I'll download at home, rebuild and let you know how it works out.  

As a quick cross-check, I grabbed my Kubuntu liveCD and booted up a session of kubuntu.  As it turns out, that is also using version 109 of udev, and a grep in the rules folder shows a similar output to yours.  So I'm wondering if all this comes down to a simple out-of-date udev.  I'm hoping (though I'll kick myself for it).

I'll let you know my results tonight.  

PS - I created an account on your website, Open Laptop.  Cool site, and I intend to contribute more...especially when I get this SD card working.  But I'm rebuilding my gentoo from scratch (just for fun), and I'll probably learn a lot more this time around.

----------

## Insanity5902

Cool, note that once you go to 109, you can't really go back to 104, there are some pretty significant changes and all the rules are rewritten, they are spread out over a dozen or so files. ... atleast I think that is true  :Smile: 

----------

## dsd

the tifm drivers in 2.6.20 include a known regression:

https://bugs.gentoo.org/show_bug.cgi?id=171123

that particular problem is solved by the newer driver version:

http://download.berlios.de/tifmxx/tifm-0.8d.tar.bz2

----------

## coplaniuk

Got it.

I already had the newer drivers loaded, but without the udev rules, I'm guessing that udev didn't know what to do once the card was inserted.  Updating to udev 109 gave me the rules and seems to have made everything better.

Thanks so much for your help on this big 2 or three week difficult path.

----------

