]> Git Repo - linux.git/commitdiff
tools/testing/cxl: Slow down the mock firmware transfer
authorVishal Verma <[email protected]>
Thu, 26 Oct 2023 17:32:41 +0000 (11:32 -0600)
committerDan Williams <[email protected]>
Fri, 27 Oct 2023 20:04:52 +0000 (13:04 -0700)
The cxl-cli unit test for firmware update does operations like starting
an asynchronous firmware update, making sure it is in progress, and
attempting to cancel it. In some cases, such as with no or minimal
dynamic debugging turned on, the firmware update completes too quickly,
not allowing the test to have a chance to verify it was in progress.
This caused a failure of the signature:

  expected fw_update_in_progress:true
  test/cxl-update-firmware.sh: failed at line 88

Fix this by adding a delay (~1.5 - 2 ms) to each firmware transfer
request handled by the mocked interface.

Reported-by: Dan Williams <[email protected]>
Tested-by: Dan Williams <[email protected]>
Signed-off-by: Vishal Verma <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dan Williams <[email protected]>
tools/testing/cxl/test/mem.c

index 76bdb1ac5816f863f9ee5b70a51acd2fec8a2067..75acc721c7631af01a63cd11afdb39a98ee41762 100644 (file)
@@ -1270,6 +1270,7 @@ static int mock_transfer_fw(struct cxl_mockmem_data *mdata,
        }
 
        memcpy(fw + offset, transfer->data, length);
+       usleep_range(1500, 2000);
        return 0;
 }
 
This page took 0.062854 seconds and 4 git commands to generate.