From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: Re: Circular locking (and possible deadlock), when exiting from mplayer -vo fbdev2 Date: Thu, 7 Jun 2012 00:38:12 +0300 Message-ID: <20120606213812.GA13539@mwanda> References: <20120604173702.GZ16584@smp.if.uj.edu.pl> <20120605141014.GB4297@mwanda> <20120605171846.GE5511@smp.if.uj.edu.pl> <4FCE5207.6020501@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by gabe.freedesktop.org (Postfix) with ESMTP id 28770A08EA for ; Wed, 6 Jun 2012 14:38:37 -0700 (PDT) Content-Disposition: inline In-Reply-To: <4FCE5207.6020501@gmx.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org Cc: Witold Baryluk List-Id: dri-devel@lists.freedesktop.org Hi Dri devs, Witold Baryluk reported a lockdep splat to the fbdev list, but apparently that was the wrong list and you people are the right list to handle this. Here is the lockdep splat and Witold's config: http://marc.info/?l=linux-fbdev&m=133883191129462&w=2 I looked into the bug and it turns out there is a lock ordering problem but I'm not sure how to fix it. http://marc.info/?l=linux-fbdev&m=133890563322819&w=2 Cut and pasted from that URL: ----------- The problem is we hold ->mmap_sem when we call fb_release() which takes the info->lock. We take the info->lock in do_fb_ioctl() before we call fb_set_var() which calls drm_fb_helper_set_par() which takes the mode_config.mutex. In drm_mode_getresources() we take the mode_config.mutex() and call put_user() which takes the ->mmap_sem. So on one CPU we are holding the ->mmap_sem and want the info->lock. On another CPU we are holding the info->lock and want the config.mutex. On the other CPU we hold the config.mutex and want the ->mmap_sem. Deadlock. ----------- Could you take a look? regards, dan carpenter