| title: | RE Problem in input device module creation |
|
Hi Russell
thanks for your inputs and reviews
the kernel page fault problem on re-insertion a module is solved by removing
input_free_device after unregister.
Now I am facing anther problem,
when I boot system from ramdisk, module works fine and no memory leaks but
when I boot from NFS root there are memory leaks for each insmod/rmmod
operation , This is not my new module problem becasue if I insert/remove
other module "evdev.ko" still memory reduces. I observed after first insmod
free memory reduces... fine ...........after removing the inserted module..
memory further reduces
what could be the problem?
Regards..
Prafulla . .
-----Original Message-----
From: Russell King - ARM Linux [ rel="nofollow" mailto:linux@xxxxxxxxxxxxxxxx mailto:linux@xxxxxxxxxxxxxxxx ]
Sent: Friday, July 07, 2006 10:20 PM
To: Prafulla WADASKAR
Cc: linux-arm@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Problem in input device module creation
On Fri, Jul 07, 2006 at 09:27:23AM +0530, Prafulla WADASKAR wrote:
/* generic constants */
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
Not required.
/*function declarations h/w dependent*/
static int __init nomadik_kp_init_keypad(void);
Only referenced after defined - prototype not required.
static int __init nomadik_kp_init_key_hardware(void);
Okay.
static int __exit nomadik_kp_exit_key_hardware(void);
static void nomadik_kp_key_scan(void);
Only referenced after defined - prototype not required.
static irqreturn_t nomadik_kp_intrhnadler(int pin, void *dev_id,
struct pt_regs *kpregs);
Typo? (hnadler should be handler?)
static int nomadik_kp_ghostkey_detect(int row);
/*function declarations h/w independent*/
static void nomadik_kp_timer_key_press(unsigned long data); static
void nomadik_kp_timer_key_release(unsigned long data);
Okay.
static int __init nomadik_kp_init(void);
static void __exit nomadik_kp_exit(void);
Only referenced after defined - prototype not required.
/* Initialize keypad interrupt handler */
kp- int_handle.handler = nomadik_kp_intrhnadler;
kp- int_handle.dev_name = KEYPAD_NAME;
kp- int_handle.dev_id = 0; //nomadik_kp_intrhnadler;
err = nomadik_gpio_allocatepin(KEYPAD_IRQ,&kp- int_handle);
You allocate the pin using kp- int_handle.
/* De-initialize keypad interrupt handler */
nomadik_gpio_intrdisable(KEYPAD_IRQ);
err=nomadik_gpio_deallocatepin(KEYPAD_IRQ,kp- int_handle.dev_name);
But you unregister it using kp- int_handle.dev_name - is that correct?
static void __exit nomadik_kp_exit(void)
{
keypad_t* kp = &kpad;
dbg1("nomadik_kp_exit started");
/*Frees allocated keypad interrupt if any*/
nomadik_kp_exit_key_hardware();
/* delite keypad timer functions if any */
del_timer(&kp- timer_event);
This should be del_timer_sync().
input_unregister_device(kp- inp_dev);
/* if this enabled then re-insmod does not work, gives kernel page
fault
input_free_device(kp- inp_dev); */
Whats the page fault you get here? This could be related to your problem.
(please show full oops dump.)
-------------------------------------------------------------------
List admin: rel="nofollow" lists.arm.linux.org.uk/mailman/listinfo/linux-arm lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: rel="nofollow" www.arm.linux.org.uk/mailinglists/faq.php www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: rel="nofollow" www.arm.linux.org.uk/mailinglists/etiquette.php www.arm.linux.org.uk/mailinglists/etiquette.php
|