Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b2a7a4ba0497f73295e3f4d20a8cedb1e3d2b1a7
Commit:     b2a7a4ba0497f73295e3f4d20a8cedb1e3d2b1a7
Parent:     349d2c44291d922614a273e9a4e6b43ee17c103d
Author:     Matthew Wilcox <[EMAIL PROTECTED]>
AuthorDate: Sun Sep 9 08:56:35 2007 -0600
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:47:59 2007 -0400

    [SCSI] advansys: Enable interrupts earlier in queuecommand
    
    Move as much as possible outside the critical section in queuecommand, eg:
     - Set the scsi_done field before acquiring the lock
     - Call asc_scsi_done after dropping the lock
    
    Also remove a comment suggesting we should enable interrupts (now we do)
    and do some minor reformatting for readability.
    
    Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/advansys.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 67cdfe6..d7bc0cf 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -3176,23 +3176,24 @@ static void asc_scsi_done(struct scsi_cmnd *scp)
  * in the 'scp' result field.
  */
 static int
-advansys_queuecommand(struct scsi_cmnd *scp, void (*done) (struct scsi_cmnd *))
+advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
 {
-       struct Scsi_Host *shost;
-       asc_board_t *boardp;
-       ulong flags;
+       struct Scsi_Host *shost = scp->device->host;
+       asc_board_t *boardp = ASC_BOARDP(shost);
+       unsigned long flags;
        int asc_res, result = 0;
 
-       shost = scp->device->host;
-       boardp = ASC_BOARDP(shost);
        ASC_STATS(shost, queuecommand);
+       scp->scsi_done = done;
 
-       /* host_lock taken by mid-level prior to call but need to protect */
-       /* against own ISR */
+       /*
+        * host_lock taken by mid-level prior to call, but need
+        * to protect against own ISR
+        */
        spin_lock_irqsave(&boardp->lock, flags);
-
-       scp->scsi_done = done;
        asc_res = asc_execute_scsi_cmnd(scp);
+       spin_unlock_irqrestore(&boardp->lock, flags);
+
        switch (asc_res) {
        case ASC_NOERROR:
                break;
@@ -3201,11 +3202,9 @@ advansys_queuecommand(struct scsi_cmnd *scp, void 
(*done) (struct scsi_cmnd *))
                break;
        case ASC_ERROR:
        default:
-               /* Interrupts could be enabled here. */
                asc_scsi_done(scp);
                break;
        }
-       spin_unlock_irqrestore(&boardp->lock, flags);
 
        return result;
 }
-
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