Hi, Tony, Thank you for your reply. > Spinning for 1ms was maybe ok. Spinning for up to 1s seems like a bad idea. > > This code is executed inside a mutex ... so maybe it is safe to sleep instead of spin? May the email Subject misled you. This code do NOT spin for 1 sec. The period of the spinning depends on the SPIN_UNIT. > -#define SPIN_UNIT 100 /* 100ns */ > -/* Firmware should respond within 1 milliseconds */ > -#define FIRMWARE_TIMEOUT (1 * NSEC_PER_MSEC) > +#define SPIN_UNIT 100 /* 100us */ > +/* Firmware should respond within 1 seconds */ > +#define FIRMWARE_TIMEOUT (1 * USEC_PER_SEC) The period was 100 ns and changed to 100 us now. In my opinion, spinning for 100 ns or 100 us is OK :) The timeout_default is set with FIRMWARE_TIMEOUT (1 sec) by default. If the platform do not respond within timeout_default after multiple spins, the OSPM will print a warning message to dmesg. Regards, Shuai On 2021/10/15 PM11:37, Luck, Tony wrote: >> We observe that the waiting time for DDR error injection is about 10 ms >> and that for PCIe error injection is about 500 ms in Arm platfrom. >> >> In this patch, we relax the response timeout to 1 second and allow user to >> pass the time out value as a argument. > > Spinning for 1ms was maybe ok. Spinning for up to 1s seems like a bad idea. > > This code is executed inside a mutex ... so maybe it is safe to sleep instead of spin? > > -Tony >