diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-01-24 14:35:38 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-01-24 14:40:12 -0500 |
commit | e747a5c0be3efe5465e45c8e326bc766b1288be6 (patch) | |
tree | a9abc47b46e079e38f4477f858dd6ddd791c546c /drivers/firewire/fw-device.c | |
parent | 64c634ef83991b390ec0503e61f16efb0ba3c60b (diff) |
firewire: core: optimize card shutdown
This fixes a regression by "firewire: keep highlevel drivers attached
during brief connection loss": There were 2 seconds unnecessary waiting
added to the shutdown procedure of each controller.
We use card->link as status flag to signal the device handler that there
is no use to wait for a come-back.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-device.c')
-rw-r--r-- | drivers/firewire/fw-device.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c index 0925d91b2610..bf53acb45652 100644 --- a/drivers/firewire/fw-device.c +++ b/drivers/firewire/fw-device.c | |||
@@ -657,7 +657,8 @@ static void fw_device_shutdown(struct work_struct *work) | |||
657 | container_of(work, struct fw_device, work.work); | 657 | container_of(work, struct fw_device, work.work); |
658 | int minor = MINOR(device->device.devt); | 658 | int minor = MINOR(device->device.devt); |
659 | 659 | ||
660 | if (time_is_after_jiffies(device->card->reset_jiffies + SHUTDOWN_DELAY)) { | 660 | if (time_is_after_jiffies(device->card->reset_jiffies + SHUTDOWN_DELAY) |
661 | && !list_empty(&device->card->link)) { | ||
661 | schedule_delayed_work(&device->work, SHUTDOWN_DELAY); | 662 | schedule_delayed_work(&device->work, SHUTDOWN_DELAY); |
662 | return; | 663 | return; |
663 | } | 664 | } |
@@ -1074,7 +1075,8 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event) | |||
1074 | if (atomic_xchg(&device->state, | 1075 | if (atomic_xchg(&device->state, |
1075 | FW_DEVICE_GONE) == FW_DEVICE_RUNNING) { | 1076 | FW_DEVICE_GONE) == FW_DEVICE_RUNNING) { |
1076 | PREPARE_DELAYED_WORK(&device->work, fw_device_shutdown); | 1077 | PREPARE_DELAYED_WORK(&device->work, fw_device_shutdown); |
1077 | schedule_delayed_work(&device->work, SHUTDOWN_DELAY); | 1078 | schedule_delayed_work(&device->work, |
1079 | list_empty(&card->link) ? 0 : SHUTDOWN_DELAY); | ||
1078 | } | 1080 | } |
1079 | break; | 1081 | break; |
1080 | } | 1082 | } |