From: Gu Zheng Date: Thu, 31 Oct 2013 10:33:01 +0000 (+0800) Subject: staging/olpc_docn: reorder the lock sequence to avoid potential dead lock X-Git-Tag: upstream/snapshot3+hdmi~3491^2~783^2~75 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc0524b0986f994693f06a00c8de1c0469fd7086;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git staging/olpc_docn: reorder the lock sequence to avoid potential dead lock The lock sequence of dcon_blank_fb(fb_info->lock ---> console_lock) is against with the one of console_callback(console_lock ---> fb_info->lock), it'll lead to a potential dead lock, so reorder the lock sequence of dcon_blank_fb to avoid the potential dead lock. Signed-off-by: Gu Zheng Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 92b0289..26b4ec5 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c @@ -255,17 +255,19 @@ static bool dcon_blank_fb(struct dcon_priv *dcon, bool blank) { int err; + console_lock(); if (!lock_fb_info(dcon->fbinfo)) { + console_unlock(); dev_err(&dcon->client->dev, "unable to lock framebuffer\n"); return false; } - console_lock(); + dcon->ignore_fb_events = true; err = fb_blank(dcon->fbinfo, blank ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK); dcon->ignore_fb_events = false; - console_unlock(); unlock_fb_info(dcon->fbinfo); + console_unlock(); if (err) { dev_err(&dcon->client->dev, "couldn't %sblank framebuffer\n",