Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx5/mlx5_core/mlx5_main.c
Show First 20 Lines • Show All 755 Lines • ▼ Show 20 Lines | |||||
static inline int fw_initializing(struct mlx5_core_dev *dev) | static inline int fw_initializing(struct mlx5_core_dev *dev) | ||||
{ | { | ||||
return ioread32be(&dev->iseg->initializing) >> 31; | return ioread32be(&dev->iseg->initializing) >> 31; | ||||
} | } | ||||
static int wait_fw_init(struct mlx5_core_dev *dev, u32 max_wait_mili, | static int wait_fw_init(struct mlx5_core_dev *dev, u32 max_wait_mili, | ||||
u32 warn_time_mili) | u32 warn_time_mili) | ||||
{ | { | ||||
int warn = jiffies + msecs_to_jiffies(warn_time_mili); | unsigned long warn = jiffies + msecs_to_jiffies(warn_time_mili); | ||||
int end = jiffies + msecs_to_jiffies(max_wait_mili); | unsigned long end = jiffies + msecs_to_jiffies(max_wait_mili); | ||||
int err = 0; | int err = 0; | ||||
MPASS(max_wait_mili > warn_time_mili); | MPASS(max_wait_mili > warn_time_mili); | ||||
while (fw_initializing(dev) == 1) { | while (fw_initializing(dev) == 1) { | ||||
if (time_after(jiffies, end)) { | if (time_after(jiffies, end)) { | ||||
err = -EBUSY; | err = -EBUSY; | ||||
break; | break; | ||||
} | } | ||||
if (warn_time_mili && time_after(jiffies, warn)) { | if (warn_time_mili && time_after(jiffies, warn)) { | ||||
mlx5_core_warn(dev, | mlx5_core_warn(dev, | ||||
"Waiting for FW initialization, timeout abort in %u s\n", | "Waiting for FW initialization, timeout abort in %lu s\n", | ||||
(unsigned)(jiffies_to_msecs(end - warn) / 1000)); | (unsigned long)(jiffies_to_msecs(end - warn) / 1000)); | ||||
warn = jiffies + msecs_to_jiffies(warn_time_mili); | warn = jiffies + msecs_to_jiffies(warn_time_mili); | ||||
} | } | ||||
msleep(FW_INIT_WAIT_MS); | msleep(FW_INIT_WAIT_MS); | ||||
} | } | ||||
if (err != 0) | if (err != 0) | ||||
mlx5_core_dbg(dev, "Full initializing bit dword = 0x%x\n", | mlx5_core_dbg(dev, "Full initializing bit dword = 0x%x\n", | ||||
ioread32be(&dev->iseg->initializing)); | ioread32be(&dev->iseg->initializing)); | ||||
▲ Show 20 Lines • Show All 1,419 Lines • Show Last 20 Lines |