Alison Schofield wrote: > On Fri, Feb 17, 2023 at 05:40:24PM -0700, Vishal Verma wrote: > > This test failed intermittently because the ndctl-list operation right > > after a 'modprobe cxl_test' could race the actual nmem devices getting > > loaded. > > > > Since CXL device probes are asynchronous, and cxl_acpi might've kicked > > off a cxl_bus_rescan(), a cxl_flush() (via cxl_wait_probe()) can ensure > > everything is loaded. > > > > Add a plain cxl-list right after the modprobe to allow for a flush/wait > > cycle. > > Is this the preferred method to 'settle', instead of udevadm settle?
In general, 'udevadm settle' is only the first phase of flushing subsystem setup work in that it can only flush the udev event queue. I.e. a device arriving kicks off a KOBJ_ADD event, and once that event is processed without kicking off more KOBJ_* events the queue is settled. For CXL this means that the cxl_acpi and cxl_pci modules are loaded, but the asynchronous work they kick off to probe devices and rescan the bus is invisible to 'udevadm settle'. Internally 'cxl list' is performing a 'udevadm settle' and then flushing the follow on async work.