LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-25-2014, 06:36 AM   #1
s.verma
Member
 
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 183
Blog Entries: 4

Rep: Reputation: 25
SD card not recognized on Linux 3.12.6-1-ARCH.


SD card on my linux system is not being recognized.

System Info:
Acer Gateway NE56R
Kernel: Linux
output of 'uname -r' = 3.12.6-1-ARCH
'uname -m' = x86_64
Distro: ArchBang Linux.

Problem Detail: When I insert my SD card to inbuilt card reader, it doesn't get detected.
'dmesg' output
[ 1192.997813] mmc0: Timeout waiting for hardware interrupt.
(I have given only the last change after inserting card.)
Waiting for some time adds another such lines
[ 1203.034971] mmc0: Timeout waiting for hardware interrupt.
[ 1213.072073] mmc0: Timeout waiting for hardware interrupt.
etc.

After removing my card,
'dmesg' output:
[ 1213.786130] mmc0: Card removed during transfer!
[ 1213.786142] mmc0: Resetting controller.

'lspci|grep SD' output:
02:00.1 SD Host controller: Broadcom Corporation BCM57765/57785 SDXC/MMC Card Reader (rev 10)

What I have tried:
1) On Windows 7:
My card reader hardware is working perfectly in Windows 7, which detect my SD card and can read write to it.
Conclusion: No problem with laptop hardware.
2) Created /etc/modprobe.d/sd-card-fix.conf
with content
Quote:
options sdhci debug_quirks=0x40
then
rmmod sdhci
modprobe sdhci
Result: Situation remains the same.

Help which I expect:
1) To resolve the aforementioned problem.
and/or
2) At least what does it all mean.
I mean what "mmc0: Timeout waiting for hardware interrupt" means.
 
Old 01-25-2014, 12:11 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, RPi OS, Mint & Android
Posts: 12,549

Rep: Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561
Dont expect anything. If you get anything, be grateful, and do it for others if you can.

Your questions. Presuming a usb card reader,
1. find the card reader
/usr/bin/lsusb -v |less & pick out your card reader
(lsusb -v |grep Reader might do it)

Then google for the module for that card. Add linux as a search term. give it that module. Recompile the kernel if necessary to do it.

2. Timeout waiting for hardware interrupt says that it's waiting for the card reader to do something, but it didn't do what the module was waiting for. It suggests the module might be wrong.
 
Old 01-27-2014, 05:25 AM   #3
s.verma
Member
 
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 183

Original Poster
Blog Entries: 4

Rep: Reputation: 25
First of all I am really grateful and thankful for the quick response to the problem.

Let me give more information about hardware.
I am having Broadcom BCM57785 Netlink highly integrated multifunciton controller that integrates:
1) triple speed LAN.
2) 5in1 memory card reader controller (SD,MMC,MS,MS PRO,xD-Picture type cards).

"https://www.broadcom.com/products/Ethernet-Controllers-and-Adapters/Enterprise-Client-Controllers/BCM57785"

So it is not an external usb card reader, but internal inbuilt card reader in my laptop which comes with LAN controller.

Driver:
On website www.broadcom.com I have found tg3 driver version 3.133, which is already installed in my system as found by
'modinfo tg3'.
 
Old 01-27-2014, 06:05 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, RPi OS, Mint & Android
Posts: 12,549

Rep: Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561
That chip has come up for mention before. google this

bcm57785 linux module sdcard

I'm seeing loads of sensible looking hits. Bear in mind that you might have to load one module before the other, e.g. tg3 before (or after) the sdcard reader. You can write a broadcom.conf in /etc/modprobe.d/ to do this with commands

preinstall module1 module2
or
postinstall module1 module2

which control this
 
Old 01-28-2014, 12:47 AM   #5
s.verma
Member
 
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 183

Original Poster
Blog Entries: 4

Rep: Reputation: 25
Updates about problem:
The SD card do not work only when it is hot plugged.
SD card works flawlessly when is plugged in slot first then linux is booted.

Solutions on internet:
The modules needed are already in my system (sdhci, pciehp etc. pciehp is builtin kernel).
1) I have tried using boot parameters and their combinations
pcie_ports=native pcie_aspm=force/off pciehp.pciehp_force=1
pci_hotplug.debug_acpi=1

2) Loading modules tifm_sd and mmc_block at startup.
(Both modules are installed in the system.)

3) adding files /etc/modprobe.d/sd-card-fix.conf

options sdhci debug_quirks=1

and /etc/modprobe.d/pciehp.conf

options pciehp pciehp_force=1

Result:
Till date none of these solved the problem.

Last edited by s.verma; 01-28-2014 at 12:52 AM.
 
Old 01-28-2014, 10:02 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, RPi OS, Mint & Android
Posts: 12,549

Rep: Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561
Now you sound as if you have got your teeth into the problem. Glad to hear it works from startup.
My one is a bit iffy sometimes - and hard to pin down. There's a big lazy streak running through me and I never got 100% to the bottom with my sdcard reader. I left an old (and doubtful but reformatted) sdcard in my reader with a line in /etc/fstab and it stays there. Then if you want to use, unmount the old, remove it, and mount the new.

One other word of advice. Add the word "Solved" to the search, and see if you pick up someone who has sorted it. Otherwise, file a bug on the module. Software writers love to have the remote use of a bit of troublesome hardware to sort their code.
 
Old 01-28-2014, 11:30 PM   #7
s.verma
Member
 
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 183

Original Poster
Blog Entries: 4

Rep: Reputation: 25
Good News:
SD card reader has worked.

The mistake I was doing was to reload module sdhci, and passing arguments to pciehp etc.
But I think that since SD card reader is integrated in LAN so Broadcom tg3 driver must be paid attention to.

The Solution:
Steps:
1) Boot the system with/without sd card in slot.
2) Put SD card in the slot.
3) Open terminal and issue these commands as root:
rmmod tg3
modprobe -v tg3

Result: Card is detected and can be mounted easily just like a usb pen drive.

What remains now:
Although the main problem is solved but still I want to know if there is a method so that I can automate this task whenever I put SD card in the slot, so that I do not have to issue those commands as root every time I use SD card.

Update:
In step 3, it is not necessary to issue two commands in same order.
I have tried as:
a) modprobe -r tg3
modprobe tg3
b) modprobe tg3
modprobe -r tg3

irrespective of whether tg3 is loaded prior issuing two commands or not (Amazing and astonishing).

Does it mean that tg3 is not involved but somehow playing with its loading/unloading works?

(I checked status of tg3 by issuing lsmod. As I know lsmod lists loaded modules.)

Last edited by s.verma; 01-29-2014 at 07:11 AM. Reason: Adding update.
 
Old 01-30-2014, 03:30 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, RPi OS, Mint & Android
Posts: 12,549

Rep: Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561
maybe put a line in /etc/modprobe.d/ in some file (ending in .conf)

install sdhci=/sbin/rmmod-f tg3 && /sbin/modprobe shhci && /sbin/modprobe tg3

Fiddle around with something like that. Instead of the install command, there are preinstall and postinstall as well
 
Old 02-03-2014, 08:07 AM   #9
s.verma
Member
 
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 183

Original Poster
Blog Entries: 4

Rep: Reputation: 25
I want to know when we connect a hardware to a computer,
what does it generally do,
so that it can be known that a hardware is connected.

Does it create some interrupt which can be harnessed to run a script?

e.g hardware plugged => something generated in system recognizable programmatically => that something can be used in a program to run a script.
 
Old 02-03-2014, 12:21 PM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, RPi OS, Mint & Android
Posts: 12,549

Rep: Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561
Yes, it does create: files in /sys, file in /dev. Start reading up on those.
 
Old 02-09-2014, 12:55 AM   #11
s.verma
Member
 
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 183

Original Poster
Blog Entries: 4

Rep: Reputation: 25
Actually the files are created after SD card is detected (which happens after modprobe ..).

Before loading/reloading driver nothing comes up in /dev/ or /sys/, as I have 'diffed' ls -Rl /dev/ & ls -Rl /sys/ before and after plugging sd card.

So it seems that this method can not be used to automate
modprobe -r tg3 && modprobe tg3
when SD card is plugged.

Last edited by s.verma; 02-09-2014 at 12:57 AM.
 
Old 02-10-2014, 02:21 AM   #12
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, RPi OS, Mint & Android
Posts: 12,549

Rep: Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561
Maybe you have to tgo back to kernel level. Ugh!
 
Old 02-11-2014, 05:57 AM   #13
s.verma
Member
 
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 183

Original Poster
Blog Entries: 4

Rep: Reputation: 25
Can someone suggest me a udev rule so that I can reload the driver on inserting SD card automatically.

dmesg output on plugging SD card is
mmc0: timeout waiting for hardware interrupt.

So a udev rule for something as
mmc0 detected
hence run
'/sbin/modprobe -r tg3 && /sbin/modprobe tg3'

Last edited by s.verma; 02-11-2014 at 06:04 AM.
 
Old 02-12-2014, 03:08 PM   #14
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, RPi OS, Mint & Android
Posts: 12,549

Rep: Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561Reputation: 1561
maybe check what your distro has in there. I found some very dodgy stuff once which was better taken out.
 
Old 02-12-2014, 04:22 PM   #15
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,677

Rep: Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334
Wonder if the bios see's it as a hard drive when booted and then later as a removable hot plug device after boot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless card not detected on Dell Latitude D420, Arch linux deadalus.globalnode Linux - Networking 23 04-06-2011 10:13 AM
[arch linux ] Pulse audio,ATI Technologies Inc RV710/730 no card detected artur13 Linux - Newbie 3 01-19-2011 02:21 PM
Nic card not recognized when install linux abefroman Linux - Hardware 4 10-14-2009 12:10 PM
Linux Debian, DWL-G650 wireless card not recognized tizak Linux - Newbie 1 04-17-2009 06:41 AM
Wireless card no longer recognized in Linux pmehta1613 Linux - Wireless Networking 12 10-28-2003 10:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration