免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4035 | 回复: 6
打印 上一主题 下一主题

Unable to handle kernel paging request at virtual address 565f4453 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-20 17:17 |只看该作者 |倒序浏览
我在编写驱动的时候,在模块加载函数里测试两个函数
Psam_Reset函数正常执行,一执行到Psam_Command_Send(send1,5,comresp);函数就出现oops
tatic int __init Psam_init(void)
{
        int result;
        dev_t devno=MKDEV(ippsam_major,0);

        if(ippsam_major)
                result=register_chrdev_region(devno,1,"ippsam");
        else
                {
                        result=alloc_chrdev_region(&devno,0,1,"ippsam");
                        ippsam_major=MAJOR(devno);
                }
        if(result<0)
                return result;
        Psam_setup_cdev();
        Psam_Hw_init();
        printk(KERN_ALERT"hello psam\n");

        
        Psam_Reset();
        char send1[]={0x00,0x84,0x00,0x00,0x04};

        int i;
        uch8*lenr;
        uch8 comresp[100];
        Psam_Command_Send(send1,5,comresp);
        
//        CPU_Cmd(5,send1,lenr,comresp);
        for(i=0;i<*lenr;i++)
                printk(KERN_ALERT"data is %x\n",comresp);
        return 0;
}

论坛徽章:
0
2 [报告]
发表于 2009-05-20 17:17 |只看该作者
Unable to handle kernel paging request at virtual address 565f4453
pgd = c1ee4000
[565f4453] *pgd=00000000
Internal error: Oops: 1a000805 [#1]
Modules linked in: ippsam
CPU: 0
PC is at memcpy+0xd4/0x29c
LR is at __init_begin+0x3fff8000/0x2c
pc : [<c01043f4>]    lr : [<00000000>]    Not tainted
sp : c1dafef0  ip : 00000001  fp : c1da6454
r10: beb7de84  r9 : c1dae000  r8 : c0023d04
r7 : 00000000  r6 : c0231e04  r5 : 5f303031  r4 : 565f4453
r3 : c0230ae4  r2 : 00000000  r1 : bf000491  r0 : 565f4453
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  Segment user
Control: 217F  Table: 31EE4015  DAC: 00000015
Process insmod (pid: 25, stack limit = 0xc1dae19
Stack: (0xc1dafef0 to 0xc1db0000)
fee0:                                     565f4453 565f4453 bf002104 0f200000
ff00: c002a318 00000000 c1ee4000 00000000 00000002 ffffffeb c0344040 c000af3c
ff20: c001e1e0 c001e214 00000002 c0344040 c1daff74 c1daff40 c002a144 c0108d7c
ff40: c1e78340 00000000 00000000 ffffffff beb7de8c 001de320 00000000 000015b6
ff60: 001de320 c0231e04 001de330 c0231e14 bf000bc0 c0231e04 c1daffa4 c1daff88
ff80: c005147c bf002010 000015b6 000000c2 beb7de84 00000080 00000000 c1daffa8
ffa0: c0023b60 c0051324 000000c2 beb7de84 00900080 001de330 000015b6 001de320
ffc0: 000015b6 000000c2 beb7de84 00000000 beb7df49 00000061 beb7de84 001b2568
ffe0: beb7dabc beb7dab0 000191e4 00119730 a0000010 00900080 ffffffff ffffffff
Backtrace: frame pointer underflow
Backtrace aborted due to bad frame pointer <c1da6454>
Code: e4d1e001 c4c03001 a4c04001 e052200c (e4c0e001)
Segmentation fault

论坛徽章:
0
3 [报告]
发表于 2009-05-20 17:19 |只看该作者
static void Psam_Command_Send(char*com,int len,uch8*resp)
{
        int stat;
        int i=0;
        uch8 *back;
        uch8 lenr=0;

        back=resp;
        for(i=0; i<5; i++)
                {
                        writel(com,SMC0_TX_V);
                }
        writel(5,SMC0_TX_TRIG_V);
        stat = readl(SMC0_STATUS_V);
         
            while ((stat & 0x40) == 0x40)                                   
            {
            for (i=0;i<10;i++) ;
                    stat = readl(SMC0_STATUS_V);
         }
        while((stat& 0x4 != 0x4                                                         
        {
                if ((stat & 0x40) != 0x40) {
                        back[lenr]= readl(SMC0_RX_V);
                        lenr++;               
                }
                stat = readl(SMC0_STATUS_V);
                        
        }
        for(i=0;i<lenr;i++)
                printk(KERN_ALERT"data is %x\n",back);
        //        resp=receive_data;


        
}

论坛徽章:
0
4 [报告]
发表于 2009-05-20 23:13 |只看该作者
这种coredump信息?怎么没有stack trace?

论坛徽章:
0
5 [报告]
发表于 2009-05-22 13:11 |只看该作者
原帖由 emmoblin 于 2009-5-20 23:13 发表
这种coredump信息?怎么没有stack trace?




“Backtrace aborted due to bad frame pointer <c1da6454>”

论坛徽章:
0
6 [报告]
发表于 2009-05-22 16:40 |只看该作者

re,指针越界


while(stat& 0x4 != 0x4  )  {
        if ((stat & 0x40) != 0x40) {
                        back[lenr]= readl(SMC0_RX_V);
                        lenr++;               
         }
        stat = readl(SMC0_STATUS_V);                       
}



  back[lenr]可能越界,
static void Psam_Command_Send(char*com,int len,uch8*resp)
int len 应该是用来限定长度的吧,函数了怎么没有用起来?

[ 本帖最后由 tonylulu 于 2009-5-22 17:16 编辑 ]

论坛徽章:
0
7 [报告]
发表于 2009-05-23 09:46 |只看该作者
原帖由 tonylulu 于 2009-5-22 16:40 发表



  back[lenr]可能越界,
static void Psam_Command_Send(char*com,int len,uch8*resp)
int len 应该是用来限定长度的吧,函数了怎么没有用起来?




已经解决了,在内核源码版有比较详细的说明
len 有用起来啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP