Failure in re-load module
    Duy-Ky Nguyen 
    duykynguyen at hotmail.com
       
    Thu Oct  9 09:51:35 EST 2008
    
    
  
Hello,
I'm able to load driver and access HW without any problem
In removing the driver using command "rmmod", I have error relating to 
virtual address from ioremap() for physical adress IMMR_BASE = 0xE0000000
Trying to free nonexistent resource <00000000c98a0000-00000000c98affff>
But the driver appears removed when I check with command "lsmod"
However, I'm NOT able to load the driver again due to error
PPC: can't get I/O port address 0xe0000000
insmod: cannot insert `ppc_drv.ko': No such device (-1): No such device
It appaers to me that the memory region was not lreleased successfully
My questions are
1) What is the right sequence in requesting and releasing memory region ?
2) Are the function request_region() and release_region() obsolete in kernel 
2.6 as I have no such problem with kernel 2.4 ?
I have a driver with basic code segment below
///////////////////////////// Start of code
//////////////////////////////////// Init
init:
 if (! request_region(PPC_BASE, PPC_SIZE, DEVICE_NAME)) {
  printk(KERN_INFO "PPC: can't get I/O port address 0x%lx\n", ppc_base);
  return -ENODEV;
 }
 ppc_base = (unsigned long) ioremap(PPC_BASE, PPC_SIZE);
 result = register_chrdev(major, DEVICE_NAME, &ppc_fops);
//////////////////////////// exit
exit:
 unregister_chrdev(major, DEVICE_NAME);
 iounmap((void __iomem *)ppc_base);
 iounmap((void __iomem *)lbc_base);
 release_region(ppc_base,PPC_SIZE);
 release_region(lbc_base,PPC_SIZE);
////////////////////////////// End of code
Thanks so much for your time and help.
Best Regards,
Duy-Ky 
    
    
More information about the Linuxppc-embedded
mailing list