Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3d269cb50c81d3bb01d5856d5157d4db346bab4b
Commit:     3d269cb50c81d3bb01d5856d5157d4db346bab4b
Parent:     2446a79f4f0a5e88e5d8316dac407d66ac10f70d
Author:     Stefan Richter <[EMAIL PROTECTED]>
AuthorDate: Sun Feb 4 20:57:38 2007 +0100
Committer:  Stefan Richter <[EMAIL PROTECTED]>
CommitDate: Mon Apr 30 00:00:27 2007 +0200

    ieee1394: sbp2: move some memory allocations into non-atomic context
    
    When the command ORB pool is created, the ORB list won't be accessed
    concurrently.  Therefore we don't have to take the spinlock there.
    
    Signed-off-by: Stefan Richter <[EMAIL PROTECTED]>
---
 drivers/ieee1394/sbp2.c |   20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index cae3816..8c471ca 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -469,19 +469,13 @@ static void sbp2util_write_doorbell(struct work_struct 
*work)
 static int sbp2util_create_command_orb_pool(struct sbp2_lu *lu)
 {
        struct sbp2_fwhost_info *hi = lu->hi;
-       int i;
-       unsigned long flags, orbs;
        struct sbp2_command_info *cmd;
+       int i, orbs = sbp2_serialize_io ? 2 : SBP2_MAX_CMDS;
 
-       orbs = sbp2_serialize_io ? 2 : SBP2_MAX_CMDS;
-
-       spin_lock_irqsave(&lu->cmd_orb_lock, flags);
        for (i = 0; i < orbs; i++) {
-               cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC);
-               if (!cmd) {
-                       spin_unlock_irqrestore(&lu->cmd_orb_lock, flags);
+               cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
+               if (!cmd)
                        return -ENOMEM;
-               }
                cmd->command_orb_dma = dma_map_single(hi->host->device.parent,
                                                &cmd->command_orb,
                                                sizeof(struct sbp2_command_orb),
@@ -493,7 +487,6 @@ static int sbp2util_create_command_orb_pool(struct sbp2_lu 
*lu)
                INIT_LIST_HEAD(&cmd->list);
                list_add_tail(&cmd->list, &lu->cmd_orb_completed);
        }
-       spin_unlock_irqrestore(&lu->cmd_orb_lock, flags);
        return 0;
 }
 
@@ -870,11 +863,8 @@ static int sbp2_start_device(struct sbp2_lu *lu)
        if (!lu->login_orb)
                goto alloc_fail;
 
-       if (sbp2util_create_command_orb_pool(lu)) {
-               SBP2_ERR("sbp2util_create_command_orb_pool failed!");
-               sbp2_remove_device(lu);
-               return -ENOMEM;
-       }
+       if (sbp2util_create_command_orb_pool(lu))
+               goto alloc_fail;
 
        /* Wait a second before trying to log in. Previously logged in
         * initiators need a chance to reconnect. */
-
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