当前位置: 技术问答>linux和unix
百分跪求:MPC8313平台上调试网卡驱动问题,跪求答案...要丢工作了
来源: 互联网 发布时间:2016-12-30
本文导语: 本帖最后由 dongyang626 于 2011-08-23 11:31:22 编辑 简述下问题: 开发板PPC的 MPC8313DRDB, CPU: e300, 公司购置了一块网卡芯片(用pci插槽的) 用交叉编译生成了该芯片在PPC下的驱动 clnkdvr.ko 开发板内核版本 2.6.23 (开发...
用交叉编译生成了该芯片在PPC下的驱动 clnkdvr.ko
开发板内核版本 2.6.23 (开发板自带内核,23让人担心啊..)
通过TFTP将此 .ko模块 down至开发板, 执行 insmod clnkdvr.ko 报错
主要错误为 irq event 18: bogus return value c04c0008
Call Trace:
[c0343e30] [c0007b60] (unreliable)
[c0343e60] [c00408a4]
[c0343e80] [c0040b54]
[c0343eb0] [c0041920]
[c0343ec0] [c00061e0]
[c0343ed0] [c000f71c]
--- Exception: 501[c0343f90] [c0008b40] (unreliable)
[c0343fb0] [c029248c]
[c0343fc0] [c02f797c]
[c0343ff0] [00003438]
handlers:
[]
那个 return value 会发生变化。在编译.ko的芯片源码中 加入printk打印,那个value都会发生变化,我见过的有 14 f 15等等
让芯片的工程师看了错误,他判断中断函数执行是没错的,但返回给kernel的 返回值可能错了,但测试了return IRQ_HANDLED,1,0 都依然报错。
下面附上某一次insmod的打印信息的 一部分(太多了):
lib/modules/2.6.23 # insmod clnkdvr.ko [J
now enter function clnketh_init
Linux Clink Ethernet driver version 2.61.2.0 (June 6, 2011)
now function clnketh_init over
now enter function clnketh_probe_one
mem0: 0x80000000 len:262144
remap mem0 addr: 0xc9900000 len:262144
addr:0xc9930000 data:0xee010124
now enter function clnketh_get_stats
now function clnketh_get_stats over
now enter function Clnk_ETH_Initialize
now enter function HostOS_Alloc
now function HostOS_Alloc over
now enter function HostOS_Alloc
now function HostOS_Alloc over
now enter function HostOS_Alloc
now function HostOS_Alloc over
now enter function HostOS_Alloc
now function HostOS_Alloc over
now enter function ResetDevice
now enter function InitHwRegisters
now function InitHwRegisters over
now enter function InitRxLists
now function InitRxLists over
now enter function InitTxLists
now function InitTxLists over
now enter function VlanReset
now function VlanReset over
now enter function DownloadFirmware
Clink Download Null Firmware success
now function ResetDevice over
now function Clnk_ETH_Initialize over
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now enter function clnketh_pci_config
now function clnketh_pci_config over
irq number: 18
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now function clnketh_probe_one over
/lib/modules/2.6.23 # now run function clnketh_isr
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now CLNK_ETH_CTRL_RD_CLR_INTERRUPT over
now enter function CLnk_ETH_HandleRxInterrupt
now will run socInterruptRxPreProcess function
now will run rcvPacketCallback callback function
Rx Rx
now function Clnk_ETH_HandleRxInterrupt over
now enter function CLnk_ETH_HandleTxInterrupt
now will run socInterruptTxPreProcess function
now will judge the value of rollover
now enter function VlanBcastPkt_Bump
now function VlanBcastPkt_Bump over
now will call sendPacketCallback callback function
Tx Tx
now function Clnk_Eth_HandleTxInterrupt over
now enter function Clnk_ETH_HandleMiscInterrupt
now function Clnk_ETH_HandleMiscInterrupt over
now clnketh_isr function run over
irq event 18: bogus return value 25
Call Trace:
[c0343e30] [c0007b60] (unreliable)
[c0343e60] [c00408a4]
[c0343e80] [c0040b54]
[c0343eb0] [c0041920]
[c0343ec0] [c00061e0]
[c0343ed0] [c000f71c]
--- Exception: 501[c0343f90] [c0008b40] (unreliable)
[c0343fb0] [c029248c]
[c0343fc0] [c02f797c]
[c0343ff0] [00003438]
handlers:
[]
now run function clnketh_isr
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now CLNK_ETH_CTRL_RD_CLR_INTERRUPT over
now enter function CLnk_ETH_HandleRxInterrupt
in Rx:pContext->socInitialized:1,pContext->rxIsOpen:0
in Rx:not socInitialized or not rxIsOpen
now enter function CLnk_ETH_HandleTxInterrupt
in Tx:pContext->socInitialized:1,pContext->txIsOpen:0
in Tx:not Initialized or not txIsOpen
now enter function Clnk_ETH_HandleMiscInterrupt
now function Clnk_ETH_HandleMiscInterrupt over
now clnketh_isr function run over
irq event 18: bogus return value 25
Call Trace:
[c0343d30] [c0007b60] (unreliable)
[c0343d60] [c00408a4]
[c0343d80] [c0040b54]
[c0343db0] [c0041920]
[c0343dc0] [c00061e0]
[c0343dd0] [c000f71c]
--- Exception: 501[c0343e90] [00000004] (unreliable)
[c0343eb0] [c00418bc]
[c0343ec0] [c00061e0]
[c0343ed0] [c000f71c]
--- Exception: 501[c0343f90] [c0008b40] (unreliable)
[c0343fb0] [c029248c]
[c0343fc0] [c02f797c]
[c0343ff0] [00003438]
handlers:
[]
now run function clnketh_isr
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now CLNK_ETH_CTRL_RD_CLR_INTERRUPT over
now enter function CLnk_ETH_HandleRxInterrupt
in Rx:pContext->socInitialized:1,pContext->rxIsOpen:0
in Rx:not socInitialized or not rxIsOpen
now enter function CLnk_ETH_HandleTxInterrupt
in Tx:pContext->socInitialized:1,pContext->txIsOpen:0
in Tx:not Initialized or not txIsOpen
now enter function Clnk_ETH_HandleMiscInterrupt
now function Clnk_ETH_HandleMiscInterrupt over
now clnketh_isr function run over
irq event 18: bogus return value 25
Call Trace:
[c0343d30] [c0007b60] (unreliable)
[c0343d60] [c00408a4]
[c0343d80] [c0040b54]
[c0343db0] [c0041920]
[c0343dc0] [c00061e0]
[c0343dd0] [c000f71c]
--- Exception: 501[c0343e90] [00000004] (unreliable)
[c0343eb0] [c00418bc]
[c0343ec0] [c00061e0]
[c0343ed0] [c000f71c]
--- Exception: 501[c0343f90] [c0008b40] (unreliable)
[c0343fb0] [c029248c]
[c0343fc0] [c02f797c]
[c0343ff0] [00003438]
handlers:
[]
省略一万字...
那个 enter什么函数,是我加在源码里的打印信息,观察都在执行哪些函数。
请高手帮忙指点下这是什么原因引起的,如何解决!!! 小弟被勒令限时解决此问题,可是真的没思路啊。。。拜谢了!
还需要哪些信息判断问题,请回帖提出,一定第一时间附上
|
看你的输出信息,流程貌似如下,
clnketh_init()
clnketh_probe_one()
{
/* 先是 重映射 */
mem0: 0x80000000 len:262144
remap mem0 addr: 0xc9900000 len:262144
addr:0xc9930000 data:0xee010124
clnketh_get_stats()
Clnk_ETH_Initialize()
{
HostOS_Alloc()
HostOS_Alloc()
HostOS_Alloc()
HostOS_Alloc()
ResetDevice()
{
InitHwRegisters()
InitRxLists()
InitTxLists()
VlanReset()
DownloadFirmware()
{
Clink Download Null Firmware success
}
}
}
Clnk_ETH_Control()
Clnk_ETH_Control()
Clnk_ETH_Control()
Clnk_ETH_Control()
Clnk_ETH_Control()
clnketh_pci_config() rxIsOpen:0
in Rx:not socInitialized or not rxIsOpen
now enter function CLnk_ETH_HandleTxInterrupt
in Tx:pContext->socInitialized:1,pContext->txIsOpen:0
in Tx:not Initialized or not txIsOpen
now enter function Clnk_ETH_HandleMiscInterrupt
now function Clnk_ETH_HandleMiscInterrupt over
now clnketh_isr function run over
irq event 18: bogus return value 25
Call Trace:
[c0343d30] [c0007b60] (unreliable)
[c0343d60] [c00408a4]
[c0343d80] [c0040b54]
[c0343db0] [c0041920]
[c0343dc0] [c00061e0]
[c0343dd0] [c000f71c]
--- Exception: 501[c0343e90] [00000004] (unreliable)
[c0343eb0] [c00418bc]
[c0343ec0] [c00061e0]
[c0343ed0] [c000f71c]
--- Exception: 501[c0343f90] [c0008b40] (unreliable)
[c0343fb0] [c029248c]
[c0343fc0] [c02f797c]
[c0343ff0] [00003438]
handlers:
[]
now run function clnketh_isr
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now CLNK_ETH_CTRL_RD_CLR_INTERRUPT over
now enter function CLnk_ETH_HandleRxInterrupt
in Rx:pContext->socInitialized:1,pContext->rxIsOpen:0
in Rx:not socInitialized or not rxIsOpen
now enter function CLnk_ETH_HandleTxInterrupt
in Tx:pContext->socInitialized:1,pContext->txIsOpen:0
in Tx:not Initialized or not txIsOpen
now enter function Clnk_ETH_HandleMiscInterrupt
now function Clnk_ETH_HandleMiscInterrupt over
now clnketh_isr function run over
irq event 18: bogus return value 25
Call Trace:
[c0343d30] [c0007b60] (unreliable)
[c0343d60] [c00408a4]
[c0343d80] [c0040b54]
[c0343db0] [c0041920]
[c0343dc0] [c00061e0]
[c0343dd0] [c000f71c]
--- Exception: 501[c0343e90] [00000004] (unreliable)
[c0343eb0] [c00418bc]
[c0343ec0] [c00061e0]
[c0343ed0] [c000f71c]
--- Exception: 501[c0343f90] [c0008b40] (unreliable)
[c0343fb0] [c029248c]
[c0343fc0] [c02f797c]
[c0343ff0] [00003438]
handlers:
[]
clnketh_init()
clnketh_probe_one()
{
/* 先是 重映射 */
mem0: 0x80000000 len:262144
remap mem0 addr: 0xc9900000 len:262144
addr:0xc9930000 data:0xee010124
clnketh_get_stats()
Clnk_ETH_Initialize()
{
HostOS_Alloc()
HostOS_Alloc()
HostOS_Alloc()
HostOS_Alloc()
ResetDevice()
{
InitHwRegisters()
InitRxLists()
InitTxLists()
VlanReset()
DownloadFirmware()
{
Clink Download Null Firmware success
}
}
}
Clnk_ETH_Control()
Clnk_ETH_Control()
Clnk_ETH_Control()
Clnk_ETH_Control()
Clnk_ETH_Control()
clnketh_pci_config() rxIsOpen:0
in Rx:not socInitialized or not rxIsOpen
now enter function CLnk_ETH_HandleTxInterrupt
in Tx:pContext->socInitialized:1,pContext->txIsOpen:0
in Tx:not Initialized or not txIsOpen
now enter function Clnk_ETH_HandleMiscInterrupt
now function Clnk_ETH_HandleMiscInterrupt over
now clnketh_isr function run over
irq event 18: bogus return value 25
Call Trace:
[c0343d30] [c0007b60] (unreliable)
[c0343d60] [c00408a4]
[c0343d80] [c0040b54]
[c0343db0] [c0041920]
[c0343dc0] [c00061e0]
[c0343dd0] [c000f71c]
--- Exception: 501[c0343e90] [00000004] (unreliable)
[c0343eb0] [c00418bc]
[c0343ec0] [c00061e0]
[c0343ed0] [c000f71c]
--- Exception: 501[c0343f90] [c0008b40] (unreliable)
[c0343fb0] [c029248c]
[c0343fc0] [c02f797c]
[c0343ff0] [00003438]
handlers:
[]
now run function clnketh_isr
now enter function Clnk_ETH_Control
now function Clnk_ETH_Control over
now CLNK_ETH_CTRL_RD_CLR_INTERRUPT over
now enter function CLnk_ETH_HandleRxInterrupt
in Rx:pContext->socInitialized:1,pContext->rxIsOpen:0
in Rx:not socInitialized or not rxIsOpen
now enter function CLnk_ETH_HandleTxInterrupt
in Tx:pContext->socInitialized:1,pContext->txIsOpen:0
in Tx:not Initialized or not txIsOpen
now enter function Clnk_ETH_HandleMiscInterrupt
now function Clnk_ETH_HandleMiscInterrupt over
now clnketh_isr function run over
irq event 18: bogus return value 25
Call Trace:
[c0343d30] [c0007b60] (unreliable)
[c0343d60] [c00408a4]
[c0343d80] [c0040b54]
[c0343db0] [c0041920]
[c0343dc0] [c00061e0]
[c0343dd0] [c000f71c]
--- Exception: 501[c0343e90] [00000004] (unreliable)
[c0343eb0] [c00418bc]
[c0343ec0] [c00061e0]
[c0343ed0] [c000f71c]
--- Exception: 501[c0343f90] [c0008b40] (unreliable)
[c0343fb0] [c029248c]
[c0343fc0] [c02f797c]
[c0343ff0] [00003438]
handlers:
[]
|
楼主有源码,有芯片资料,都不能解决,
光发个打印信息, 估计很难帮到.
重点可能在这句.
irq event 18: bogus return value 25
具体是什么信息,看不出来.
光发个打印信息, 估计很难帮到.
重点可能在这句.
irq event 18: bogus return value 25
具体是什么信息,看不出来.
|
把clnketh_isr这个函数先不实际执行,调试一下。
|
驱动代码都不怎么长吧?而且应该分为好几块啊,初始化,接受数据,发送数据啊,什么的,你先看看初始化行不行,然后再一步一步调试啊.不要一下子全部代码都搞进去.调起来有难度啊.
|
首先像楼上所说,你先看你程序执行到什么地方挂掉的,如果初始化都过不去,下面就别调了,起码你先找到挂掉的地方,是以进中断就挂还是中断返回挂掉,等如果是中断挂再单独看挂掉的信息,我是觉的这样找问题会好点,不然就 像大海捞针呢。
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。