Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] SD card reader not working on custom kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Fri Oct 30, 2020 8:10 am    Post subject: [solved] SD card reader not working on custom kernel Reply with quote

I tried many times to get it working on several kernel versions but it never worked.
Then I saw in dmesg log of live media (e.g. gentoo-based SystemRescueCD or new Arch based one also) it detects it and it worked
Code:
[   13.467373] sdhci: Secure Digital Host Controller Interface driver
[   13.467375] sdhci: Copyright(c) Pierre Ossman
[   13.507868] mmc0: SDHCI controller on ACPI [80860F14:00] using ADMA

vs my dmesg:
Code:
[    1.288631] sdhci: Secure Digital Host Controller Interface driver
[    1.288633] sdhci: Copyright(c) Pierre Ossman

Code:
# grep -i 8086 /lib/modules/5.9.1-gentoo/modules.* | grep -i 0f14
/lib/modules/5.9.1-gentoo/modules.alias:alias pci:v00008086d00000F14sv*sd*bc*sc*i* sdhci_pci
/lib/modules/5.9.1-gentoo/modules.alias:alias acpi*:80860F14:* sdhci_acpi

Don't know where I make mistake.


Last edited by DeIM on Mon Nov 22, 2021 5:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3685

PostPosted: Fri Oct 30, 2020 8:49 am    Post subject: Reply with quote

You might want to search the internet for "8086 0F14" and one of the hits might be cateee.net
Are you having those CONFIG options both enabled?
Back to top
View user's profile Send private message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Fri Oct 30, 2020 2:24 pm    Post subject: Reply with quote

yes:
Code:
# grep SDHC .config
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_IO_ACCESSORS=y
CONFIG_MMC_SDHCI_PCI=y
CONFIG_MMC_SDHCI_ACPI=y
# CONFIG_MMC_SDHCI_PLTFM is not set

Code:
# grep PCI .config
...
CONFIG_PCI=y
...
Back to top
View user's profile Send private message
grumblebear
Apprentice
Apprentice


Joined: 26 Feb 2008
Posts: 204

PostPosted: Sun Nov 01, 2020 9:23 am    Post subject: Reply with quote

First, try to build those as modules insted of having them compiled in. If they do not get loaded automatically, you can at least try to modprobe them and see what happens.
Back to top
View user's profile Send private message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Fri Nov 20, 2020 1:35 pm    Post subject: Reply with quote

Tried to compile as modules. No change. Those are loaded automatically:
Code:
sdhci_acpi             24576  0
sdhci                  61440  1 sdhci_acpi

tried to load sdhci_pci and unload sdhci_acpi also.
Maybe ADMA which uses another media?
Back to top
View user's profile Send private message
theotherjoe
Guru
Guru


Joined: 22 Nov 2003
Posts: 393

PostPosted: Fri Nov 20, 2020 2:31 pm    Post subject: Reply with quote

anything in dmesg output that gives a hint
about what is going wrong?
Back to top
View user's profile Send private message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Fri Nov 20, 2020 3:44 pm    Post subject: Reply with quote

I see nothing wrong:
https://pastebin.com/1FDQcqW0

Working dmesg (from SysResc):
https://pastebin.com/Qx8WqsNX
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Nov 20, 2020 5:53 pm    Post subject: Reply with quote

charles17 wrote:
You might want to search the internet for "8086 0F14" and one of the hits might be cateee.net
Are you having those CONFIG options both enabled?


You can eliminate this uncertainty. 8)

https://duckduckgo.com/?q=site%3Acateee.net+0F14&ia=web
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Sat Dec 12, 2020 9:22 pm    Post subject: Reply with quote

I see something wrong about ADMA - I have very little info about it - too little info in menuconfig search also.
Found this about it:
https://e2e.ti.com/support/legacy_forums/omap/f/885/t/385576?Difference-between-ADMA-and-SDMA

Is it possible that ADMA is somehow missing in my kernel config?
If so, where is it located since I can't see it anywhere. :?

Many thanks! :wink:
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3685

PostPosted: Sun Dec 13, 2020 10:08 am    Post subject: Reply with quote

DeIM wrote:
Is it possible that ADMA is somehow missing in my kernel config?
If so, where is it located since I can't see it anywhere. :?

Have you tried
Code:
cd /usr/src/<your kernel>
su -c "make menuconfig"
Then read the very first line on top saying »Press [...], </> for Search.«
Back to top
View user's profile Send private message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Mon Jan 18, 2021 6:54 pm    Post subject: Reply with quote

