Lines Matching +full:retain +full:- +full:on +full:- +full:reset
15 * - Redistributions of source code must retain the above
19 * - Redistributions in binary form must reproduce the above
48 "Reset device on internal errors if non-zero (default 1)");
55 ret = pci_read_config_word(dev->persist->pdev, 0, &vendor_id); in read_vendor_id()
63 return -EINVAL; in read_vendor_id()
76 if (!pci_channel_offline(dev->persist->pdev)) { in mlx4_reset_master()
79 * link was disabled and chip was already reset. in mlx4_reset_master()
86 mlx4_err(dev, "Fail to reset HCA\n"); in mlx4_reset_master()
103 if (pci_channel_offline(dev->persist->pdev)) in mlx4_reset_slave()
106 comm_flags = swab32(readl((__iomem char *)priv->mfunc.comm + in mlx4_reset_slave()
109 mlx4_err(dev, "VF reset is not needed\n"); in mlx4_reset_slave()
113 if (!(dev->caps.vf_caps & MLX4_VF_CAP_FLAG_RESET)) { in mlx4_reset_slave()
114 mlx4_err(dev, "VF reset is not supported\n"); in mlx4_reset_slave()
115 return -EOPNOTSUPP; in mlx4_reset_slave()
123 mlx4_err(dev, "Communication channel isn't sync, fail to send reset\n"); in mlx4_reset_slave()
124 return -EIO; in mlx4_reset_slave()
128 mlx4_warn(dev, "VF is sending reset request to Firmware\n"); in mlx4_reset_slave()
131 (__iomem char *)priv->mfunc.comm + MLX4_COMM_CHAN_FLAGS); in mlx4_reset_slave()
135 comm_flags = swab32(readl((__iomem char *)priv->mfunc.comm + in mlx4_reset_slave()
141 * be reset at any time by the PF and all its bits will be in mlx4_reset_slave()
148 mlx4_warn(dev, "VF Reset succeed\n"); in mlx4_reset_slave()
153 mlx4_err(dev, "Fail to send reset over the communication channel\n"); in mlx4_reset_slave()
154 return -ETIMEDOUT; in mlx4_reset_slave()
171 mutex_lock(&persist->device_state_mutex); in mlx4_enter_error_state()
172 if (persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) in mlx4_enter_error_state()
175 dev = persist->dev; in mlx4_enter_error_state()
176 mlx4_err(dev, "device is going to be reset\n"); in mlx4_enter_error_state()
185 mlx4_err(dev, "device was reset successfully\n"); in mlx4_enter_error_state()
187 /* EEH could have disabled the PCI channel during reset. That's in mlx4_enter_error_state()
190 if (!pci_channel_offline(dev->persist->pdev)) in mlx4_enter_error_state()
193 dev->persist->state |= MLX4_DEVICE_STATE_INTERNAL_ERROR; in mlx4_enter_error_state()
194 mutex_unlock(&persist->device_state_mutex); in mlx4_enter_error_state()
196 /* At that step HW was already reset, now notify clients */ in mlx4_enter_error_state()
202 mutex_unlock(&persist->device_state_mutex); in mlx4_enter_error_state()
207 struct mlx4_dev *dev = persist->dev; in mlx4_handle_error_state()
214 mutex_lock(&persist->interface_state_mutex); in mlx4_handle_error_state()
215 if (persist->interface_state & MLX4_INTERFACE_STATE_UP && in mlx4_handle_error_state()
216 !(persist->interface_state & MLX4_INTERFACE_STATE_DELETION)) { in mlx4_handle_error_state()
217 err = mlx4_restart_one(persist->pdev); in mlx4_handle_error_state()
218 mlx4_info(persist->dev, "mlx4_restart_one was ended, ret=%d\n", in mlx4_handle_error_state()
221 mutex_unlock(&persist->interface_state_mutex); in mlx4_handle_error_state()
232 for (i = 0; i < priv->fw.catas_size; ++i) in dump_err_buf()
234 i, swab32(readl(priv->catas_err.map + i))); in dump_err_buf()
240 struct mlx4_dev *dev = &priv->dev; in poll_catas()
244 slave_read = swab32(readl(&priv->mfunc.comm->slave_read)); in poll_catas()
246 mlx4_warn(dev, "Internal error detected on the communication channel\n"); in poll_catas()
249 } else if (readl(priv->catas_err.map)) { in poll_catas()
254 if (dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) { in poll_catas()
255 mlx4_warn(dev, "Internal error mark was detected on device\n"); in poll_catas()
259 mod_timer(&priv->catas_err.timer, in poll_catas()
265 queue_work(dev->persist->catas_wq, &dev->persist->catas_work); in poll_catas()
282 INIT_LIST_HEAD(&priv->catas_err.list); in mlx4_start_catas_poll()
283 timer_setup(&priv->catas_err.timer, poll_catas, 0); in mlx4_start_catas_poll()
284 priv->catas_err.map = NULL; in mlx4_start_catas_poll()
287 addr = pci_resource_start(dev->persist->pdev, in mlx4_start_catas_poll()
288 priv->fw.catas_bar) + in mlx4_start_catas_poll()
289 priv->fw.catas_offset; in mlx4_start_catas_poll()
291 priv->catas_err.map = ioremap(addr, priv->fw.catas_size * 4); in mlx4_start_catas_poll()
292 if (!priv->catas_err.map) { in mlx4_start_catas_poll()
299 priv->catas_err.timer.expires = in mlx4_start_catas_poll()
301 add_timer(&priv->catas_err.timer); in mlx4_start_catas_poll()
308 del_timer_sync(&priv->catas_err.timer); in mlx4_stop_catas_poll()
310 if (priv->catas_err.map) { in mlx4_stop_catas_poll()
311 iounmap(priv->catas_err.map); in mlx4_stop_catas_poll()
312 priv->catas_err.map = NULL; in mlx4_stop_catas_poll()
315 if (dev->persist->interface_state & MLX4_INTERFACE_STATE_DELETION) in mlx4_stop_catas_poll()
316 flush_workqueue(dev->persist->catas_wq); in mlx4_stop_catas_poll()
321 INIT_WORK(&dev->persist->catas_work, catas_reset); in mlx4_catas_init()
322 dev->persist->catas_wq = create_singlethread_workqueue("mlx4_health"); in mlx4_catas_init()
323 if (!dev->persist->catas_wq) in mlx4_catas_init()
324 return -ENOMEM; in mlx4_catas_init()
331 if (dev->persist->catas_wq) { in mlx4_catas_end()
332 destroy_workqueue(dev->persist->catas_wq); in mlx4_catas_end()
333 dev->persist->catas_wq = NULL; in mlx4_catas_end()