LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 06-20-2012, 02:50 AM   #1
raju_1234
LQ Newbie
 
Registered: Jun 2012
Posts: 1

Rep: Reputation: Disabled
Unable to read the updated buffer in kernel space from user space


Hello all,

I am using serial flash driver m25p80.c.It has the following functions to read & write respectively.

static int m25p80_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)

I am using mtd_debug utility to write and read the data from serial flash.
The read and write functions calls are as below in the mtd_debug.c

read (fd,buf,size);
write (fd,buf,size);

where fd is my file descriptor pointing mtd device,buf is the buffer into which either data is written or read from it and size is the size of the buffer.

when I am calling write function ,inturn m25p80_write() function in driver is being called and data pointed to by buf pointer is written into flash.

When i am calling the read function after that ,inturn m25p80_read() function is being called and the buffer pointed by the buf(which is a argument to m25p80_read()) is getting updated with red values from the flash.

But when I am trying to print the values of the buffer pointed by buf (which is the argument in my read call)in the mtd_debug.c i am not seeing any updated values that I am seeing in my driver read function.

I am unable to understand the reason that in case of write I am able to pass the data from user space to kernel space but in case of read it is not happening.

I tried a lot to get the reason but could not.
Please help me in solving this issue.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to correctly mmap DMA buffer in user space. dkwan Linux - Kernel 10 07-11-2011 03:17 PM
Shared buffer between user and kernel space bala1486 Linux - General 1 05-04-2010 01:03 AM
Division of Logical Memory Space in to User Space and Kernel Space shreshtha Linux - Newbie 2 01-14-2010 10:59 AM
Accessing User Space Buffer directly in Kernel code akshaynm87 Linux - Kernel 2 06-29-2009 10:39 AM
Accessing a kernel buffer from user space jan_capri Linux - Kernel 2 05-22-2007 12:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 12:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration