Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5f48047756339065df3e6fead381978abb0bc557
Commit:     5f48047756339065df3e6fead381978abb0bc557
Parent:     e254a4b45f265d9df120b83d5c2c9437902b601b
Author:     Kristian Høgsberg <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 7 12:12:39 2007 -0500
Committer:  Stefan Richter <[EMAIL PROTECTED]>
CommitDate: Fri Mar 9 22:03:07 2007 +0100

    firewire: Iterate through units in a keventd callback for update callbacks.
    
    We can't take the klist lock for the child device list in interrupt
    context.
    
    Signed-off-by: Kristian Høgsberg <[EMAIL PROTECTED]>
    Signed-off-by: Stefan Richter <[EMAIL PROTECTED]>
---
 drivers/firewire/fw-device.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index e8f2dc3..5599265 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -530,6 +530,14 @@ static int update_unit(struct device *dev, void *data)
        return 0;
 }
 
+static void fw_device_update(struct work_struct *work)
+{
+       struct fw_device *device =
+               container_of(work, struct fw_device, work.work);
+
+       device_for_each_child(&device->device, NULL, update_unit);
+}
+
 void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
 {
        struct fw_device *device;
@@ -577,7 +585,10 @@ void fw_node_event(struct fw_card *card, struct fw_node 
*node, int event)
                device = node->data;
                device->node_id = node->node_id;
                device->generation = card->generation;
-               device_for_each_child(&device->device, NULL, update_unit);
+               if (atomic_read(&device->state) == FW_DEVICE_RUNNING) {
+                       PREPARE_DELAYED_WORK(&device->work, fw_device_update);
+                       schedule_delayed_work(&device->work, 0);
+               }
                break;
 
        case FW_NODE_DESTROYED:
@@ -597,8 +608,8 @@ void fw_node_event(struct fw_card *card, struct fw_node 
*node, int event)
                 * to create the device. */
                device = node->data;
                if (atomic_xchg(&device->state,
-                        FW_DEVICE_SHUTDOWN) == FW_DEVICE_RUNNING) {
-                       INIT_DELAYED_WORK(&device->work, fw_device_shutdown);
+                               FW_DEVICE_SHUTDOWN) == FW_DEVICE_RUNNING) {
+                       PREPARE_DELAYED_WORK(&device->work, fw_device_shutdown);
                        schedule_delayed_work(&device->work, 0);
                }
                break;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to