From: Andre Detsch Date: Wed, 19 Sep 2007 04:38:12 +0000 (+1000) Subject: [POWERPC] spufs: Fix race condition on gang->aff_ref_spu X-Git-Tag: v2.6.24-rc1~1450^2~227 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36ddbb1380f282b4280c57efdb646dd8647a789f;p=pandora-kernel.git [POWERPC] spufs: Fix race condition on gang->aff_ref_spu Affinity reference point location (gang->aff_ref_spu) is reset when the whole gang is descheduled. However, the last member of a gang can be descheduled while we are trying to schedule another member of the gang. This was leading to a race condition, and the code was using gang->aff_ref_spu in an unsafe manner. By holding the gang->aff_mutex a little bit longer, and increment gang->aff_sched_count (which controls when gang->aff_ref_spu should be reset) a little bit earlier, the problem is fixed. Signed-off-by: Andre Detsch Signed-off-by: Jeremy Kerr Signed-off-by: Paul Mackerras --- Reading git-diff-tree failed