Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-03-2015, 08:58 AM   #1
Abdul Basit
LQ Newbie
Registered: Apr 2015
Posts: 10

Rep: Reputation: Disabled
__raw_writel is not working in procfs write?

I am writing a kernel module in which Procfs is created. In write function of procfs I write to a reg using __raw_writel() and then I read back using __raw_readl() but I am getting 0. My device base address is 0xaca10000.

void* virtaddr;
struct proc_dir_entry *proc_file_entry;

ssize_t write_proc( struct file *filp, const char __user *buff,

                        unsigned long len, void *data )


while(__raw_readl(virtaddr) ! = 8601)


static const struct file_operations proc_file_fops = {
 .owner = THIS_MODULE,
 .write = write_callback,
 .read  = read_callback,

int __init init_module(void){

  virtptr = ioremap_nocache(0xaca10000,4096);
  return -ENOMEM;
    proc_file_entry = proc_create("proc_file_name", 0, NULL,     &proc_file_fops);
  if(proc_file_entry == NULL)
   return -ENOMEM;
  return 0;


kernel module, linux

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
could someone help me with the procfs ?? hemanth1989 Linux - Kernel 5 04-21-2014 05:17 PM
Linux Driver - how to read/write a block or character device in kernel space (procfs) stybi Linux - Kernel 1 01-27-2011 07:26 AM
procfs read and write doubts... Devika99 Programming 2 11-30-2009 08:08 AM
procfs nullpt *BSD 1 10-25-2003 04:30 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:20 AM.

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