File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,16 @@ static inline bool ers_result_indicates_abort(pci_ers_result_t ers_res)
59
59
}
60
60
}
61
61
62
- static bool is_passed_through (struct zpci_dev * zdev )
62
+ static bool is_passed_through (struct pci_dev * pdev )
63
63
{
64
- return zdev -> s390_domain ;
64
+ struct zpci_dev * zdev = to_zpci (pdev );
65
+ bool ret ;
66
+
67
+ mutex_lock (& zdev -> kzdev_lock );
68
+ ret = !!zdev -> kzdev ;
69
+ mutex_unlock (& zdev -> kzdev_lock );
70
+
71
+ return ret ;
65
72
}
66
73
67
74
static bool is_driver_supported (struct pci_driver * driver )
@@ -176,7 +183,7 @@ static pci_ers_result_t zpci_event_attempt_error_recovery(struct pci_dev *pdev)
176
183
}
177
184
pdev -> error_state = pci_channel_io_frozen ;
178
185
179
- if (is_passed_through (to_zpci ( pdev ) )) {
186
+ if (is_passed_through (pdev )) {
180
187
pr_info ("%s: Cannot be recovered in the host because it is a pass-through device\n" ,
181
188
pci_name (pdev ));
182
189
goto out_unlock ;
@@ -239,7 +246,7 @@ static void zpci_event_io_failure(struct pci_dev *pdev, pci_channel_state_t es)
239
246
* we will inject the error event and let the guest recover the device
240
247
* itself.
241
248
*/
242
- if (is_passed_through (to_zpci ( pdev ) ))
249
+ if (is_passed_through (pdev ))
243
250
goto out ;
244
251
driver = to_pci_driver (pdev -> dev .driver );
245
252
if (driver && driver -> err_handler && driver -> err_handler -> error_detected )
You can’t perform that action at this time.
0 commit comments