DM814x掛載網路檔案系統失敗

來源:互聯網
上載者:User

一、核心列印
CPSW phy found : id is : 0x1cc912
PHY 0:00 not found
IP-Config: Complete:
    device=eth0, addr=192.168.0.33, mask=255.255.255.0, gw=192.168.0.1,
    host=192.168.0.33, domain=, nis-domain=(none),
    bootserver=192.168.0.1, rootserver=192.168.0.150, rootpath=
PHY: 0:01 - Link is Up - 1000/Full
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00            128 mtdblock0  (driver?)
1f01            2304 mtdblock1  (driver?)
1f02            128 mtdblock2  (driver?)
1f03            4352 mtdblock3  (driver?)
1f04          107520 mtdblock4  (driver?)
1f05          12288 mtdblock5  (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
Backtrace:
[<c004bf70>] (dump_backtrace+0x0/0x110) from [<c038ef44>] (dump_stack+0x18/0x1c)
 r6:00008000 r5:c4770000 r4:c0500b58 r3:60000013
[<c038ef2c>] (dump_stack+0x0/0x1c) from [<c038efa4>] (panic+0x5c/0x178)
[<c038ef48>] (panic+0x0/0x178) from [<c0009184>] (mount_block_root+0x1c4/0x204)
 r3:00000000 r2:00000000 r1:c4425f58 r0:c0448c15
 r7:c0448c79
[<c0008fc0>] (mount_block_root+0x0/0x204) from [<c0009358>] (mount_root+0xac/0xcc)
[<c00092ac>] (mount_root+0x0/0xcc) from [<c00094e4>] (prepare_namespace+0x16c/0x1cc)
 r4:c0500024
[<c0009378>] (prepare_namespace+0x0/0x1cc) from [<c0008d70>] (kernel_init+0x114/0x154)
 r5:c002d0ac r4:c002d0ac
[<c0008c5c>] (kernel_init+0x0/0x154) from [<c00731d4>] (do_exit+0x0/0x5d0)
 r5:c0008c5c r4:00000000

二、問題背景
  筆者用百兆網線串連板子的時候,可以進入檔案系統,這也隱含說明,筆者的網路檔案系統是
沒有問題的;但是用千兆網線串連板子的時候,核心啟動的時候會卡在掛載網路檔案系統的那一步。

見(一、核心列印)中列印的資訊。
  筆者使用的網卡不是TI官方原理圖上的那個網卡,是我們後換了個網卡(RTL8211CL),所以剛
開始懷疑可能是核心網卡驅動對我們這款網卡千兆支援有問題,所以費了點時間熟悉了下RTL8211CL,並結合核心代碼去分析。後來筆者在 genphy_read_status()這個函數跟蹤列印中,有了點突破性
的發現,這個函數在drivers/net/phy/phy_device.c 。本來在百兆網線串連的環境下,因為列印
也出現了卡住問題(見:一、核心列印),後來思考問題可能網卡哪邊初始化太遲,導致在掛載
網路檔案系統的時候,還未完成,就導致了這卡住的問題,順著這個思路,進行了一些測試,最後
問題解決了。

三、問題分析
  去分析 init/main.c 、init/do_mounts.c 、net/phy/phy_device.c 檔案中相關代碼。

四、解決方案
  方法一、在啟動參數 bootargs 中添加 rootdelay=2 即可;
  方法二、在核心代碼init/main.c檔案中,有個kernel_init()函數,在此函數中以下代碼
          位置添加一個延時兩秒 ssleep(2),注意包含標頭檔 #include <linux/delay.h>;
if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) {
    ramdisk_execute_command = NULL;
    ssleep(2);//延時兩秒左右
    prepare_namespace();
}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.