From: Jason Ekstrand <jason@jlekstrand.net> To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, Jason Ekstrand <jason@jlekstrand.net> Subject: [PATCH 2/6] drm/i915: Call i915_globals_exit() if pci_register_device() fails Date: Tue, 20 Jul 2021 13:13:53 -0500 [thread overview] Message-ID: <20210720181357.2760720-3-jason@jlekstrand.net> (raw) In-Reply-To: <20210720181357.2760720-1-jason@jlekstrand.net> In the unlikely event that pci_register_device() fails, we were tearing down our PMU setup but not globals. This leaves a bunch of memory slabs lying around. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global") Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> --- drivers/gpu/drm/i915/i915_globals.c | 4 ++-- drivers/gpu/drm/i915/i915_pci.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c index 77f1911c463b8..87267e1d2ad92 100644 --- a/drivers/gpu/drm/i915/i915_globals.c +++ b/drivers/gpu/drm/i915/i915_globals.c @@ -138,7 +138,7 @@ void i915_globals_unpark(void) atomic_inc(&active); } -static void __exit __i915_globals_flush(void) +static void __i915_globals_flush(void) { atomic_inc(&active); /* skip shrinking */ @@ -148,7 +148,7 @@ static void __exit __i915_globals_flush(void) atomic_dec(&active); } -void __exit i915_globals_exit(void) +void i915_globals_exit(void) { GEM_BUG_ON(atomic_read(&active)); diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 50ed93b03e582..4e627b57d31a2 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -1230,6 +1230,7 @@ static int __init i915_init(void) err = pci_register_driver(&i915_pci_driver); if (err) { i915_pmu_exit(); + i915_globals_exit(); return err; } -- 2.31.1
WARNING: multiple messages have this Message-ID (diff)
From: Jason Ekstrand <jason@jlekstrand.net> To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Subject: [Intel-gfx] [PATCH 2/6] drm/i915: Call i915_globals_exit() if pci_register_device() fails Date: Tue, 20 Jul 2021 13:13:53 -0500 [thread overview] Message-ID: <20210720181357.2760720-3-jason@jlekstrand.net> (raw) In-Reply-To: <20210720181357.2760720-1-jason@jlekstrand.net> In the unlikely event that pci_register_device() fails, we were tearing down our PMU setup but not globals. This leaves a bunch of memory slabs lying around. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global") Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> --- drivers/gpu/drm/i915/i915_globals.c | 4 ++-- drivers/gpu/drm/i915/i915_pci.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c index 77f1911c463b8..87267e1d2ad92 100644 --- a/drivers/gpu/drm/i915/i915_globals.c +++ b/drivers/gpu/drm/i915/i915_globals.c @@ -138,7 +138,7 @@ void i915_globals_unpark(void) atomic_inc(&active); } -static void __exit __i915_globals_flush(void) +static void __i915_globals_flush(void) { atomic_inc(&active); /* skip shrinking */ @@ -148,7 +148,7 @@ static void __exit __i915_globals_flush(void) atomic_dec(&active); } -void __exit i915_globals_exit(void) +void i915_globals_exit(void) { GEM_BUG_ON(atomic_read(&active)); diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 50ed93b03e582..4e627b57d31a2 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -1230,6 +1230,7 @@ static int __init i915_init(void) err = pci_register_driver(&i915_pci_driver); if (err) { i915_pmu_exit(); + i915_globals_exit(); return err; } -- 2.31.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2021-07-20 18:14 UTC|newest] Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-20 18:13 [PATCH 0/6] Fix the debugfs splat from mock selftests Jason Ekstrand 2021-07-20 18:13 ` [Intel-gfx] " Jason Ekstrand 2021-07-20 18:13 ` [PATCH 1/6] drm/i915: Call i915_globals_exit() after i915_pmu_exit() Jason Ekstrand 2021-07-20 18:13 ` [Intel-gfx] " Jason Ekstrand 2021-07-20 18:13 ` Jason Ekstrand [this message] 2021-07-20 18:13 ` [Intel-gfx] [PATCH 2/6] drm/i915: Call i915_globals_exit() if pci_register_device() fails Jason Ekstrand 2021-07-20 18:13 ` [PATCH 3/6] drm/i915: Use a table for i915_init/exit Jason Ekstrand 2021-07-20 18:13 ` [Intel-gfx] " Jason Ekstrand 2021-07-20 18:29 ` Daniel Vetter 2021-07-20 18:29 ` [Intel-gfx] " Daniel Vetter 2021-07-21 9:06 ` Tvrtko Ursulin 2021-07-21 9:06 ` Tvrtko Ursulin 2021-07-21 15:12 ` Jason Ekstrand 2021-07-21 15:12 ` Jason Ekstrand 2021-07-20 18:13 ` [PATCH 4/6] drm/ttm: Force re-init if ttm_global_init() fails Jason Ekstrand 2021-07-20 18:13 ` [Intel-gfx] " Jason Ekstrand 2021-07-21 6:35 ` Christian König 2021-07-21 6:35 ` [Intel-gfx] " Christian König 2021-07-21 9:06 ` Daniel Vetter 2021-07-21 9:06 ` Daniel Vetter 2021-07-21 9:08 ` Christian König 2021-07-21 9:08 ` Christian König 2021-07-21 9:12 ` Daniel Vetter 2021-07-21 9:12 ` Daniel Vetter 2021-07-20 18:13 ` [PATCH 5/6] drm/ttm: Initialize debugfs from ttm_global_init() Jason Ekstrand 2021-07-20 18:13 ` [Intel-gfx] " Jason Ekstrand 2021-07-20 18:13 ` [PATCH 6/6] drm/i915: Make the kmem slab for i915_buddy_block a global Jason Ekstrand 2021-07-20 18:13 ` [Intel-gfx] " Jason Ekstrand 2021-07-20 18:29 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Fix the debugfs splat from mock selftests (rev2) Patchwork 2021-07-20 18:30 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork 2021-07-20 18:34 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork 2021-07-20 18:56 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork 2021-07-20 20:45 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork -- strict thread matches above, loose matches on Subject: below -- 2021-07-21 15:23 [PATCH 0/6] Fix the debugfs splat from mock selftests (v3) Jason Ekstrand 2021-07-21 15:23 ` [PATCH 2/6] drm/i915: Call i915_globals_exit() if pci_register_device() fails Jason Ekstrand 2021-07-19 18:30 [PATCH 0/6] Fix the debugfs splat from mock selftests Jason Ekstrand 2021-07-19 18:30 ` [PATCH 2/6] drm/i915: Call i915_globals_exit() if pci_register_device() fails Jason Ekstrand 2021-07-20 14:11 ` 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=20210720181357.2760720-3-jason@jlekstrand.net \ --to=jason@jlekstrand.net \ --cc=daniel.vetter@ffwll.ch \ --cc=dri-devel@lists.freedesktop.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.