提交 0bcfc5ef 编写于 作者: C Cindy H Kao 提交者: Inaky Perez-Gonzalez

wimax/i2400m: use -EL3RST to indicate device reset instead of -ERESTARTSYS

When the i2400m device resets, the driver code will force some
functions to return a -ERESTARTSYS error code, which can is used by
the caller to determine which recovery actions to take.

However, in certain situations the only thing that can be done is to
bubble up said error code to user space, for handling.

However, -ERESTARSYS was a poor choice, as it is supposed to be used
by the kernel only.

As such, replace -ERESTARTSYS with -EL3RST; as well, in
i2400m_msg_to_dev(), when the device is in boot mode (following a
recent reset), return -EL3RST instead of -ENODEV (meaning the device
is in bootrom mode after a reset, not that the device was
disconnected, and thus, normal commands cannot be executed).
Signed-off-by: NCindy H Kao <cindy.h.kao@intel.com>
上级 8b5b30ee
...@@ -697,7 +697,7 @@ struct sk_buff *i2400m_msg_to_dev(struct i2400m *i2400m, ...@@ -697,7 +697,7 @@ struct sk_buff *i2400m_msg_to_dev(struct i2400m *i2400m,
rmb(); /* Make sure we see what i2400m_dev_reset_handle() */ rmb(); /* Make sure we see what i2400m_dev_reset_handle() */
if (i2400m->boot_mode) if (i2400m->boot_mode)
return ERR_PTR(-ENODEV); return ERR_PTR(-EL3RST);
msg_l3l4_hdr = buf; msg_l3l4_hdr = buf;
/* Check msg & payload consistency */ /* Check msg & payload consistency */
......
...@@ -453,7 +453,7 @@ int __i2400m_dev_start(struct i2400m *i2400m, enum i2400m_bri flags) ...@@ -453,7 +453,7 @@ int __i2400m_dev_start(struct i2400m *i2400m, enum i2400m_bri flags)
i2400m_tx_release(i2400m); i2400m_tx_release(i2400m);
error_tx_setup: error_tx_setup:
error_bootstrap: error_bootstrap:
if (result == -ERESTARTSYS && times-- > 0) { if (result == -EL3RST && times-- > 0) {
flags = I2400M_BRI_SOFT|I2400M_BRI_MAC_REINIT; flags = I2400M_BRI_SOFT|I2400M_BRI_MAC_REINIT;
goto retry; goto retry;
} }
...@@ -560,7 +560,7 @@ void __i2400m_dev_reset_handle(struct work_struct *ws) ...@@ -560,7 +560,7 @@ void __i2400m_dev_reset_handle(struct work_struct *ws)
* i2400m_dev_stop() [we are shutting down anyway, so * i2400m_dev_stop() [we are shutting down anyway, so
* ignore it] or we are resetting somewhere else. */ * ignore it] or we are resetting somewhere else. */
dev_err(dev, "device rebooted\n"); dev_err(dev, "device rebooted\n");
i2400m_msg_to_dev_cancel_wait(i2400m, -ERESTARTSYS); i2400m_msg_to_dev_cancel_wait(i2400m, -EL3RST);
complete(&i2400m->msg_completion); complete(&i2400m->msg_completion);
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册