Re: [PATCH 02/51] drm/i915: Don't clear drvdata in ->release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 21, 2020 at 10:36 PM Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:
> Quoting Daniel Vetter (2020-02-21 21:02:30)
> > For two reasons:
> >
> > - The driver core clears this already for us after we're unloaded in
> >   __device_release_driver().
>
> Even if we abort before loading?
>
> History notes that i915_pci_remove was called with a stale pointer on
> error.

So even if there's a bug we still have the problem that clearing the
pci_drvdata in our drm_driver->release hook is way too late. You could
already have bound a new driver to the underlying device. So if driver
core doesn't clear drvdata on bind failure and we need to clear this
ourselves, then this line here could actually clear the drvdata of the
next driver instance bound to the pci device. Not that that's ever
going to happen outside of very contrived testing.

But looking at really_probe() in base/dd.c we do clear drvdata on
failure. So no idea how/why that stale drvdata came to be. Anyway
that's kinda why I cc'ed Greg, so he could confirm that this is
correct.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux