Forward-port DIOS patch from v3.11.