dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>, Huang Rui <ray.huang@amd.com>,
	dri-devel@lists.freedesktop.org,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6 01/10] [hack] silence ttm fini WARNING
Date: Fri, 5 Feb 2021 08:39:56 +0100	[thread overview]
Message-ID: <20210205073956.koeqlzh2suuzitgr@sirius.home.kraxel.org> (raw)
In-Reply-To: <1bb54d72-a9b5-0d9d-6f08-b8f9f4abe421@amd.com>

On Thu, Feb 04, 2021 at 03:58:33PM +0100, Christian König wrote:
> ?
> 
> What's the background here?
> 
> Christian.
> 
> Am 04.02.21 um 15:57 schrieb Gerd Hoffmann:
> > kobject: '(null)' ((____ptrval____)): is not initialized, yet kobject_put() is being called.
> > WARNING: CPU: 0 PID: 209 at lib/kobject.c:750 kobject_put+0x3a/0x60
> > [ ... ]
> > Call Trace:
> >   ttm_device_fini+0x133/0x1b0 [ttm]
> >   qxl_ttm_fini+0x2f/0x40 [qxl]

Happens on driver removal.  Seen with both qxl and bochs (the later
using vram helpers).

Testcase: "drmtest --unbind" (https://git.kraxel.org/cgit/drminfo/).

static int try_unbind(int card)
{
    char path[256];
    char *device, *name;
    int fd;

    snprintf(path, sizeof(path), "/sys/class/drm/card%d/device", card);
    device = realpath(path, NULL);
    if (device == NULL) {
        fprintf(stderr, "%s: can't resolve sysfs device path\n", __func__);
        return -1;
    }

    snprintf(path, sizeof(path), "%s/driver/unbind", device);
    fd = open(path, O_WRONLY);
    if (fd < 0) {
        fprintf(stderr, "open %s: %s\n", path, strerror(errno));
        return -1;
    }

    name = strrchr(device, '/') + 1;
    write(fd, name, strlen(name));
    close(fd);
    return 0;
}

take care,
  Gerd

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

  reply	other threads:[~2021-02-05  7:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 14:57 [PATCH v6 00/10] drm/qxl: fix driver shutdown issues Gerd Hoffmann
2021-02-04 14:57 ` [PATCH v6 01/10] [hack] silence ttm fini WARNING Gerd Hoffmann
2021-02-04 14:58   ` Christian König
2021-02-05  7:39     ` Gerd Hoffmann [this message]
2021-02-04 14:57 ` [PATCH v6 02/10] Revert "drm/qxl: do not run release if qxl failed to init" Gerd Hoffmann
2021-02-04 18:34   ` Thomas Zimmermann
2021-02-04 18:52     ` Tong Zhang
2021-02-04 19:06       ` Thomas Zimmermann
2021-02-04 20:21         ` Tong Zhang
2021-02-04 14:57 ` [PATCH v6 03/10] drm/qxl: use drmm_mode_config_init Gerd Hoffmann
2021-02-04 14:57 ` [PATCH v6 04/10] drm/qxl: unpin release objects Gerd Hoffmann
2021-02-04 14:57 ` [PATCH v6 05/10] drm/qxl: release shadow on shutdown Gerd Hoffmann
2021-02-04 18:17   ` Thomas Zimmermann
2021-02-04 14:57 ` [PATCH v6 06/10] drm/qxl: properly pin/unpin shadow Gerd Hoffmann
2021-02-04 18:18   ` Thomas Zimmermann
2021-02-04 14:57 ` [PATCH v6 07/10] drm/qxl: handle shadow in primary destroy Gerd Hoffmann
2021-02-04 14:57 ` [PATCH v6 08/10] drm/qxl: properly free qxl releases Gerd Hoffmann
2021-02-04 14:57 ` [PATCH v6 09/10] drm/qxl: simplify qxl_fence_wait Gerd Hoffmann
2021-02-04 14:57 ` [PATCH v6 10/10] drm/qxl: allocate dumb buffers in ram Gerd Hoffmann
2021-02-04 18:22   ` Thomas Zimmermann

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=20210205073956.koeqlzh2suuzitgr@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=airlied@linux.ie \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ray.huang@amd.com \
    /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;
as well as URLs for NNTP newsgroup(s).