From patchwork Wed Dec 11 10:34:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 3323951 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8CCCFC0D4A for ; Wed, 11 Dec 2013 10:35:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 76590200EA for ; Wed, 11 Dec 2013 10:35:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B87BC20729 for ; Wed, 11 Dec 2013 10:35:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B50F105792; Wed, 11 Dec 2013 02:35:32 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f47.google.com (mail-ee0-f47.google.com [74.125.83.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 4363BFB572 for ; Wed, 11 Dec 2013 02:34:54 -0800 (PST) Received: by mail-ee0-f47.google.com with SMTP id e51so2627621eek.6 for ; Wed, 11 Dec 2013 02:34:53 -0800 (PST) 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=+SbVcdH5Hqkru4w3RgEqKTvjcF8DWVIuCL0Zyzaxz2M=; b=STJrIbP+VzgAU6+43IMKXsevGS9+tLtMIuj6HJFeF0cU4zqn9cwaL2yRByeGOoykyW Qrcfjzaw/aIBCm7XqsFNqHtCHeK97j6V3wc0J2CGYTCSdOC5XgpmA/h+KHm5pXcLW4xi M+wywbHE0cW4Ay8ZG07OzGQ/ELRL5XljG2r38= 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=+SbVcdH5Hqkru4w3RgEqKTvjcF8DWVIuCL0Zyzaxz2M=; b=d+4DfBJA63vULBKY8kFFIK5YwaODqXi3NnlYAxTVADkq38KMu7IKmjDjaasyxBG1OJ kpi+hyQ7ZJKll4TRMWhoXi0Z0FoAc7jTbwWB96L7Ot4R6b7lj2o9HROQNQMqBYvpRIMy 34TES1Y0ulUeKXzPIGYBGTOuUTozjoD1EU0cXlINcka5ms4jJeFvvfUb5X6GgY/PJXbX FcL4zW9LtnkyVY/BZrtgQnWyyfhnD92RQdF40opcpdSplHux/993Vfo2uUEplBasj6tX whJQKzSgo1sL3FoN2K+yVcyeVZ7/lKFEen4CGQgrytF1c0Ia/7ZgdGS9NTQx1ZlSpmny DCUA== X-Gm-Message-State: ALoCoQk1+0qeQxBwxTdq7u5jz6Xz5jMMboKZmiXmCQfMNoo48xRFMVuDYWhcTx7uXwQWQXKGu1YF X-Received: by 10.14.221.193 with SMTP id r41mr984291eep.92.1386758093635; Wed, 11 Dec 2013 02:34:53 -0800 (PST) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id b41sm51932269eef.16.2013.12.11.02.34.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Dec 2013 02:34:52 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 18/50] drm: remove global_mutex locking around agp_init Date: Wed, 11 Dec 2013 11:34:39 +0100 Message-Id: <1386758111-3446-19-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1386758111-3446-1-git-send-email-daniel.vetter@ffwll.ch> References: <1386758111-3446-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.3 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 David Herrmann dutifully moved this locking along when moving the agp_init call out of the generic drm_dev_register into the pci specific load helpers. But afaict there's no need and the reason for that locking has been purely a historical accident - we need the lock around the driver dev node registration to paper over the midlayer init races, and the agp init simply ended up in there. The real fix for all this is of course to delay the dev (and sysfs/debugfs) interface registration until everything is fully set up. Until then stop the cargo-cult locking from spreading and remove the locking. Cc: David Herrmann Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_pci.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 6dfae6b3c0bc..5736aaa7e86c 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -330,9 +330,7 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, if (drm_core_check_feature(dev, DRIVER_MODESET)) pci_set_drvdata(pdev, dev); - mutex_lock(&drm_global_mutex); drm_pci_agp_init(dev); - mutex_unlock(&drm_global_mutex); ret = drm_dev_register(dev, ent->driver_data); if (ret) @@ -350,9 +348,7 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, return 0; err_agp: - mutex_lock(&drm_global_mutex); drm_pci_agp_destroy(dev); - mutex_unlock(&drm_global_mutex); pci_disable_device(pdev); err_free: drm_dev_free(dev);