From patchwork Thu Jul 9 21:32:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 6760011 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 69A699F319 for ; Thu, 9 Jul 2015 21:30:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88D6920792 for ; Thu, 9 Jul 2015 21:30:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8819B207A0 for ; Thu, 9 Jul 2015 21:30:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A6E0B7A097; Thu, 9 Jul 2015 14:30:35 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by gabe.freedesktop.org (Postfix) with ESMTPS id E7B6D7A091 for ; Thu, 9 Jul 2015 14:30:32 -0700 (PDT) Received: by widjy10 with SMTP id jy10so255690395wid.1 for ; Thu, 09 Jul 2015 14:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rOLOtodwnbO+RxK4YvfBSMJ+x6Q0sM8xVY6xTPXqDOc=; b=cqSyY+JusjVRqZDhyjS2Yoyvn8YUbbHwE+Wim8iaDbHOnTXDi0Ns4ZW4KxCJJFcFyb 1h1JVRGy1fJozaF0vHIOiqrSLY2nM/EegTfi49yYgm8JiTVvCamldCXHFmGyY7Sk4gIP jekyxvq+CychSfJ9UaPFVkpwuBn1n7X0aueGc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rOLOtodwnbO+RxK4YvfBSMJ+x6Q0sM8xVY6xTPXqDOc=; b=aQHUcUteot5PxaQI9R21GICsbyc2i0dXmEfopnauDupkt4IS3T5+iGfzUSaJgCktSY UBsBhVz0j+orKGkKXOeVRFOa0j/vORTolYkng8nT8rQRp2LMQ+gA3i0Wg8BydhNkrX+h FrqRxbHnhDYpF/zSY+ZSbpUZpnIew2e6BbL+FSOcUdSqNJmOhMBqoD6GmeMQXVMCda5c 43S0dMR7i0qBaE522MwVEEjBO8NBzFCHeDwUbmnA4H76xQdOuSfm4zK9IXqnmiXLfwMn 4rFIfEXrKkcf4bupD0vlAtsZ+G2nYsqfMXq0pbNs4k7ArtZ++enf9gexag8+4flUF6ic j/FQ== X-Gm-Message-State: ALoCoQkFbA94qDc1WLZpsSiUWId5u8J0O5m59MQyotaid5bzNkd+Nym5wkAWcvo76Zzw5XuiEjK3 X-Received: by 10.180.11.68 with SMTP id o4mr31533497wib.10.1436477431748; Thu, 09 Jul 2015 14:30:31 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id j6sm3004128wix.5.2015.07.09.14.30.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 14:30:30 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 12/18] drm/nouveau: Don't take dev->struct_mutex in fbcon init Date: Thu, 9 Jul 2015 23:32:44 +0200 Message-Id: <1436477570-4936-13-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436477570-4936-1-git-send-email-daniel.vetter@ffwll.ch> References: <1436477570-4936-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Intel Graphics Development , Ben Skeggs , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It doesn't protect anything at all. fbdev helper state is all protected by modeset locks, and nouveau bo state is taken care of by ttm. There's also nothing else grabbing struct_mutex that might need to coordinate with this code. Also this is driver load code, no one can get at the device yet anyway so locking is fairly futile. There's also no drm_gem_object_unreference that would now suddenly need the _unlocked variant. Cc: Ben Skeggs Signed-off-by: Daniel Vetter Reviewed-by: Thierry Reding --- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 6751553abe4a..89691ee48277 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -363,12 +363,10 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, } } - mutex_lock(&dev->struct_mutex); - info = framebuffer_alloc(0, &pdev->dev); if (!info) { ret = -ENOMEM; - goto out_unlock; + goto out_unmap; } info->skip_vt_switch = 1; @@ -376,7 +374,7 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, if (ret) { ret = -ENOMEM; framebuffer_release(info); - goto out_unlock; + goto out_unmap; } info->par = fbcon; @@ -411,8 +409,6 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ - mutex_unlock(&dev->struct_mutex); - if (chan) nouveau_fbcon_accel_init(dev); nouveau_fbcon_zfill(dev, fbcon); @@ -425,8 +421,7 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, vga_switcheroo_client_fb_set(dev->pdev, info); return 0; -out_unlock: - mutex_unlock(&dev->struct_mutex); +out_unmap: if (chan) nouveau_bo_vma_del(nvbo, &fbcon->nouveau_fb.vma); nouveau_bo_unmap(nvbo);