Yes, I used searching before. But the most relevant I found was:
Code:
  │ Symbol: INTEL_IOP_ADMA [=n]
  │ Type  : tristate
  │ Defined at drivers/dma/Kconfig:313
  │   Prompt: Intel IOP32x ADMA support
  │   Depends on: DMADEVICES [=y] && (ARCH_IOP32X || COMPILE_TEST [=n])
  │   Location:
  │     -> Device Drivers
  │ (2)   -> DMA Engine support (DMADEVICES [=y])
  │ Selects: DMA_ENGINE [=y] && ASYNC_TX_ENABLE_CHANNEL_SWITCH [=n]


I think I'll give sys-kernel/gentoo-kernel-bin a try to see if it differ.
Back to top
View user's profile Send private message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Thu Oct 28, 2021 5:14 pm    Post subject: Reply with quote

I've just created installation on Flash disk with kernel and initrd generated by genkernel.
After boot of same version of kernel I can see sdcard and I can insert and mount SD cards.
Still don't know how to achieve the same with manually configured kernel. I've tried to enable many modules.
Is there a chance it must be included and loaded by initrd?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5362
Location: Bavaria

PostPosted: Thu Oct 28, 2021 5:55 pm    Post subject: Reply with quote

DeIM wrote:
Still don't know how to achieve the same with manually configured kernel. I've tried to enable many modules.

If your initrd is able to bring up a working SD card reader you must have all needed modules in your kernel, so you must be able to achieve the same with a manually configured kernel.

I recommend to work with the help function in your "make menuconfig".You will get there the most interesting informations:
1.) The NAME of the module
2.) which module depends on other modules,
3.) which modules selects other modules and
4.) which module was enabled/selected by another module.

An example is the first entry in "Device Drivers -> [*] MMC/SD/SDIO card support". It depends on
Code:
CONFIG_MMC_BLOCK:                                                                                                                                                                                                                                                                           

[helptext]                                                                                                                                                                                                                                                                       

Symbol: MMC_BLOCK [=y]                                                                                                                                                                                                                                                                         
 Type  : tristate                                                                                                                                                                                                                                                                               
 Defined at drivers/mmc/core/Kconfig:37
 Prompt: MMC block device driver
 Depends on: MMC [=y] && BLOCK [=y]

This one doesnt have a
Code:
Selects:

Selected by [n]:

First you should do: Decide if you want to have them static in your kernel or as module. The do ALL as module OR static (no mismatch; only options which are not able to get in as module you can mismatch).
Second: get a list of your modules with "lsmod".
Delete all modules from your list, you know they doesnt have any clue to your SD cardreader.
So you will have maybe 4 or 7 modules left (maybe some modules which are not related to your SD; but this you will find out).
Search them with / in your make menuconfig. Then go into the HELP and read. If you dont find a module with / you know this module depends on another one and will be only visible if you enabled the other one. After a while of searching you have found them all ... even these which are at first sight invisible. You can also use "z" (toggle-function) to see invisible modules.

Good Luck,
Peter
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5362
Location: Bavaria

PostPosted: Thu Oct 28, 2021 6:09 pm    Post subject: Reply with quote

P.S.: Do the "lsmod" AFTER you inserted a SD card and after you WORKED with the SD card ...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54804
Location: 56N 3W

PostPosted: Thu Oct 28, 2021 6:39 pm    Post subject: Reply with quote

pietinger,

Its also possible to do
Code:
modprobe -r module
and see what makes the card reader non operational.
rmmod is a bit more brutal. It will remove modules that are in use too.
Its a very bad thing to remove the kernel module for your video card, or hard drives, so don't do that.

lsmod lists modules in module load order with the first loaded module at the bottom of the list.
If modprobe -r fails because the module is in use, its either used by the kernel or something further up the list.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5362
Location: Bavaria

PostPosted: Thu Oct 28, 2021 8:27 pm    Post subject: Reply with quote

Neddy,

thank you very much again, especially this is very helpful:

NeddySeagoon wrote:
lsmod lists modules in module load order with the first loaded module at the bottom of the list.


... bottom ... bottom ... NOT top ... aaaarggghhh ;-)

Many greetings,
Peter
Back to top
View user's profile Send private message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Mon Nov 22, 2021 5:43 pm    Post subject: Reply with quote

Thanks very much for guidelines. I must be stupid cause I was unable to make it work modifying the configuration.
I discovered the last difference - dw_dmac which provides ADMA for mmc, I suppose, didn't loaded at all. It was in config. Tried modules and built-in also. Nothing worked. I spend no little time with it...
Then I decided to make VV approach - I put working config and tried to put away things laptop don't use. Now I have everything working.
Many thanks to You all - I'm closing it finally :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum