]> Pileus Git - ~andy/linux/commitdiff
drm: remove global_mutex locking around agp_init
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 11 Dec 2013 10:34:39 +0000 (11:34 +0100)
committerDave Airlie <airlied@redhat.com>
Wed, 18 Dec 2013 01:27:29 +0000 (11:27 +1000)
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 <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_pci.c

index 6dfae6b3c0bc6ccb46004845dac3ec6417101996..5736aaa7e86cb069d30fd458b5842fd42defae17 100644 (file)
@@ -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);