Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error msg: Device 'virtio0' does not have a release() function #245

Closed
liuyuan10 opened this issue Sep 24, 2016 · 10 comments
Closed

Error msg: Device 'virtio0' does not have a release() function #245

liuyuan10 opened this issue Sep 24, 2016 · 10 comments

Comments

@liuyuan10
Copy link
Member

[ 13.000000] ------------[ cut here ]------------
[ 13.000000] WARNING: CPU: 0 PID: 40 at drivers/base/core.c:251 device_release+0x92/0xa0
[ 13.000000] Device 'virtio0' does not have a release() function, it is broken and must be fixed.
[ 13.000000] Call Trace:
[ 13.000000] 00007fccc97f99d8: [<7fcce725e0c2>] device_release+0x92/0xa0
[ 13.000000] 00007fccc97f99f8: [<7fcce6fc0c9a>] __warn+0xca/0xf0
[ 13.000000] 00007fccc97f9a48: [<7fcce6fc0d50>] warn_slowpath_fmt+0x90/0xa0
[ 13.000000] 00007fccc97f9a98: [<7fcce706f1c9>] kernfs_put+0x109/0x1d0
[ 13.000000] 00007fccc97f9ab8: [<7fcce72659c8>] release_nodes+0x1b8/0x230
[ 13.000000] 00007fccc97f9ad0: [<7fcce706f1c9>] kernfs_put+0x109/0x1d0
[ 13.000000] 00007fccc97f9b08: [<7fcce7265e4c>] devres_release_all+0x3c/0x60
[ 13.000000] 00007fccc97f9b28: [<7fcce725e0c2>] device_release+0x92/0xa0
[ 13.000000] 00007fccc97f9b58: [<7fcce722a26c>] kobject_cleanup+0x3c/0x80
[ 13.000000] 00007fccc97f9b88: [<7fcce722a18a>] kobject_put+0x4a/0x80
[ 13.000000] 00007fccc97f9bb8: [<7fcce725ec52>] put_device+0x12/0x20
[ 13.000000] 00007fccc97f9bc8: [<7fcce725f519>] device_unregister+0x19/0x20
[ 13.000000] 00007fccc97f9be8: [<7fcce72498c5>] unregister_virtio_device+0x15/0x30
[ 13.000000] 00007fccc97f9c08: [<7fcce724aef0>] virtio_mmio_remove+0x10/0x20
[ 13.000000] 00007fccc97f9c18: [<7fcce72640cf>] platform_drv_remove+0x1f/0x30
[ 13.000000] 00007fccc97f9c28: [<7fcce72630d9>] __device_release_driver+0x79/0x120
[ 13.000000] 00007fccc97f9c48: [<7fcce72631de>] device_release_driver+0x1e/0x30
[ 13.000000] 00007fccc97f9c68: [<7fcce7261365>] unbind_store+0xb5/0xe0
[ 13.000000] 00007fccc97f9cb8: [<7fcce7260c7f>] drv_attr_store+0x1f/0x30
[ 13.000000] 00007fccc97f9cc8: [<7fcce7071475>] sysfs_kf_write+0x35/0x50
[ 13.000000] 00007fccc97f9cd8: [<7fcce7070816>] kernfs_fop_write+0xa6/0x190
[ 13.000000] 00007fccc97f9ce8: [<7fcce7030577>] do_filp_open+0x87/0xd0
[ 13.000000] 00007fccc97f9d28: [<7fcce7023db5>] __vfs_write+0x25/0x160
[ 13.000000] 00007fccc97f9d68: [<7fcce7248bbe>] atomic64_add_unless+0x3e/0x60
[ 13.000000] 00007fccc97f9dc8: [<7fcce7023fd6>] vfs_write+0x86/0x100
[ 13.000000] 00007fccc97f9e18: [<7fcce7024155>] SyS_write+0x45/0xc0
[ 13.000000] 00007fccc97f9e68: [<7fcce6fbe010>] syscall_thread+0x1e0/0x380
[ 13.000000] 00007fccc97f9e90: [<7fcce6fe0a90>] autoremove_wake_function+0x0/0x40
[ 13.000000] 00007fccc97f9ea8: [<7fcce6fbde30>] syscall_thread+0x0/0x380
[ 13.000000] 00007fccc97f9ec8: [<7fcce6fbde30>] syscall_thread+0x0/0x380
[ 13.000000] 00007fccc97f9ee8: [<7fcce6fbd2e8>] thread_bootstrap+0x48/0x50

How to reproduce:
LKL_HIJACK_DEBUG=1 sh tests/run_netperf.sh

Looks like this is a know issue from comment in PR #241. @M1cha do you have any idea of this?

@M1cha
Copy link

M1cha commented Sep 24, 2016

@liuyuan10 I only know how to silence it, but not how to fix it, since I'm not that familiar with writing kernel platform drivers.

@M1cha
Copy link

M1cha commented Oct 13, 2016

@tavip shouldn't we report this to the linux kernel mailing list so they can fix it?

@liuyuan10
Copy link
Member Author

I sent an one-line fix to upstream. Hopefully I won't get kicked :)

@M1cha
Copy link

M1cha commented Nov 24, 2016

can you post a mail archive link here for reference?

@liuyuan10
Copy link
Member Author

liuyuan10 commented Nov 25, 2016

I sent the mail to [email protected] but can't find a archive link with my mail. Here is the mail I sent

From: Yuan Liu <[email protected]>

Fix a warning thrown from virtio_mmio_remove():
Device 'virtio0' does not have a release() function

The fix is according to virtio_pci_probe() of
drivers/virtio/virtio_pci_common.c

Signed-off-by: Yuan Liu <[email protected]>
---
 drivers/virtio/virtio_mmio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 48bfea9..d47a2fc 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -489,6 +489,7 @@ static const struct virtio_config_ops virtio_mmio_config_ops = {
 };


+static void virtio_mmio_release_dev_empty(struct device *_d) {}

 /* Platform device */

@@ -511,6 +512,7 @@ static int virtio_mmio_probe(struct platform_device *pdev)
                return  -ENOMEM;

        vm_dev->vdev.dev.parent = &pdev->dev;
+       vm_dev->vdev.dev.release = virtio_mmio_release_dev_empty;
        vm_dev->vdev.config = &virtio_mmio_config_ops;
        vm_dev->pdev = pdev;
        INIT_LIST_HEAD(&vm_dev->virtqueues);

@liuyuan10
Copy link
Member Author

Looks like this link only includes mails sent by the maintainer:
http://virtualization.linux-foundation.narkive.com/cJ0R9zlc/patch-virtio-mmio-set-dev-release-to-avoid-warning

@liuyuan10
Copy link
Member Author

The fix has been merged to linux upstream:
torvalds@cecdbdc

@M1cha
Copy link

M1cha commented Dec 24, 2016

the patch will be in 4.10 then ( we didn't even merge 4.9 yet :D )

@thehajime
Copy link
Member

I'm about to submit a pr on 4.9 merge. FYI.

@thehajime
Copy link
Member

thehajime commented Feb 22, 2017

Fixed by #335.
(I was expected to close this issue by b485d40 but seems not to be automatically closed, dunno why.)

Thanks @liuyuan10 for the upstream !!

thehajime added a commit to libos-nuse/lkl-linux that referenced this issue Feb 23, 2017
Linux 4.10

This fixes lkl#245.

Conflicts:
	fs/xfs/xfs_buf.c
	kernel/sched/idle.c
	scripts/link-vmlinux.sh
	tools/Makefile

Signed-off-by: Hajime Tazaki <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants