All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Emil Velikov <emil.l.velikov@gmail.com>,
	ML dri-devel <dri-devel@lists.freedesktop.org>,
	Laszlo Ersek <lersek@redhat.com>,
	Hans de Goede <hdegoede@redhat.com>,
	"Thorsten Leemhuis (regressions address)"
	<regressions@leemhuis.info>, David Airlie <airlied@redhat.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Joachim Frieben <jfrieben@hotmail.com>,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: Re: Regression: drm: Lobotomize set_busid nonsense for !pci drivers (a325725633c2)
Date: Wed, 05 Oct 2016 14:43:37 +0200	[thread overview]
Message-ID: <1475671417.25728.13.camel@redhat.com> (raw)
In-Reply-To: <20161005103046.GY20761@phenom.ffwll.local>

On Mi, 2016-10-05 at 12:30 +0200, Daniel Vetter wrote:
> On Wed, Oct 05, 2016 at 08:34:57AM +0200, Gerd Hoffmann wrote:
> > On Di, 2016-10-04 at 09:43 +0200, Gerd Hoffmann wrote:
> > >   Hi,
> > > 
> > > > diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> > > > b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> > > > index a59d0e309bfc..1fcf739bf509 100644
> > > > --- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> > > > +++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> > > > @@ -68,6 +68,10 @@ int drm_virtio_init(struct drm_driver *driver,
> > > > struct virtio_device *vdev)
> > > >                 dev->pdev = pdev;
> > > >                 if (vga)
> > > >                         virtio_pci_kick_out_firmware_fb(pdev);
> > > > +
> > > > +               ret = drm_dev_set_unique(dev, dev_name(dev->pdev));
> > > > +               if (ret)
> > > > +                       goto err_free;
> > > >         }
> > > 
> > > Approach looks sensible to me, I'll give it a try ...
> > 
> > Well, dev_name() returns a string without the "pci:" prefix, we have to
> > add that to make things actually work, like this:
> 
> Hm right, I missed that in digging through the piles of layers of struct
> device naming.
> 
> > 
> > --- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> > +++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> > @@ -60,13 +60,22 @@ int drm_virtio_init(struct drm_driver *driver,
> > struct virtio_device *vdev)
> >  
> >         if (strcmp(vdev->dev.parent->bus->name, "pci") == 0) {
> >                 struct pci_dev *pdev = to_pci_dev(vdev->dev.parent);
> > +               const char *pname = dev_name(&pdev->dev);
> >                 bool vga = (pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA;
> > +               char unique[20];
> 
> Iirc we kfree this on unload. Needs to be a kasprintf I think.

drm_dev_set_unique() does this:

dev->unique = kstrdup(name, GFP_KERNEL);

So it should not matter at all where the caller stores name.
Or do you mean something else?

cheers,
  Gerd

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

  reply	other threads:[~2016-10-05 12:43 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21  8:54 [PATCH 01/11] drm: Move master pointer from drm_minor to drm_device Daniel Vetter
2016-06-21  8:54 ` [PATCH 02/11] drm: Clean up drm_crtc.h Daniel Vetter
2016-06-21  8:54 ` [PATCH 03/11] drm: Use dev->name as fallback for dev->unique Daniel Vetter
2016-06-21  8:54 ` [PATCH 04/11] drm/vgem: Stop calling drm_drv_set_unique Daniel Vetter
2016-06-21  8:54 ` [PATCH 05/11] drm: Don't call drm_dev_set_unique from platform drivers Daniel Vetter
2016-06-21  8:54 ` [PATCH 06/11] drm: Nuke SET_UNIQUE ioctl Daniel Vetter
2016-06-21  8:54 ` [PATCH 07/11] drm: Lobotomize set_busid nonsense for !pci drivers Daniel Vetter
2016-06-21 12:08   ` [PATCH] " Daniel Vetter
2016-09-30  3:09     ` Regression: drm: Lobotomize set_busid nonsense for !pci drivers (a325725633c2) Laszlo Ersek
2016-09-30  8:28       ` Hans de Goede
2016-09-30 10:03         ` Laszlo Ersek
2016-09-30 10:35         ` Hans de Goede
2016-09-30 14:51           ` Laszlo Ersek
2016-09-30 14:59             ` Hans de Goede
2016-09-30 15:33               ` Laszlo Ersek
2016-09-30 16:38                 ` Hans de Goede
2016-09-30 17:26                   ` Laszlo Ersek
2016-10-03 11:34                     ` Emil Velikov
2016-10-03 12:14                       ` Laszlo Ersek
2016-10-03 12:46                         ` Emil Velikov
2016-10-03 13:03                           ` Laszlo Ersek
2016-10-03 14:15                       ` Laszlo Ersek
2016-10-03 14:27                         ` Laszlo Ersek
2016-10-03 15:00                           ` Emil Velikov
2016-10-03 15:19                             ` Laszlo Ersek
2016-10-03 19:12                         ` Daniel Vetter
2016-10-03 19:36                           ` Laszlo Ersek
2016-10-03 20:34                             ` Daniel Vetter
2016-10-03 20:44                               ` Laszlo Ersek
2016-10-04  7:43                           ` Gerd Hoffmann
2016-10-05  6:34                             ` Gerd Hoffmann
2016-10-05 10:30                               ` Daniel Vetter
2016-10-05 12:43                                 ` Gerd Hoffmann [this message]
2016-10-05 13:02                                   ` Daniel Vetter
2016-09-30  9:55       ` Emil Velikov
2016-09-30 10:37         ` Emil Velikov
2016-06-21 12:51   ` ✓ Ro.CI.BAT: success for drm: Lobotomize set_busid nonsense for !pci drivers Patchwork
2016-06-21  8:54 ` [PATCH 08/11] drm: Refactor drop/set master code a bit Daniel Vetter
2016-06-21 12:20   ` [PATCH] " Daniel Vetter
2016-06-21 13:14   ` ✗ Ro.CI.BAT: failure for " Patchwork
2016-06-21  8:54 ` [PATCH 09/11] drm: Extract drm_is_current_master Daniel Vetter
2016-06-21  8:54 ` [PATCH 10/11] drm: Clear up master tracking booleans Daniel Vetter
2016-06-21  8:54 ` [PATCH 11/11] drm: document drm_auth.c 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=1475671417.25728.13.camel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=airlied@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=hdegoede@redhat.com \
    --cc=jfrieben@hotmail.com \
    --cc=lersek@redhat.com \
    --cc=regressions@leemhuis.info \
    /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 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.