diff --git a/qla_isp/common/isp.c b/qla_isp/common/isp.c index 76ab50787..03c499fe8 100644 --- a/qla_isp/common/isp.c +++ b/qla_isp/common/isp.c @@ -2630,6 +2630,14 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay) ISP_SLEEP(isp, wrk); } else { while (enano > (uint64_t) 4000000000U) { +#if defined(__GNUC__) && (__GNUC__ >= 4) + /* + * Prevent to optimize loop, gcc assume libgcc.a + * with __udivdi3 is linked, but this is not + * true when building (linux) kernel + */ + asm("" : "+rm" (enano)); +#endif count += 4000000; enano -= (uint64_t) 4000000000U; }