From patchwork Wed Oct 5 06:34:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9362507 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9706600C8 for ; Wed, 5 Oct 2016 06:35:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B923428652 for ; Wed, 5 Oct 2016 06:35:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB991287CE; Wed, 5 Oct 2016 06:35:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BC61A28652 for ; Wed, 5 Oct 2016 06:35:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC6BE6E7D3; Wed, 5 Oct 2016 06:35:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACB0B6E7D3 for ; Wed, 5 Oct 2016 06:35:00 +0000 (UTC) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E392161E7B; Wed, 5 Oct 2016 06:34:59 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u956Ywgv012413; Wed, 5 Oct 2016 02:34:58 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 71BD280A81; Wed, 5 Oct 2016 08:34:57 +0200 (CEST) Message-ID: <1475649297.25728.5.camel@redhat.com> Subject: Re: Regression: drm: Lobotomize set_busid nonsense for !pci drivers (a325725633c2) From: Gerd Hoffmann To: Daniel Vetter Date: Wed, 05 Oct 2016 08:34:57 +0200 In-Reply-To: <1475567025.14732.4.camel@redhat.com> References: <1466499262-18717-7-git-send-email-daniel.vetter@ffwll.ch> <1466510913-17958-1-git-send-email-daniel.vetter@ffwll.ch> <503b3377-5e61-75c7-1d33-a44c89028a79@redhat.com> <798c8b2d-1da9-51a3-8be7-b23d4cb26f3f@redhat.com> <9d5cd002-eb29-bc4d-89e8-a4a594dd84ad@redhat.com> <1bb8741c-3411-ce56-9e84-f85433af05f0@redhat.com> <26ac8ab0-fe8c-ea8a-08fb-905c873b5fef@redhat.com> <8469d2ee-958a-514f-b625-a586d111444d@redhat.com> <13448e3a-2ac5-3f5b-5d31-2c372d566634@redhat.com> <3eff4361-286c-e31a-27dc-024ae42def6b@redhat.com> <859e9d3c-2eae-6a36-67ea-8bcde49246b9@redhat.com> <1475567025.14732.4.camel@redhat.com> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 05 Oct 2016 06:35:00 +0000 (UTC) Cc: Laszlo Ersek , Emil Velikov , ML dri-devel , Hans de Goede , "Thorsten Leemhuis \(regressions address\)" , David Airlie , Daniel Vetter , Joachim Frieben , Gustavo Padovan X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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: ret = drm_dev_register(dev, 0); And a partial revert of commit a742946a1ba57e24e8be205ea87224c05b38c380 to re-export drm_dev_set_unique(). Pushed to git://git.kraxel.org/linux drm-qemu cheers, Gerd Reviewed-by: Daniel Vetter --- 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]; - DRM_INFO("pci: %s detected\n", - vga ? "virtio-vga" : "virtio-gpu-pci"); + DRM_INFO("pci: %s detected at %s\n", + vga ? "virtio-vga" : "virtio-gpu-pci", + pname); dev->pdev = pdev; if (vga) virtio_pci_kick_out_firmware_fb(pdev); + + snprintf(unique, sizeof(unique), "pci:%s", pname); + ret = drm_dev_set_unique(dev, unique); + if (ret) + goto err_free; + }