From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by ozlabs.org (Postfix) with ESMTP id 5356A67ED6 for ; Thu, 11 Aug 2005 13:02:57 +1000 (EST) Received: from ep_ms13_bk (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0IL1009S4EO6G3@mailout1.samsung.com> for linuxppc-dev@ozlabs.org; Thu, 11 Aug 2005 11:52:54 +0900 (KST) Received: from ep_spt01 (ms13.samsung.com [203.254.225.109]) by ms13.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0IL100L2HEO6NG@ms13.samsung.com> for linuxppc-dev@ozlabs.org; Thu, 11 Aug 2005 11:52:54 +0900 (KST) Date: Thu, 11 Aug 2005 02:52:47 +0000 (GMT) From: V MURAHARI To: "linuxppc-dev@ozlabs.org" Message-id: <0IL100L2IEO6NG@ms13.samsung.com> MIME-version: 1.0 Content-type: text/html; charset=windows-1252 Subject: copy_from_user problem Reply-To: murahari@samsung.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Samsung Enterprise Portal mySingle

Hello,

I am working on a character driver for reading and writing the registers to FPGA in our system.

I am using driver ioctl to read/write to these registers of FPGA. As the function call to the ioctl is being made, the printk trace shows that the call goes to switch->copy_from_user. As soon as the call is made to copy_from_user, the kernel crashes

Can someone help me with this problem?

 

***************************************************************************************************

 Unhandled kernel unaligned access in unaligned.c::emulate_load_store_insn, line 483

:

$0 : 00000000 10001f00 8fbf0034 02a01021 801157a0 8fe8e000 10001f00 ffff00ff

$8 : 8fe8ffe0 00001f00 00000000 00000003 74652053 8fe9fed8 0000000a 50434942

$16: 10001f01 00000001 801157a0 0000000f 8fe8fee8 00000104 00000000 0000000f

$24: 00000000 2ac0fdb0                   8fe8e000 8fe8fe38 00000001 8012010c

Hi : 00000000

Lo : 00000000

epc  : 8011f774    Tainted: GF

Status: 10001f02

Cause : 00800014

Process rsgbm (pid: 317, stackpage=8fe8e000)

Stack:    802d920a 0000000a 10001f01 0000003c 10001f01 0000003c 8012010c

 80120104 caa8f356 8fe82008 8fe82000 0000000f 00000000 7fff7d00 7fff7d00

 0000c001 00000003 10012808 ffffffff caa8e548 00004000 8fe9e272 00000150

 7fff7d00 ffffffea 00000000 00000240 8fe82000 00000000 00000001 00000001

 7ebff310 00000000 0000000f 8fef24e0 00000004 7ebff3e8 00000000 0000002e

 80159c6c ...

Call Trace:   [<8012010c>] [<80120104>] [<caa8f356>] [<caa8e548>] [<80159c6c>]

 [<8010a5c4>] [<80271dc4>]

 

Code: 8c820004  24110001  ac430000 <ac620004> ac800000  ac800004  ac800000  ac800004

  8f820004

 

Unit Fault Handler !!! (INDEX=10)

**************************************************************************************************

int

chr1_ioctl(struct inode *ino, struct file *filp, unsigned int cmd,

      unsigned long arg)

{

   int ret = 0;

   n2_debug_rw_reg *dw;

 

   switch(cmd)

   {

      case IOCTL_WIN_DEBUG_READ_CODE:

      {

   n2_debug_rw_reg test;

        printk("%s %d\n", current->comm, current->pid);

        printk("%lx\n", arg);

        copy_from_user(&test, (n2_debug_rw_reg*)arg, sizeof(n2_debug_rw_reg));

        printk("%lx %lx\n", ((n2_debug_rw_reg*)arg)->data, ((n2_debug_rw_reg*)arg)->

addr);

         }

}

}

 

Thanks & Regards,

--Murahari