Skip to content

Commit 84f7586

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: firewire: core: check for 1394a compliant IRM, fix inaccessibility of Sony camcorder
2 parents 8d86dc6 + 1038953 commit 84f7586

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

‎drivers/firewire/core-card.c‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,15 @@ void fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
231231
static void fw_card_bm_work(struct work_struct *work)
232232
{
233233
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;
235235
struct fw_node *root_node;
236236
unsigned long flags;
237237
int root_id, new_root_id, irm_id, local_id;
238238
int gap_count, generation, grace, rcode;
239239
bool do_reset = false;
240240
bool root_device_is_running;
241241
bool root_device_is_cmc;
242+
bool irm_is_1394_1995_only;
242243

243244
spin_lock_irqsave(&card->lock, flags);
244245

@@ -248,12 +249,18 @@ static void fw_card_bm_work(struct work_struct *work)
248249
}
249250

250251
generation = card->generation;
252+
251253
root_node = card->root_node;
252254
fw_node_get(root_node);
253255
root_device = root_node->data;
254256
root_device_is_running = root_device &&
255257
atomic_read(&root_device->state) == FW_DEVICE_RUNNING;
256258
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+
257264
root_id = root_node->node_id;
258265
irm_id = card->irm_node->node_id;
259266
local_id = card->local_node->node_id;
@@ -276,8 +283,15 @@ static void fw_card_bm_work(struct work_struct *work)
276283

277284
if (!card->irm_node->link_on) {
278285
new_root_id = local_id;
279-
fw_notify("IRM has link off, making local node (%02x) root.\n",
280-
new_root_id);
286+
fw_notify("%s, making local node (%02x) root.\n",
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);
281295
goto pick_me;
282296
}
283297

@@ -316,8 +330,8 @@ static void fw_card_bm_work(struct work_struct *work)
316330
* root, and thus, IRM.
317331
*/
318332
new_root_id = local_id;
319-
fw_notify("BM lock failed, making local node (%02x) root.\n",
320-
new_root_id);
333+
fw_notify("%s, making local node (%02x) root.\n",
334+
"BM lock failed", new_root_id);
321335
goto pick_me;
322336
}
323337
} else if (card->bm_generation != generation) {

0 commit comments

Comments
 (0)