Skip to content

mandeepsandhu/uio-hotplug-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uio-hotplug-test

Sample kernel and userspace driver for testing uio-hotplug feature.

uio_fake_hotplug.c

A uio kernel driver that fakes hot-unplug. Registers itself as a platform_device. On inserting the module, it starts a kthread which will call uio_unregister_device() after a delay of ~3 secs. This should test if the kernel can handle hot-unplug while the user-space program is still accessing the device. Interrupts are faked using a timer.

uio_user.c

A uio user-space driver. This simply opens the uio device and mmaps a page size of the uio device memory and continously writes to it. It has two modes of operation:

  • Repeatedly write to the mmap space (by doing memset on it).
  • Wait for interrupt, before writing to the mmap space. This can be enabled by defining WAIT_FOR_INTERRUPT.

run-uio-stress.sh

A simple script that loads the uio kernel driver, calls the uio user driver, removes the uio kernel driver and sleeps for 1 sec.

Run

Run the test:

$ make clean
$ make
$ ./run-uio-stress.sh

Monitor the kernel logs for error/bug trace:

$ tail -100f /var/log/kern.log

About

Sample kernel and usersapce driver for testing uio-hotplug feature

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published