[#4595] rmmod bfin_mac on trunk head make kernel panic

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

[#4595] rmmod bfin_mac on trunk head make kernel panic

Submitted By: Mingquan Pan

Open Date

2008-11-03 03:16:33     Close Date

2008-11-11 06:02:16

Priority:

Medium     Assignee:

Bryan Wu

Status:

Closed     Fixed In Release:

N/A

Found In Release:

N/A     Release:

Category:

N/A     Board:

N/A

Processor:

N/A     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

Oct 10

App binary format:

N/A     

Summary: rmmod bfin_mac on trunk head make kernel panic

Details:

 

rmmod bfin_mac on trunk head make kernel panic on bf537 stamp board.

 

## Starting application at 0x00188280 ...

Linux version 2.6.28-rc2-ADI-2009R1-pre-svn5544 (test@uclinux50-bf537-ad9960-ad1836) (gcc version 4.1.2 (ADI svn)) #8 Sat Nov 1 00:56:02 CST 2008

console [early_BFuart0] enabled

early printk enabled on early_BFuart0

Warning: limiting memory to 56MB due to hardware anomaly 05000263

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x0010a6d0

  rodata    = 0x0010a6e0-0x0015aab0

  bss       = 0x0015aac0-0x0016aa00

  data      = 0x0016aa00-0x0017a000

    stack   = 0x00178000-0x0017a000

  init      = 0x0017a000-0x0049b000

  available = 0x0049b000-0x037ff000

  DMA Zone  = 0x03f00000-0x04000000

Hardware Trace Active and Enabled

Reset caused by Software reset

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

Compiled for ADSP-BF537 Rev 0.2

Blackfin Linux support by   blackfin.uclinux.org/

Processor Speed: 500 MHz core clock and 100 MHz System Clock

NOMPU: setting up cplb tables for global access

Instruction Cache Enabled

Data Cache Enabled (write-through)

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

Kernel command line: root=/dev/mtdblock0 rw earlyprintk=serial,uart0,57600 ip=10.100.4.50:10.100.4.174:10.100.4.174:255.255.255.0:1:eth0:off

Configuring Blackfin Priority Driven Interrupts

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

console handover: boot [early_BFuart0] -> real [ttyBF0]

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

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

Memory available: 52044k/65536k RAM, (3204k init code, 1061k kernel code, 447k data, 1024k dma, 7756k reserved)

Calibrating delay loop... 997.37 BogoMIPS (lpj=1994752)

Security Framework initialized

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

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

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

Blackfin L1 Instruction SRAM: 48 KB (41 KB free)

net_namespace: 288 bytes

NET: Registered protocol family 16

Blackfin GPIO Controller

Blackfin DMA Controller

stamp_init(): registering device resources

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 101

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

Serial: Blackfin serial driver

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

brd: module loaded

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

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

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

TCP cubic registered

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting system clock to 1970-01-01 02:36:30 UTC (9390)

IP-Config: Device `eth0' not found.

Freeing unused kernel memory: 3204k freed

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

                           _____________________________________

        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|            -   blackfin.uclinux.org/

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

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

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

 

Have a lot of fun...

 

 

BusyBox v1.12.1 (2008-10-31 20:47:00 CST) built-in shell (msh)

Enter 'help' for a list of built-in commands.

 

root:/>

************** STEP 3: Starting test.

 

modprobe bfin_mac

bfin_mac_mdio: probed

bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=19)@sclk=100MHz)

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

Case 1 ...PASS

 

Case 1 ...PASS

on 1.1

root:/> lsmod

Module                  Size  Used by

bfin_mac                8

Case 2 ...PASS

 

Case 2 ...PASS

448  0

root:/> ifconfig eth0 10.100.4.50

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

 

Case 3 ...PASS

 

Case 3 ...PASS

ifconfig

eth0      Link encap:Ethernet  HWaddr F2:B2:84:D7:34:26

          inet addr:10.100.4.50  Bcast:10.255.255.255  Mask:255.0.0.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

root:/> ping 10.100.4.174

PING 10.100.4.174 (10.100.4.174): 56 data bytes

64 bytes from 10.100.4.174: seq=0 ttl=6

Case 4 ...PASS

 

Case 4 ...PASS

4 time=4.000 ms

64 bytes from 10.100.4.174: seq=1 ttl=64 time=0.000 ms

64 bytes from 10.100.4.174: seq=2 ttl=64 time=0.000 ms

64 bytes from 10.100.4.174: seq=3 ttl=64 time=0.000 ms

64 bytes from 10.100.4.174: seq=4 ttl=64 time=0.000 ms

64 bytes from 10.100.4.174: seq=5 ttl=64 time=0.000 ms

64 bytes from 10.100.4.174: seq=6 ttl=64 time=0.000 ms

64 bytes from 10.100.4.174: seq=7 ttl=64 time=0.000 ms

64 bytes from 10.100.4.174: seq=8 ttl=64 time=0.000 ms

64 bytes from 10.100.4.174: seq=9 ttl=64 time=0.000 ms

^C

--- 10.100.4.174 ping statistics ---

11 packets transmitted, 10 packets received, 9% packet loss

round-trip min/avg/max = 0.000/0.400/4.000 ms

root:/> rmmod bfin_mac

Hardware Trace:

   0 Target : <0x000045fc> { _dump_bfin_trace_buffer + 0x0 }

     Source : <0x000a7286> { _mdiobus_release + 0x1a } CALL pcrel

   1 Target : <0x000a7286> { _mdiobus_release + 0x1a }

     Source : <0x000a727a> { _mdiobus_release + 0xe } IF !CC JUMP

   2 Target : <0x000a726c> { _mdiobus_release + 0x0 }

     Source : <0x0009f3c0> { _device_release + 0x34 } JUMP (P2)

   3 Target : <0x0009f3ba> { _device_release + 0x2e }

     Source : <0x0009f3d4> { _device_release + 0x48 } IF CC JUMP

   4 Target : <0x0009f3c2> { _device_release + 0x36 }

     Source : <0x0009f3ac> { _device_release + 0x20 } IF !CC JUMP

   5 Target : <0x0009f3a6> { _device_release + 0x1a }

     Source : <0x0009f39e> { _device_release + 0x12 } IF !CC JUMP

   6 Target : <0x0009f38c> { _device_release + 0x0 }

     Source : <0x00089fbe> { _kobject_release + 0x36 } CALL (P2)

   7 Target : <0x00089f88> { _kobject_release + 0x0 }

     Source : <0x0008aa3a> { _kref_put + 0x4a } CALL (P2)

   8 Target : <0x0008aa36> { _kref_put + 0x46 }

     Source : <0x0008aa2a> { _kref_put + 0x3a } IF !CC JUMP

   9 Target : <0x0008a9f0> { _kref_put + 0x0 }

     Source : <0x00089ef0> { _kobject_put + 0x2c } JUMP.L

  10 Target : <0x00089ec4> { _kobject_put + 0x0 }

     Source : <0x0009efc8> { _put_device + 0xc } JUMP.L

  11 Target : <0x0009efbc> { _put_device + 0x0 }

     Source : <0x0009fae0> { _device_unregister + 0x14 } JUMP.L

  12 Target : <0x0009fad8> { _device_unregister + 0xc }

     Source : <0x0009efcc> { _put_device + 0x10 } RTS

  13 Target : <0x0009efcc> { _put_device + 0x10 }

     Source : <0x0009efc0> { _put_device + 0x4 } IF !CC JUMP

  14 Target : <0x0009efbc> { _put_device + 0x0 }

     Source : <0x0009fab2> { _device_del + 0x112 } JUMP.L

  15 Target : <0x0009faaa> { _device_del + 0x10a }

     Source : <0x00089f84> { _kobject_del + 0x30 } RTS

BUG: failure at drivers/net/phy/mdio_bus.c:66/mdiobus_release()!

Kernel panic - not syncing: BUG!

 

 

Follow-ups

 

--- Bryan Wu                                                 2008-11-03 05:18:20

I'll take care of it.

 

-Bryan

 

--- Bryan Wu                                                 2008-11-04 06:17:54

I found this bug was introduced by phylib updating in kernel mainline.

  git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;f=drivers/net/phy/mdio_bus.c;h=fb4c0965b152bafecc83c2cac567f113c4fda2fe;hp=d206691f15d89cc23c144e618da25c68ea380d02;hb=46abc02175b3c246dd5141d878f565a8725060c9;hpb=298cf9beb9679522de995e249eccbd82f7c51999

 

I send out a patch to netdev for review.

---

Index: drivers/net/phy/mdio_bus.c

===================================================================

--- drivers/net/phy/mdio_bus.c    (revision 5577)

+++ drivers/net/phy/mdio_bus.c    (working copy)

@@ -136,7 +136,6 @@

     BUG_ON(bus->state != MDIOBUS_REGISTERED);

     bus->state = MDIOBUS_UNREGISTERED;

 

-    device_unregister(&bus->dev);

     for (i = 0; i < PHY_MAX_ADDR; i++) {

         if (bus->phy_map[i])

             device_unregister(&bus->phy_map[i]->dev);

@@ -165,6 +164,7 @@

     BUG_ON(bus->state != MDIOBUS_UNREGISTERED);

     bus->state = MDIOBUS_RELEASED;

 

+    device_unregister(&bus->dev);

     put_device(&bus->dev);

}

EXPORT_SYMBOL(mdiobus_free);

---

 

-Bryan

 

--- Bryan Wu                                                 2008-11-07 11:41:29

fixed by Lennert's patch and Thanks Grace to verify this patch on the test

machine.

 

-Bryan

 

--- Mingquan Pan                                             2008-11-11 06:02:16

Yes, it is fixed. Close.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes