twx-linux/drivers/misc
Thadeu Lima de Souza Cascardo 74d8361be3 char: misc: add test cases
Add test cases for static and dynamic minor number allocation and
deallocation.

While at it, improve description and test suite name.

Some of the cases include:

- that static and dynamic allocation reserved the expected minors.

- that registering duplicate minors or duplicate names will fail.

- that failing to create a sysfs file (due to duplicate names) will
  deallocate the dynamic minor correctly.

- that dynamic allocation does not allocate a minor number in the static
  range.

- that there are no collisions when mixing dynamic and static allocations.

- that opening devices with various minor device numbers work.

- that registering a static number in the dynamic range won't conflict with
  a dynamic allocation.

This last test verifies the bug fixed by commit 6d04d2b554b1 ("misc:
misc_minor_alloc to use ida for all dynamic/misc dynamic minors") has not
regressed.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Link: https://lore.kernel.org/r/20250612-misc-dynrange-v5-1-6f35048f7273@igalia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-24 16:46:13 +01:00
..
altera-stapl move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
amd-sbi misc: amd-sbi: Add support for register xfer 2025-05-21 14:44:41 +02:00
bcm-vk treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
c2port misc: c2port: Constify 'struct bin_attribute' 2024-12-24 09:36:02 +01:00
cardreader misc: rtsx: Add support for RTS5264 Version B and optimize init flow 2025-06-24 16:45:55 +01:00
cb710
eeprom misc: eeprom/idt_89hpesx: use per-client debugfs directory 2025-04-15 16:14:30 +02:00
genwqe
ibmasm
keba misc: keba: Fix kernfs warning on module unload 2025-01-10 10:16:39 +01:00
lis3lv02d misc: lis3lv02d: Fix correct sysfs directory path for lis3lv02d 2025-05-21 14:44:12 +02:00
lkdtm lkdtm: use SLAB_NO_MERGE instead of an empty constructor 2025-04-28 10:32:43 -07:00
mchp_pci1xxxx misc: microchip: pci1xxxx: Add GPIO Wakeup Support 2025-05-21 14:44:20 +02:00
mei mei: bus: Check for still connected devices in mei_cl_bus_dev_release() 2025-06-24 16:39:02 +01:00
ocxl misc: ocxl: Replace scnprintf() with sysfs_emit() in sysfs show functions 2025-06-24 16:45:47 +01:00
pvpanic
sgi-gru misc: sgi-gru: Don't disable preemption in GRU driver 2024-10-09 12:47:01 -07:00
sgi-xp treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
uacce uacce: Remove unnecessary IOMMU_DEV_FEAT_IOPF 2025-04-28 13:04:34 +02:00
vmw_vmci misc: vmw_vmci: Remove unused qpair functions 2025-06-24 16:45:35 +01:00
ad525x_dpot-i2c.c
ad525x_dpot-spi.c
ad525x_dpot.c
ad525x_dpot.h
apds990x.c misc: apds990x: Fix missing pm_runtime_disable() 2024-10-13 17:10:53 +02:00
apds9802als.c
atmel-ssc.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
bh1770glc.c
cs5535-mfgpt.c x86/msr: Add explicit includes of <asm/msr.h> 2025-05-02 10:23:47 +02:00
ds1682.c misc: ds1682: Constify 'struct bin_attribute' 2024-12-24 09:36:02 +01:00
dummy-irq.c
dw-xdata-pcie.c
enclosure.c misc: enclosure: Use str_on_off() helper 2025-06-24 16:46:04 +01:00
fastrpc.c misc: fastrpc: Add meaningful labels for exit paths 2025-04-15 16:12:50 +02:00
gehc-achc.c
hi6421v600-irq.c misc: Use dev_fwnode() 2025-06-24 16:45:08 +01:00
hisi_hikey_usb.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
hmc6352.c
hpilo.c
hpilo.h
ibmvmc.c
ibmvmc.h
ics932s401.c
isl29003.c
isl29020.c misc: isl29020: Fix the wrong format specifier 2024-11-12 12:54:53 +01:00
Kconfig Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
kgdbts.c kgdbts: fix hw_access_break_test 2024-08-13 11:27:38 +02:00
lan966x_pci.c misc: Add support for LAN966x PCI device 2024-10-24 12:09:33 +02:00
lan966x_pci.dtso misc: lan966x_pci: Fix dtc warn 'Missing interrupt-parent' 2024-11-04 14:34:25 +01:00
lattice-ecp3-config.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
Makefile Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
misc_minor_kunit.c char: misc: add test cases 2025-06-24 16:46:13 +01:00
mrvl_cn10k_dpi.c misc: mrvl-cn10k-dpi: add Octeon CN10K DPI administrative driver 2024-07-10 14:58:29 +02:00
nsm.c
ntsync.c ntsync: Check wait count based on byte size. 2025-02-21 11:57:33 +01:00
open-dice.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
pch_phub.c misc: pch_phub: Constify 'struct bin_attribute' 2024-12-24 09:36:02 +01:00
pci_endpoint_test.c misc: pci_endpoint_test: Defer IRQ allocation until ioctl(PCITEST_SET_IRQTYPE) 2025-04-23 17:04:48 -05:00
phantom.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
qcom-coincell.c
rpmb-core.c rpmb: Remove some useless locking 2024-10-13 17:11:51 +02:00
smpro-errmon.c
smpro-misc.c
sram-exec.c
sram.c drivers: misc: sram: fix up some const issues with recent attribute changes 2025-06-24 16:44:44 +01:00
sram.h
ti_fpc202.c i2c: atr: add static flag 2025-05-22 11:07:05 +02:00
tifm_7xx1.c
tifm_core.c
tps6594-esm.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
tps6594-pfsm.c misc: tps6594-pfsm: Add NULL pointer check in tps6594_pfsm_probe() 2025-04-15 16:13:55 +02:00
tsl2550.c misc: tsl2550: replace simple_strtoul to kstrtoul 2024-09-03 12:34:31 +02:00
vcpu_stall_detector.c misc: vcpu_stall_detector: Switch to use hrtimer_setup() 2025-02-18 11:19:04 +01:00
vmw_balloon.c
xilinx_sdfec.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
xilinx_tmr_inject.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
xilinx_tmr_manager.c