dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH 02/51] drm/i915: Don't clear drvdata in ->release
Date: Fri, 21 Feb 2020 22:02:30 +0100	[thread overview]
Message-ID: <20200221210319.2245170-3-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20200221210319.2245170-1-daniel.vetter@ffwll.ch>

For two reasons:

- The driver core clears this already for us after we're unloaded in
  __device_release_driver().

- It's way too late, the drm_device ->release callback might massively
  outlive the underlying physical device, since a drm_device can't be
  kept alive by open drm_file or well really anything else userspace
  is still hanging onto. So if we clear this ourselves, we should
  clear it in the pci ->remove callback, not in the drm_device
  ->relase callback.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 759d333448e1..8b8a9c9a9b2a 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1391,9 +1391,6 @@ static void i915_driver_destroy(struct drm_i915_private *i915)
 
 	drm_dev_fini(&i915->drm);
 	kfree(i915);
-
-	/* And make sure we never chase our dangling pointer from pci_dev */
-	pci_set_drvdata(pdev, NULL);
 }
 
 /**
-- 
2.24.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-02-21 21:03 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 21:02 [PATCH 00/51] drm managed resources, v2 Daniel Vetter
2020-02-21 21:02 ` [PATCH 01/51] mm/sl[uo]b: export __kmalloc_track(_node)_caller Daniel Vetter
2020-02-21 21:02 ` Daniel Vetter [this message]
2020-02-21 21:36   ` [PATCH 02/51] drm/i915: Don't clear drvdata in ->release Chris Wilson
2020-02-22  9:48     ` Daniel Vetter
2020-02-22  9:50       ` Daniel Vetter
2020-02-21 21:02 ` [PATCH 03/51] drm: add managed resources tied to drm_device Daniel Vetter
2020-02-25 10:27   ` Andrzej Hajda
2020-02-25 15:03     ` Daniel Vetter
2020-02-26  9:21       ` Andrzej Hajda
2020-02-26 10:21         ` Daniel Vetter
2020-02-26 14:38           ` Andrzej Hajda
2020-02-21 21:02 ` [PATCH 04/51] drm: Set final_kfree in drm_dev_alloc Daniel Vetter
2020-02-21 21:02 ` [PATCH 05/51] drm/mipi_dbi: Use drmm_add_final_kfree in all drivers Daniel Vetter
2020-02-21 21:02 ` [PATCH 06/51] drm/udl: Use drmm_add_final_kfree Daniel Vetter
2020-02-21 21:02 ` [PATCH 07/51] drm/qxl: " Daniel Vetter
2020-02-21 21:02 ` [PATCH 08/51] drm/i915: " Daniel Vetter
2020-02-21 21:02 ` [PATCH 09/51] drm/cirrus: " Daniel Vetter
2020-02-21 21:02 ` [PATCH 10/51] drm/v3d: " Daniel Vetter
2020-02-21 21:02 ` [PATCH 11/51] drm/tidss: " Daniel Vetter
2020-02-23 18:50   ` Jyri Sarha
2020-02-21 21:02 ` [PATCH 12/51] drm/mcde: " Daniel Vetter
2020-02-21 21:02 ` [PATCH 13/51] drm/vgem: " Daniel Vetter
2020-02-21 21:02 ` [PATCH 14/51] drm/vkms: " Daniel Vetter
2020-02-21 21:02 ` [PATCH 15/51] drm/repaper: " Daniel Vetter
2020-02-21 21:02 ` [PATCH 16/51] drm/inigenic: " Daniel Vetter
2020-02-21 21:02 ` [PATCH 17/51] drm/gm12u320: " Daniel Vetter
2020-02-22 11:36   ` Hans de Goede
2020-02-21 21:02 ` [PATCH 18/51] drm/<drivers>: " Daniel Vetter
2020-02-22 15:16   ` Russell King - ARM Linux admin
2020-02-27 17:46     ` Daniel Vetter
2020-02-21 21:02 ` [PATCH 19/51] drm: Cleanups after drmm_add_final_kfree rollout Daniel Vetter
2020-02-21 21:02 ` [PATCH 20/51] drm: Handle dev->unique with drmm_ Daniel Vetter
2020-02-21 21:02 ` [PATCH 21/51] drm: Use drmm_ for drm_dev_init cleanup Daniel Vetter
2020-02-21 21:02 ` [PATCH 22/51] drm: manage drm_minor cleanup with drmm_ Daniel Vetter
2020-02-21 21:02 ` [PATCH 23/51] drm: Manage drm_gem_init " Daniel Vetter
2020-02-21 21:02 ` [PATCH 24/51] drm: Manage drm_vblank_cleanup " Daniel Vetter
2020-02-21 21:02 ` [PATCH 25/51] drm: Garbage collect drm_dev_fini Daniel Vetter
2020-02-21 21:02 ` [PATCH 26/51] drm: Manage drm_mode_config_init with drmm_ Daniel Vetter
2020-02-23 15:17   ` Noralf Trønnes
2020-02-21 21:02 ` [PATCH 27/51] drm/bochs: Remove leftover drm_atomic_helper_shutdown Daniel Vetter
2020-02-21 21:02 ` [PATCH 28/51] drm/bochs: Drop explicit drm_mode_config_cleanup Daniel Vetter
2020-02-21 21:02 ` [PATCH 29/51] drm/cirrus: Drop explicit drm_mode_config_cleanup call Daniel Vetter
2020-02-21 21:02 ` [PATCH 30/51] drm/cirrus: Fully embrace devm_ Daniel Vetter
2020-02-21 21:02 ` [PATCH 31/51] drm/ingenic: Drop explicit drm_mode_config_cleanup call Daniel Vetter
2020-02-21 21:03 ` [PATCH 32/51] drm/mcde: " Daniel Vetter
2020-02-21 21:03 ` [PATCH 33/51] drm/mcde: More devm_drm_dev_init Daniel Vetter
2020-02-21 21:03 ` [PATCH 34/51] drm/meson: Drop explicit drm_mode_config_cleanup call Daniel Vetter
2020-02-21 21:03 ` [PATCH 35/51] drm/pl111: " Daniel Vetter
2020-02-21 21:03 ` [PATCH 36/51] drm/rcar-du: " Daniel Vetter
2020-02-21 21:03 ` [PATCH 37/51] drm/rockchip: " Daniel Vetter
2020-02-24 19:13   ` Francesco Lavra
2020-02-24 20:37     ` Daniel Vetter
2020-02-21 21:03 ` [PATCH 38/51] drm/stm: " Daniel Vetter
2020-02-21 21:03 ` [PATCH 39/51] drm/shmob: " Daniel Vetter
2020-02-21 21:03 ` [PATCH 40/51] drm/mtk: " Daniel Vetter
2020-02-21 21:03 ` [PATCH 41/51] drm/tidss: " Daniel Vetter
2020-02-23 18:50   ` Jyri Sarha
2020-02-21 21:03 ` [PATCH 42/51] drm/gm12u320: More drmm_ Daniel Vetter
2020-02-22 12:10   ` Hans de Goede
2020-02-21 21:03 ` [PATCH 43/51] drm/gm12u320: Use devm_drm_dev_init Daniel Vetter
2020-02-22 12:10   ` Hans de Goede
2020-02-21 21:03 ` [PATCH 44/51] drm/gm12u320: Use helpers for shutdown/suspend/resume Daniel Vetter
2020-02-22 12:10   ` Hans de Goede
2020-02-21 21:03 ` [PATCH 45/51] drm/gm12u320: Simplify upload work Daniel Vetter
2020-02-22 12:30   ` Hans de Goede
2020-02-22 13:00     ` Daniel Vetter
2020-02-21 21:03 ` [PATCH 46/51] drm/repaper: Drop explicit drm_mode_config_cleanup call Daniel Vetter
2020-02-21 21:03 ` [PATCH 47/51] drm/mipi-dbi: Move drm_mode_config_init into mipi library Daniel Vetter
2020-02-21 21:03 ` [PATCH 48/51] drm/mipi-dbi: Drop explicit drm_mode_config_cleanup call Daniel Vetter
2020-02-21 21:03 ` [PATCH 49/51] drm/udl: " Daniel Vetter
2020-02-21 21:03 ` [PATCH 50/51] drm/udl: drop drm_driver.release hook Daniel Vetter
2020-02-21 21:03 ` [PATCH 51/51] drm: Add docs for managed resources Daniel Vetter
2020-02-27 18:14 [PATCH 00/51] drm managed resources, v3 Daniel Vetter
2020-02-27 18:14 ` [PATCH 02/51] drm/i915: Don't clear drvdata in ->release Daniel Vetter
2020-03-02 22:25 [PATCH 00/51] drm_device managed resources, v4 Daniel Vetter
2020-03-02 22:25 ` [PATCH 02/51] drm/i915: Don't clear drvdata in ->release Daniel Vetter
2020-03-23 14:48 [PATCH 00/51] drm_device managed resources, v5 Daniel Vetter
2020-03-23 14:49 ` [PATCH 02/51] drm/i915: Don't clear drvdata in ->release Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200221210319.2245170-3-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).