aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/core-card.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
index 9dcb30466ec0..371713ff0266 100644
--- a/drivers/firewire/core-card.c
+++ b/drivers/firewire/core-card.c
@@ -231,7 +231,7 @@ void fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
231static void fw_card_bm_work(struct work_struct *work) 231static void fw_card_bm_work(struct work_struct *work)
232{ 232{
233 struct fw_card *card = container_of(work, struct fw_card, work.work); 233 struct fw_card *card = container_of(work, struct fw_card, work.work);
234 struct fw_device *root_device; 234 struct fw_device *root_device, *irm_device;
235 struct fw_node *root_node; 235 struct fw_node *root_node;
236 unsigned long flags; 236 unsigned long flags;
237 int root_id, new_root_id, irm_id, local_id; 237 int root_id, new_root_id, irm_id, local_id;
@@ -239,6 +239,7 @@ static void fw_card_bm_work(struct work_struct *work)
239 bool do_reset = false; 239 bool do_reset = false;
240 bool root_device_is_running; 240 bool root_device_is_running;
241 bool root_device_is_cmc; 241 bool root_device_is_cmc;
242 bool irm_is_1394_1995_only;
242 243
243 spin_lock_irqsave(&card->lock, flags); 244 spin_lock_irqsave(&card->lock, flags);
244 245
@@ -248,12 +249,18 @@ static void fw_card_bm_work(struct work_struct *work)
248 } 249 }
249 250
250 generation = card->generation; 251 generation = card->generation;
252
251 root_node = card->root_node; 253 root_node = card->root_node;
252 fw_node_get(root_node); 254 fw_node_get(root_node);
253 root_device = root_node->data; 255 root_device = root_node->data;
254 root_device_is_running = root_device && 256 root_device_is_running = root_device &&
255 atomic_read(&root_device->state) == FW_DEVICE_RUNNING; 257 atomic_read(&root_device->state) == FW_DEVICE_RUNNING;
256 root_device_is_cmc = root_device && root_device->cmc; 258 root_device_is_cmc = root_device && root_device->cmc;
259
260 irm_device = card->irm_node->data;
261 irm_is_1394_1995_only = irm_device && irm_device->config_rom &&
262 (irm_device->config_rom[2] & 0x000000f0) == 0;
263
257 root_id = root_node->node_id; 264 root_id = root_node->node_id;
258 irm_id = card->irm_node->node_id; 265 irm_id = card->irm_node->node_id;
259 local_id = card->local_node->node_id; 266 local_id = card->local_node->node_id;
@@ -276,8 +283,15 @@ static void fw_card_bm_work(struct work_struct *work)
276 283
277 if (!card->irm_node->link_on) { 284 if (!card->irm_node->link_on) {
278 new_root_id = local_id; 285 new_root_id = local_id;
279 fw_notify("IRM has link off, making local node (%02x) root.\n", 286 fw_notify("%s, making local node (%02x) root.\n",
280 new_root_id); 287 "IRM has link off", new_root_id);
288 goto pick_me;
289 }
290
291 if (irm_is_1394_1995_only) {
292 new_root_id = local_id;
293 fw_notify("%s, making local node (%02x) root.\n",
294 "IRM is not 1394a compliant", new_root_id);
281 goto pick_me; 295 goto pick_me;
282 } 296 }
283 297
@@ -316,8 +330,8 @@ static void fw_card_bm_work(struct work_struct *work)
316 * root, and thus, IRM. 330 * root, and thus, IRM.
317 */ 331 */
318 new_root_id = local_id; 332 new_root_id = local_id;
319 fw_notify("BM lock failed, making local node (%02x) root.\n", 333 fw_notify("%s, making local node (%02x) root.\n",
320 new_root_id); 334 "BM lock failed", new_root_id);
321 goto pick_me; 335 goto pick_me;
322 } 336 }
323 } else if (card->bm_generation != generation) { 337 } else if (card->bm_generation != generation) {