| .. | .. |
|---|
| 63 | 63 | |
|---|
| 64 | 64 | pci_assign_unassigned_bridge_resources(bridge); |
|---|
| 65 | 65 | pcie_bus_configure_settings(parent); |
|---|
| 66 | + |
|---|
| 67 | + /* |
|---|
| 68 | + * Release reset_lock during driver binding |
|---|
| 69 | + * to avoid AB-BA deadlock with device_lock. |
|---|
| 70 | + */ |
|---|
| 71 | + up_read(&ctrl->reset_lock); |
|---|
| 66 | 72 | pci_bus_add_devices(parent); |
|---|
| 73 | + down_read_nested(&ctrl->reset_lock, ctrl->depth); |
|---|
| 67 | 74 | |
|---|
| 68 | 75 | out: |
|---|
| 69 | 76 | pci_unlock_rescan_remove(); |
|---|
| .. | .. |
|---|
| 104 | 111 | list_for_each_entry_safe_reverse(dev, temp, &parent->devices, |
|---|
| 105 | 112 | bus_list) { |
|---|
| 106 | 113 | pci_dev_get(dev); |
|---|
| 114 | + |
|---|
| 115 | + /* |
|---|
| 116 | + * Release reset_lock during driver unbinding |
|---|
| 117 | + * to avoid AB-BA deadlock with device_lock. |
|---|
| 118 | + */ |
|---|
| 119 | + up_read(&ctrl->reset_lock); |
|---|
| 107 | 120 | pci_stop_and_remove_bus_device(dev); |
|---|
| 121 | + down_read_nested(&ctrl->reset_lock, ctrl->depth); |
|---|
| 122 | + |
|---|
| 108 | 123 | /* |
|---|
| 109 | 124 | * Ensure that no new Requests will be generated from |
|---|
| 110 | 125 | * the device. |
|---|