Lines Matching +full:secondary +full:- +full:device
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2022 Intel Corporation */
32 c->done++;
54 return -EINVAL;
60 hw_data->aerucm_mask = reg_val;
63 "Unable to find AER capability of the device\n");
64 return -ENODEV;
77 if (accel_dev->is_vf)
87 device_printf(GET_DEV(accel_dev), "Secondary bus reset\n");
114 "FLR qat_dev%d failed trying secondary bus reset\n",
115 accel_dev->accel_id);
122 struct adf_hw_device_data *hw_device = accel_dev->hw_device;
136 "Unable to find AER capability of the device\n");
139 if (hw_device->disable_arb) {
141 hw_device->disable_arb(accel_dev);
148 struct adf_hw_device_data *hw_device = accel_dev->hw_device;
155 hw_device->aerucm_mask,
159 "Unable to find AER capability of the device\n");
166 struct adf_hw_device_data *hw_device = accel_dev->hw_device;
169 if (hw_device->pre_reset) {
171 hw_device->pre_reset(accel_dev);
174 if (hw_device->reset_device) {
176 "Resetting device qat_dev%d\n",
177 accel_dev->accel_id);
178 hw_device->reset_device(accel_dev);
183 if (hw_device->post_reset) {
185 hw_device->post_reset(accel_dev);
194 struct adf_accel_dev *accel_dev = reset_data->accel_dev;
203 device_printf(GET_DEV(accel_dev), "Stopping device failed.\n");
210 /* The device hanged and we can't restart it */
212 device_printf(GET_DEV(accel_dev), "Restart device failed\n");
213 if (reset_data->mode == ADF_DEV_RESET_ASYNC)
215 WARN(1, "QAT: device restart failed. Device is unusable\n");
220 clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status);
223 if (reset_data->mode == ADF_DEV_RESET_SYNC)
224 complete(&reset_data->compl);
235 test_bit(ADF_STATUS_RESTARTING, &accel_dev->status))
237 set_bit(ADF_STATUS_RESTARTING, &accel_dev->status);
240 return -ENOMEM;
241 reset_data->accel_dev = accel_dev;
242 init_completion(&reset_data->compl);
243 reset_data->mode = mode;
244 INIT_WORK(&reset_data->reset_work, adf_device_reset_worker);
245 queue_work(device_reset_wq, &reset_data->reset_work);
249 /* Maximum device reset time is 10 seconds */
252 wait_for_completion_timeout(&reset_data->compl,
256 "Reset device timeout expired\n");
257 ret = -EFAULT;
268 if (accel_dev->autoreset_on_error)
278 struct adf_accel_dev *accel_dev = wq_data->accel_dev;
281 if (!accel_dev->is_vf) {
299 wq_data->accel_dev = accel_dev;
301 INIT_WORK(&wq_data->work, adf_notify_fatal_error_work);
302 queue_work(fatal_error_wq, &wq_data->work);
326 return !device_reset_wq ? -EFAULT : 0;