lkml.org 
[lkml]   [2021]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 01/10] [hack] silence ttm fini WARNING
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

\
 
 \ /
  Last update: 2021-02-05 08:42    [W:0.051 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site