[lkml]   [2012]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/3] staging:panel: Rewrite for fixing synchronization issues
On Thu, Jun 28, 2012 at 10:57:29PM +0200, Zoltan Kelemen wrote:

> Partial rewrite of panel driver to make it more robust. The old code contains
> problems potentially leading to kernel oops, deadlocks and memory leaks.
> The patch contains the following changes:
> * Handle asynchronous attach/detach to/from parport.
> * Proper synchronization of multiple opens to same device.
> * Proper disabling of softirqs when locking pprt from user context.
> * Replaced interruptible_sleep_on in keypad_read to avoid race conditions.
> * Changed to del_timer_sync to make sure timer function finishes before
> unloading module.
> * Added owner to file_operations to avoid module being unloaded with dangling
> opens.
> * Check status of user-mode memory write in keypad_read.
> * Check for and handle errors in keypad_init.
> * Properly free memory for logical_inputs to avoid memory leak on unload.

Gar... Don't do this. :/ Each bullet point here should be a
separate patch. Please break it apart and resend.

Put the white space changes and the declaration reshuffles in their
own patch.

Do not create lock_pprt() and unlock_pprt() functions. It doesn't
save any lines of code. It means that Sparse is unable check for
locking bugs. It hides information pointlessly so it's considered
bad style. The comment is nice though and that should go next to
the declaration of the "pprt_lock" spinlock.

dan carpenter

 \ /
  Last update: 2012-06-29 10:01    [W:0.058 / U:3.104 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site