maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Troubleshooting (https://talk.maemo.org/forumdisplay.php?f=6)
-   -   Does the kernel lie to us regarding MMC slot_name? (https://talk.maemo.org/showthread.php?t=26094)

Thesandlord 2009-01-09 04:35

Re: Does the kernel lie to us regarding MMC slot_name?
 
N810 here...

Because the external card is MMC1 and internal card is MMC2, I assumed that mmcblk0 is external and mmcblk1 is internal.

So,
mmcblk1 = internal
mmcblk0 = external

This is what the commands showed me, so I got what I expected...

qole 2009-01-09 05:20

Re: Does the kernel lie to us regarding MMC slot_name?
 
Quote:

Originally Posted by Thesandlord (Post 255645)
N810 here...

mmcblk1 = internal
mmcblk0 = external

Maybe the confusion lies in the fact that it is the opposite for N800s. mmcblk0 = internal on an N800, and external on N810.

Benson 2009-01-09 05:29

Re: Does the kernel lie to us regarding MMC slot_name?
 
Quote:

Originally Posted by qole (Post 255659)
Maybe the confusion lies in the fact that it is the opposite for N800s. mmcblk0 = internal on an N800, and external on N810.

I thought it was that way for N810s, too...

fanoush 2009-01-09 06:10

Re: Does the kernel lie to us regarding MMC slot_name?
 
yes, n810 has mmc interfaces swapped, also the related bug is still there, see "inconsistent mmc device naming at boot time when one card is missing" - https://bugs.maemo.org/show_bug.cgi?id=2747

kernel patch was quite trivial after all and there is workaroud for this in bootmenu for buggy (=all nokia released) kernels

fanoush 2009-01-09 08:15

Re: Does the kernel lie to us regarding MMC slot_name?
 
just to clarify, n810 has physical mmc interfaces swapped but this is swapped in kernel too and for both devices the idea was that internal slot has name "internal" and should be mmcblk0. Sadly there is this bug/feature that kernel always assigns mmcblk0 first if there is only one card and in case of both it scans and gives the names in different order for N810 and N800. This is 'corrected' by udev naming rules later at boot time so at least the device names in /dev/ are 'correct' (=what is expected, /dev/mmcblk0 is internal) but it sometimes differs from kernel view.

Feel free to vote for https://bugs.maemo.org/show_bug.cgi?id=2747 :-) This is not first time someone is confused with this behaviour here in the forum, see forum links in bug description.

fanoush 2009-01-09 08:44

Re: Does the kernel lie to us regarding MMC slot_name?
 
And the answer to "Does the kernel lie to us regarding MMC slot_name?" is:

No, kernel is always right :-) It is just userspace (udev) that confuses things by insisting on consistent naming and giving /dev/mmcblkX nodes different name from kernel.

Tha patch is about kernel complying with nokia/udev world view and giving external slot always mmcblk1 (i.e. device minor number starting at 8) no matter what cards are present or in what order slots are scanned at boot time.

lardman 2009-01-09 09:44

Re: Does the kernel lie to us regarding MMC slot_name?
 
Not just my innate laziness, I was asleep as it was night time here (I know that is in itself pretty lazy when there's hacking to be done, my apologies :))

Anyway, here we go:

Mount output:
/dev/mmcblk0p1 on /media/mmc2
/dev/mmcblk1p1 on /media/mmc1

Nokia-N810-23-14:~# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/mmcblk0p1 1999206 1844264 154942 92% /media/mmc2
/dev/mmcblk1p1 3971584 3795424 176160 96% /media/mmc1

Nokia-N810-23-14:~# cat /sys/block/mmcblk0/device/../slot_name
external
Nokia-N810-23-14:~# cat /sys/block/mmcblk1/device/../slot_name
internal

So mmc1/mmcblk1p1 is my external card, but it's named internal.
and mmc2/mmcblk0p1 is my internal, and it's named external.

fanoush 2009-01-09 09:51

Re: Does the kernel lie to us regarding MMC slot_name?
 
Quote:

Originally Posted by lardman (Post 255719)
So mmc1/mmcblk1p1 is my external card, but it's named internal.
and mmc2/mmcblk0p1 is my internal, and it's named external.

the kernel view about correct X in mmcblkX can be seen in /proc/partitions, if you ls -l your /dev/mmcblk0* you'll notice device minor >=8 which should belong to mmcblk1 (and is reported as such in /proc/partitions), that's what udev does, it gives wrong (from kernel POV) but expected name so that naming is consistent with user.

Chelloveck 2009-01-09 15:06

Re: Does the kernel lie to us regarding MMC slot_name?
 
First, to confirm which mmc# is which...

woozle:~$ df -h /media/mmc1 /media/mmc2
Filesystem Size Used Available Use% Mounted on
/dev/mmcblk1p1 7.5G 5.0G 2.2G 70% /media/mmc1
/dev/mmcblk0p1 1.8G 988.0M 746.0M 57% /media/mmc2


Good, this confirms exactly what I thought...

/dev/mmcblk0p1 = /media/mmc2 = internal card
/dev/mmcblk1p1 = /media/mmc1 = external card


Now, to get the slot names...

woozle:~$ cat /sys/block/mmcblk0/device/../slot_name
external
woozle:~$ cat /sys/block/mmcblk1/device/../slot_name
internal


Whoops, backwards! So no, not what I expected. This is on an n810.

(Note: I voted 'yes' because I'm an idiot. I voted, then started posting and realized that I had initially mis-read the results. Move one n810 vote from the 'yes' column to the 'no' column.)

woozle:~$ uname -a
Linux woozle 2.6.21-omap1 #2 Tue Oct 14 11:25:25 EEST 2008 armv6l unknown


(And I'm constantly annoyed that mmc1 is the external card and mmc2 is the internal. I keep wanting it to be the other way around and get involved some serious doublethink trying keep them straight. This is purely a problem with the user, not the device. But still.)

fatalsaint 2009-01-09 15:53

Re: Does the kernel lie to us regarding MMC slot_name?
 
I said No on an N810.

When I am booted into Flash.. mmcblk0 is NAMED external, but actually is internal; mmcblk1 is NAMED internal, but is actually external. When I am booted into SD (either).. mmcblk0 = external, mmcblk1 = internal. Confuses the hell out of me.

Since in Flash mmcblk0 is truly internal; that's what I expect it to be named and also what I expect it to be when I boot into SD (in either maemo OR any of the flavors of debian).

So yes.. my N810 is a big fat liar.


All times are GMT. The time now is 02:16.

vBulletin® Version 3.8.8