From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Fix module unloading with DRM_I915_UMS=n
Date: Fri, 15 Nov 2013 22:49:36 +0100 [thread overview]
Message-ID: <20131115214936.GC22741@phenom.ffwll.local> (raw)
In-Reply-To: <20131115205812.GA32202@nuc-i3427.alporthouse.com>
On Fri, Nov 15, 2013 at 08:58:12PM +0000, Chris Wilson wrote:
> On Fri, Nov 15, 2013 at 05:16:33PM +0100, Daniel Vetter wrote:
> > Oops, makes testing early boot failures in i915.ko a bit more pain, so
> > let's fix it.
> >
> > v2: We already have a bit of static storage to track this (Chris).
> >
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> How about just fixing the core not to die?
This is for the disabled UMS code where we silently don't register
anything. So there's also nothing to clean up, i.e. we've called
drm_pci_exit without drm_pci_init. I don't think this is something we
should allow in the core.
-Daniel
>
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index f00d7a9..3b9c7ce 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -375,13 +375,13 @@ int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
>
> DRM_DEBUG("\n");
>
> + if (driver->driver_features & DRIVER_MODESET)
> + return pci_register_driver(pdriver);
> +
> INIT_LIST_HEAD(&driver->device_list);
> driver->kdriver.pci = pdriver;
> driver->bus = &drm_pci_bus;
>
> - if (driver->driver_features & DRIVER_MODESET)
> - return pci_register_driver(pdriver);
> -
> /* If not using KMS, fall back to stealth mode manual scanning. */
> for (i = 0; pdriver->id_table[i].vendor != 0; i++) {
> pid = &pdriver->id_table[i];
> @@ -462,6 +462,11 @@ void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
> struct drm_device *dev, *tmp;
> DRM_DEBUG("\n");
>
> + if (!driver->kdriver.pci)
> + return;
> +
> + WARN_ON(driver->kdriver.pci != pdriver);
> +
> if (driver->driver_features & DRIVER_MODESET) {
> pci_unregister_driver(pdriver);
> } else {
>
> We can drop the redundant pdriver later.
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2013-11-15 21:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 10:28 [PATCH] drm/i915: Fix module unloading with DRM_I915_UMS=n Daniel Vetter
2013-11-15 10:34 ` Chris Wilson
2013-11-15 16:16 ` Daniel Vetter
2013-11-15 20:58 ` Chris Wilson
2013-11-15 21:49 ` Daniel Vetter [this message]
2013-11-22 19:25 ` Paulo Zanoni
2013-11-25 8:41 ` 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=20131115214936.GC22741@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--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