tools/testing/selftests/media_tests/regression_test.txt
Source file repositories/reference/linux-study-clean/tools/testing/selftests/media_tests/regression_test.txt
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/media_tests/regression_test.txt- Extension
.txt- Size
- 1624 bytes
- Lines
- 44
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
Testing for regressions in Media Controller API register, ioctl, syscall,
and unregister paths. There have a few problems that result in use-after
free on media_device, media_devnode, and cdev pointers when the driver is
unbound while ioctl is in progress.
Test Procedure:
Run bin/unbind loop while ioctls are in progress.
Run rmmod and modprobe.
Disconnect the device.
Setup:
Build media_device_test
cd tools/testing/selftests/media_tests
make
Regressions test for cdev use-after-free error on /dev/mediaX when driver
is unbound:
Start media_device_test to regression test media devnode dynamic alloc
and cdev use-after-free fixes. This opens media dev files and sits in
a loop running media ioctl MEDIA_IOC_DEVICE_INFO command once every 10
seconds. The idea is when device file goes away, media devnode and cdev
should stick around until this test exits.
The test for a random number of iterations or until user kills it with a
sleep 10 in between the ioctl calls.
sudo ./media_device_test -d /dev/mediaX
Regression test for media_devnode unregister race with ioctl_syscall:
Start 6 open_loop_test.sh tests with different /dev/mediaX files. When
device file goes away after unbind, device file name changes. Start the
test with possible device names. If we start with /dev/media0 for example,
after unbind, /dev/media1 or /dev/media2 could get created. The idea is
keep ioctls going while bind/unbind runs.
Copy bind_unbind_sample.txt and make changes to specify the driver name
and number to run bind and unbind. Start the bind_unbind.sh
Run dmesg looking for any use-after-free errors or mutex lock errors.
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.