[#5806] mmc device node can not generated correctly after partition

Document created by Aaronwu Employee on Sep 5, 2013
Version 1Show Document
  • View in full screen mode

[#5806] mmc device node can not generated correctly after partition

Submitted By: Vivi Li

Open Date

2010-01-04 02:08:13     Close Date

2010-01-13 22:39:24

Priority:

Medium     Assignee:

Cliff Cai

Status:

Closed     Fixed In Release:

N/A

Found In Release:

2010R1     Release:

Category:

Drivers     Board:

EZBRD

Processor:

BF518     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

gcc4.3_trunk3771

App binary format:

N/A     

Summary: mmc device node can not generated correctly after partition

Details:

 

After partition, mmc device node can not generated correctly in bf518f-ezbrd/bf548-ezkit in trunk.

 

Bellow is the example on bf518f-ezbrd and its config is attached.

--

Linux version 2.6.32.2-ADI-2010R1-pre-svn8107 (test@uclinux80-bf518f) (gcc version 4.3.4 (ADI-trunk/svn-3771) ) #12 Fri Jan 1 130

register early platform devices

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart0] enabled

early printk enabled on early_BFuart0

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x0011d110

  rodata    = 0x0011d110-0x001790d0

  bss       = 0x0017a000-0x0018acbc

  data      = 0x0018acbc-0x0019a000

    stack   = 0x0019a000-0x0019c000

  init      = 0x0019c000-0x007ad000

  available = 0x007ad000-0x03f00000

  DMA Zone  = 0x03f00000-0x04000000

Hardware Trace Active and Enabled

Boot Mode: 1

Reset caused by Software reset

Blackfin support (C) 2004-2009 Analog Devices, Inc.

Compiled for ADSP-BF518 Rev 0.1

Blackfin Linux support by http://blackfin.uclinux.org/

Processor Speed: 400 MHz core clock and 80 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

  External memory: cacheable in instruction cache

Data Cache Enabled for CPU0

  External memory: cacheable (write-back) in data cache

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 16002

Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600 ip=10.100.4.50f

PID hash table entries: 256 (order: -2, 1024 bytes)

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory available: 56084k/65536k RAM, (6212k init code, 1136k kernel code, 508k data, 1024k dma, 572k reserved)

Hierarchical RCU implementation.

NR_IRQS:119

Configuring Blackfin Priority Driven Interrupts

console [ttyBF0] enabled, bootconsole disabled

console [ttyBF0] enabled, bootconsole disabled

Calibrating delay loop... 796.67 BogoMIPS (lpj=1593344)

Security Framework initialized

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (16 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 32 KB (26 KB free)

NET: Registered protocol family 16

Blackfin DMA Controller

ezbrd_init(): registering device resources

bio: create slab <bio-0> at 0

Switching to clocksource jiffies

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

NET: Registered protocol family 1

msgmni has been set to 109

io scheduler noop registered (default)

bfin-otp: initialized

bfin-uart: Blackfin serial driver

bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 29) is a BFIN-UART

brd: module loaded

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7

bfin-spi bfin-spi.1: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc03400, dma channel@5

bfin_mii_bus: probed

bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=15)@sclk=80MHz)

bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

i2c /dev entries driver

i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc01400

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

dma_alloc_init: dma_page @ 0x0273e000 - 256 pages at 0x03f00000

TCP cubic registered

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting system clock to 2004-06-03 13:12:51 UTC (1086268371)

mmc0: host does not support reading read-only switch. assuming write-enable.

mmc0: new SD card at address e624

mmcblk0: mmc0:e624 SD02G 1.89 GiB

mmcblk0: p1 p2

IP-Config: Complete:

     device=eth0, addr=10.100.4.50, mask=255.255.255.0, gw=10.100.4.174,

     host=bf518f-ezbrd, domain=, nis-domain=(none),

     bootserver=10.100.4.174, rootserver=10.100.4.174, rootpath=

Freeing unused kernel memory: 6212k freed

                           _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            - http://blackfin.uclinux.org/

\    YP"    `| 8P  `.          - http://docs.blackfin.uclinux.org/

/     \.___.d|    .'           - http://www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    - http://www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.15.3 (2010-01-01 11:58:10 CST) hush - the humble shell

 

root:/> PHY: 0:01 - Link is Up - 100/Full

 

root:/>

root:/> ls /dev/mmcblk0*

/dev/mmcblk0    /dev/mmcblk0p1  /dev/mmcblk0p2

root:/> fdisk /dev/mmcblk0

 

The number of cylinders for this disk is set to 62032.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): p

 

Disk /dev/mmcblk0: 4 heads, 16 sectors, 62032 cylinders

Units = cylinders of 64 * 512 bytes

 

        Device Boot    Start       End    Blocks   Id  System

/dev/mmcblk0p1             1      8193    262168   83  Linux

/dev/mmcblk0p2          8194     62032   1722848   83  Linux

 

Command (m for help): d

Partition number (1-4): 1

 

Command (m for help): d

Partition number (1-4): 2

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-62032, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-62032, default 62032):

Using default value 62032

 

Command (m for help): p

 

Disk /dev/mmcblk0: 4 heads, 16 sectors, 62032 cylinders

Units = cylinders of 64 * 512 bytes

 

        Device Boot    Start       End    Blocks   Id  System

/dev/mmcblk0p1             1     62032   1985016   83  Linux

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

mmcblk0: p1

mmcblk0: p1

 

WARNING: If you have created or modified any DOS 6.x

partitions, please see the fdisk manual page for additional

information.

Syncing disks.

root:/> ls /dev/mmcblk0*

/dev/mmcblk0    /dev/mmcblk0p1

root:/>

root:/>

root:/> fdisk /dev/mmcblk0

 

The number of cylinders for this disk is set to 62032.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): d

Partition number (1-4): 1

 

Command (m for help): p

 

Disk /dev/mmcblk0: 4 heads, 16 sectors, 62032 cylinders

Units = cylinders of 64 * 512 bytes

 

        Device Boot    Start       End    Blocks   Id  System

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-62032, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-62032, default 62032): +200M

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 2

First cylinder (6402-62032, default 6402):

Using default value 6402

Last cylinder or +size or +sizeM or +sizeK (6402-62032, default 62032):

Using default value 62032

 

Command (m for help): p

 

Disk /dev/mmcblk0: 4 heads, 16 sectors, 62032 cylinders

Units = cylinders of 64 * 512 bytes

 

        Device Boot    Start       End    Blocks   Id  System

/dev/mmcblk0p1             1      6401    204824   83  Linux

/dev/mmcblk0p2          6402     62032   1780192   83  Linux

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

mmcblk0: p1 p2

mmcblk0: p1 p2

 

WARNING: If you have created or modified any DOS 6.x

partitions, please see the fdisk manual page for additional

information.

Syncing disks.

root:/> ls /dev/mmcblk0*

/dev/mmcblk0    /dev/mmcblk0p2

root:/>

--

 

Follow-ups

 

--- Cliff Cai                                                2010-01-04 04:07:42

it should be mdev's problem,I can see the partition information both in /sys/

and /proc/.

Also,try the same test on bf548-ezkit atapi and get the similar result.

 

Cliff

 

--- Cliff Cai                                                2010-01-04 04:51:31

It's so funny that if one or more  partitions are set to windows type,then all

the device nodes can be seen correctly.

 

Cliff

 

--- Mike Frysinger                                           2010-01-04 10:43:02

it could simply be a race condition.  perhaps mdev is executed once per old

partition to delete them, then once per new partition to create them.

 

try running `mdev -s` after you quit fdisk and see if they all show up

 

--- Cliff Cai                                                2010-01-04 22:35:25

So, any idea to avoid the race condition?My thought is to save the deleting

information to disk before recreating them. 

 

Cliff

 

--- Mike Frysinger                                           2010-01-04 22:39:54

are you saying that it looks like a race condition ?  i dont have any hardware

setup atm to test myself.

 

--- Cliff Cai                                                2010-01-05 01:43:11

I still need to dig into this problem,my guess is that the hotplug events

weren't issued according to the sequence of fdisk operations.

 

Cliff

 

--- Mike Frysinger                                           2010-01-05 01:49:08

i doubt that.  more likely the flurry of spawned processes by the kernel caused

them to be scheduled out of "expected" order but perfectly acceptable

behavior from the kernel POV.

 

mdev already tries to account for this via /dev/mdev.seq and $SEQNUM.

 

--- Cliff Cai                                                2010-01-05 04:02:44

I guessed I found the same problem in busybox mailing list.

http://lists.busybox.net/pipermail/busybox/2008-June/065768.html

 

--- Mike Frysinger                                           2010-01-05 10:35:15

and that thread is why Denys introduced mdev.seq

 

--- Cliff Cai                                                2010-01-12 02:40:44

Fixed by introducing /dev/mdev.seq to serialize the hotplug events.

 

Cliff

 

--- Vivi Li                                                  2010-01-13 22:39:15

OK now. Close it.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

config.linux.sdiommc    application/octet-stream    32738    Vivi Li

Attachments

Outcomes