From: Dan Carpenter Subject: re: drm/nouveau: fix locking issues in page flipping paths Date: Wed, 24 Jul 2013 19:08:12 +0300 Message-ID: <20130724160812.GA14862@elgon.mountain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by gabe.freedesktop.org (Postfix) with ESMTP id 51639E5F95 for ; Wed, 24 Jul 2013 09:08:22 -0700 (PDT) Content-Disposition: inline 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: bskeggs@redhat.com Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Hello Ben Skeggs, The patch 060810d7abaa: "drm/nouveau: fix locking issues in page flipping paths" from Jul 8, 2013, leads to the following Smatch warning: "drivers/gpu/drm/nouveau/nouveau_display.c:599 nouveau_crtc_page_flip() error: double unlock 'mutex:&chan->cli->mutex'" drivers/gpu/drm/nouveau/nouveau_display.c 582 ret = nouveau_page_flip_emit(chan, old_bo, new_bo, s, &fence); 583 mutex_unlock(&chan->cli->mutex); ^^^^^^^^^^^^ Unlock. 584 if (ret) 585 goto fail_unreserve; 586 587 /* Update the crtc struct and cleanup */ 588 crtc->fb = fb; 589 590 ttm_eu_fence_buffer_objects(&ticket, &res, fence); 591 if (old_bo != new_bo) 592 nouveau_bo_unpin(old_bo); 593 nouveau_fence_unref(&fence); 594 return 0; 595 596 fail_unreserve: 597 ttm_eu_backoff_reservation(&ticket, &res); 598 fail_unpin: 599 mutex_unlock(&chan->cli->mutex); ^^^^^^^^^^^^ Second unlock. 600 if (old_bo != new_bo) 601 nouveau_bo_unpin(new_bo); This looks simple enough to fix, but the previous two attempts at fixing the locking here have scared me a little. ;) regards, dan carpenter