lgq1010 发表于 2013-06-05 15:47

求助帖!spi驱动,应用层连续读数据,大概读写5000个字节之后就导致内核异常

本帖最后由 lgq1010 于 2013-06-05 15:47 编辑

static ssize_t s3c24xx_spi_write(struct file *filp,const char __user *buf,size_t count,loff_t *f_ops)
{
        int i;
   
        struct global_mem *mem = filp-> private_data;

//        printk("<1>spi write!,count=%d\n",count);

        if(copy_from_user(mem->dataTx, buf, count))
        {
                printk("no enough memory!\n");
                return -1;
        }         

        for(i=0;i<count;i++)
        {
                writeByte(mem->dataTx);
//                printk("write 0x%02X\n", mem->dataTx);
        }
        return count;
}
这个是驱动层的write函数,连续读写5000个字节就会导致内核异常,内核异常为vmap allocation for size 8192 failed : use vmalloc = <size> to increase size,其中PC指向异常出错的位置就是上面的write函数,应用层中是连续地读写数据,在网上找了也没有明确的解决方案,只能求大神了,用的是2.6.32的内核,micro2440的板子



各位有思路拜托说一下哈,在线等
页: [1]
查看完整版本: 求助帖!spi驱动,应用层连续读数据,大概读写5000个字节之后就导致内核异常