[parisc-linux] Re: [PARISC] fix uninitialized spinlock in HIL keyboard driver

Helge Deller deller at gmx.de
Sat Feb 17 15:21:36 MST 2007


Hi Dimitry,

please see below...

On Saturday 17 February 2007, Kyle McMartin wrote:
> From: Helge Deller <deller at gmx.de>
> 
> - remove some warnings for PARISC part of the driver
> - annotate hphilkeyb_keycode[] array as __read_mostly
> 
> Signed-off-by: Helge Deller <deller at gmx.de>
> Signed-off-by: Kyle McMartin <kyle at parisc-linux.org>
> ---
>  drivers/input/keyboard/hilkbd.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c
> index c2264a6..585f0a7 100644
> --- a/drivers/input/keyboard/hilkbd.c
> +++ b/drivers/input/keyboard/hilkbd.c
> @@ -3,7 +3,7 @@
>   *
>   *  Copyright (C) 1998 Philip Blundell <philb at gnu.org>
>   *  Copyright (C) 1999 Matthew Wilcox <willy at bofh.ai>
> - *  Copyright (C) 1999-2006 Helge Deller <deller at gmx.de>
> + *  Copyright (C) 1999-2007 Helge Deller <deller at gmx.de>
>   *
>   *  Very basic HP Human Interface Loop (HIL) driver.
>   *  This driver handles the keyboard on HP300 (m68k) and on some
> @@ -89,7 +89,7 @@ MODULE_LICENSE("GPL v2");
>  #define	HIL_READKBDSADR	 	0xF9
>  #define	HIL_WRITEKBDSADR 	0xE9
>  
> -static unsigned int hphilkeyb_keycode[HIL_KEYCODES_SET1_TBLSIZE] =
> +static unsigned int hphilkeyb_keycode[HIL_KEYCODES_SET1_TBLSIZE] __read_mostly =
>  	{ HIL_KEYCODES_SET1 };
>  
>  /* HIL structure */
> @@ -211,6 +211,7 @@ hil_keyb_init(void)
>  		return -ENODEV; /* already initialized */
>  	}
>  
> +	spin_lock_init(&hil_dev.lock);
>  	hil_dev.dev = input_allocate_device();
>  	if (!hil_dev.dev)
>  		return -ENOMEM;

from here....

> @@ -295,7 +296,9 @@ err3:
>  	free_irq(HIL_IRQ, hil_dev.dev_id);
>  err2:
>  	release_region(HILBASE + HIL_DATA, 2);
> +#if defined(CONFIG_HP300)
>  err1:
> +#endif
>  	input_free_device(hil_dev.dev);
>  	hil_dev.dev = NULL;
>  	return err;

Can you drop this ^^ piece of this patch ?
Cyrill V. Gorcunov's (<gorcunov at gmail.com>) HP300 patches from a few days ago are more correct since they include the release_region() call.

Or, if you want, I can resend this whole patch against your input-tree ?
Just let me know...

Helge


> @@ -307,7 +310,7 @@ static int __init
>  hil_init_chip(struct parisc_device *dev)
>  {
>  	if (!dev->irq) {
> -		printk(KERN_WARNING "HIL: IRQ not found for HIL bus at 0x%08lx\n", dev->hpa.start);
> +		printk(KERN_WARNING "HIL: IRQ not found for HIL bus at 0x%08lux\n", (unsigned long)dev->hpa.start);
>  		return -ENODEV;
>  	}
>  



More information about the parisc-linux mailing list