staging: tidspbridge: protect dmm_map properly
authorFelipe Contreras <felipe.contreras@nokia.com>
Sat, 12 Mar 2011 00:29:06 +0000 (18:29 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Mar 2011 19:50:16 +0000 (12:50 -0700)
commit8274b24b773d6433c461d38944cacc8eb8e574af
tree39d86e739df54a3129965099249431dd26c90ad7
parent15750d67097c3c7957fbea4a5413994d5bda1de9
staging: tidspbridge: protect dmm_map properly

commit ab42abf33a3efdf754710a0a513c00c40854cd61 upstream.

We need to protect not only the dmm_map list, but the individual
map_obj's, otherwise, we might be building the scatter-gather list with
garbage. So, use the existing proc_lock for that.

I observed race conditions which caused kernel panics while running
stress tests, also, Tuomas Kulve found it happening quite often in
Gumstix Over. This patch fixes those.

Cc: Tuomas Kulve <tuomas@kulve.fi>
Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/tidspbridge/rmgr/proc.c