View Issue Details

IDProjectCategoryView StatusLast Update
0016778administrationmirrorspublic2019-12-14 03:15
ReporterHW_GXD 
PriorityurgentSeveritymajorReproducibilityalways
Status newResolutionopen 
Platformaarch64OSCentOS Linux OS Versionrelease 7.7.1908
Product Version 
Target VersionFixed in Version 
Summary0016778: remove device failed: Device or resource busy
DescriptionExample code is as follows:
[root@localhost ]# cat hello/hello.c
#include <linux/init.h>
#include <linux/module.h>

static int __init hello_init(void) {
    printk(KERN_ALERT "Hello, world\n");
    return 0;
}

static void __exit hello_exit(void) {
    printk(KERN_ALERT "Goodbye, cruel world\n");
}

MODULE_LICENSE("Dual BSD/GPL");

module_init(hello_init);

module_exit(hello_exit);

Recurrence operations:
[root@localhost ]#insmod hinic.ko
[root@localhost ]#dmesg
[ 2479.030163] Hello, world
[root@localhost ]# rmmod hello
rmmod: ERROR: could not remove 'hello': Device or resource busy
rmmod: ERROR: could not remove module hello: Device or resource busy
Steps To Reproduce
Firstly, install the system.
Secondly, install the kernel driver: insmod hello.ko
Thirdly, remove it: rmmod hello
Additional InformationMy centos's version is :
[root@localhost ]# uname -a
Linux localhost.localdomain 4.18.0-80.7.2.el7.aarch64 #1 SMP Thu Sep 12 16:13:20 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
[root@localhost ]# cat /etc/centos-release
CentOS Linux release 7.7.1908 (AltArch)
TagsNo tags attached.

Activities

tiantao

tiantao

2019-12-14 03:15

reporter   ~0035837

We have found the reason.
The inconsistency between the compiled gcc version of the kernel and the system's native gcc version caused this problem
[root@localhost ~]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-redhat-linux/4.8.5/lto-wrapper
Target: aarch64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-aarch64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-aarch64-redhat-linux/cloog-install --enable-gnu-indirect-function --build=aarch64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
[root@localhost ~]# dmesg | grep gcc
[ 0.000000] Linux version 4.18.0-80.7.2.el7.aarch64 (mockbuild@aarch64-01.bsys.centos.org) (gcc version 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)) #1 SMP Thu Sep 12 16:13:20 UTC 2019

Issue History

Date Modified Username Field Change
2019-11-28 09:12 HW_GXD New Issue
2019-12-14 03:15 tiantao Note Added: 0035837