diff options
-rw-r--r-- | drivers/firewire/core-device.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index a3f486fbd7b7..4d460ef87161 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c | |||
@@ -1115,16 +1115,8 @@ static void fw_device_refresh(struct work_struct *work) | |||
1115 | bool changed; | 1115 | bool changed; |
1116 | 1116 | ||
1117 | ret = reread_config_rom(device, device->generation, &changed); | 1117 | ret = reread_config_rom(device, device->generation, &changed); |
1118 | if (ret != RCODE_COMPLETE) { | 1118 | if (ret != RCODE_COMPLETE) |
1119 | if (device->config_rom_retries < MAX_RETRIES / 2 && | 1119 | goto failed_config_rom; |
1120 | atomic_read(&device->state) == FW_DEVICE_INITIALIZING) { | ||
1121 | device->config_rom_retries++; | ||
1122 | fw_schedule_device_work(device, RETRY_DELAY / 2); | ||
1123 | |||
1124 | return; | ||
1125 | } | ||
1126 | goto give_up; | ||
1127 | } | ||
1128 | 1120 | ||
1129 | if (!changed) { | 1121 | if (!changed) { |
1130 | if (atomic_cmpxchg(&device->state, | 1122 | if (atomic_cmpxchg(&device->state, |
@@ -1144,16 +1136,8 @@ static void fw_device_refresh(struct work_struct *work) | |||
1144 | device_for_each_child(&device->device, NULL, shutdown_unit); | 1136 | device_for_each_child(&device->device, NULL, shutdown_unit); |
1145 | 1137 | ||
1146 | ret = read_config_rom(device, device->generation); | 1138 | ret = read_config_rom(device, device->generation); |
1147 | if (ret != RCODE_COMPLETE) { | 1139 | if (ret != RCODE_COMPLETE) |
1148 | if (device->config_rom_retries < MAX_RETRIES && | 1140 | goto failed_config_rom; |
1149 | atomic_read(&device->state) == FW_DEVICE_INITIALIZING) { | ||
1150 | device->config_rom_retries++; | ||
1151 | fw_schedule_device_work(device, RETRY_DELAY); | ||
1152 | |||
1153 | return; | ||
1154 | } | ||
1155 | goto give_up; | ||
1156 | } | ||
1157 | 1141 | ||
1158 | fw_device_cdev_update(device); | 1142 | fw_device_cdev_update(device); |
1159 | create_units(device); | 1143 | create_units(device); |
@@ -1170,7 +1154,14 @@ static void fw_device_refresh(struct work_struct *work) | |||
1170 | device->config_rom_retries = 0; | 1154 | device->config_rom_retries = 0; |
1171 | goto out; | 1155 | goto out; |
1172 | 1156 | ||
1173 | give_up: | 1157 | failed_config_rom: |
1158 | if (device->config_rom_retries < MAX_RETRIES && | ||
1159 | atomic_read(&device->state) == FW_DEVICE_INITIALIZING) { | ||
1160 | device->config_rom_retries++; | ||
1161 | fw_schedule_device_work(device, RETRY_DELAY); | ||
1162 | return; | ||
1163 | } | ||
1164 | |||
1174 | fw_notice(card, "giving up on refresh of device %s: %s\n", | 1165 | fw_notice(card, "giving up on refresh of device %s: %s\n", |
1175 | dev_name(&device->device), fw_rcode_string(ret)); | 1166 | dev_name(&device->device), fw_rcode_string(ret)); |
1176 | gone: | 1167 | gone: |