From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter 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> References: <1386758111-3446-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: 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) In-Reply-To: <1386758111-3446-1-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: DRI Development Cc: Daniel Vetter List-Id: dri-devel@lists.freedesktop.org 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); -- 1.8.4.3