WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] pvSCSI: More fixes (including locking

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] pvSCSI: More fixes (including locking cleanups)
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Jul 2008 09:30:19 -0700
Delivery-date: Tue, 15 Jul 2008 09:30:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1216026944 -3600
# Node ID e0c15322ff6d6d1fe5277b36018e4c2e4563ead1
# Parent  1bd3dbfdaf0f96bd8fe572d9a262983d9490e3b9
pvSCSI: More fixes (including locking cleanups)

Signed-off-by: Tomonari Horikoshi <t.horikoshi@xxxxxxxxxxxxxx>
Signed-off-by: Jun Kamada <kama@xxxxxxxxxxxxxx>
---
 drivers/xen/scsifront/common.h    |    3 ---
 drivers/xen/scsifront/scsifront.c |   31 +++++++++++--------------------
 drivers/xen/scsifront/xenbus.c    |    2 --
 3 files changed, 11 insertions(+), 25 deletions(-)

diff -r 1bd3dbfdaf0f -r e0c15322ff6d drivers/xen/scsifront/common.h
--- a/drivers/xen/scsifront/common.h    Fri Jul 11 15:34:33 2008 +0100
+++ b/drivers/xen/scsifront/common.h    Mon Jul 14 10:15:44 2008 +0100
@@ -112,9 +112,6 @@ struct vscsifrnt_info {
        struct task_struct *kthread;
        wait_queue_head_t wq;
        unsigned int waiting_resp;
-       
-       /* abort reset condition bit*/
-       atomic_t abort_reset_cond;
 
 };
 
diff -r 1bd3dbfdaf0f -r e0c15322ff6d drivers/xen/scsifront/scsifront.c
--- a/drivers/xen/scsifront/scsifront.c Fri Jul 11 15:34:33 2008 +0100
+++ b/drivers/xen/scsifront/scsifront.c Mon Jul 14 10:15:44 2008 +0100
@@ -146,12 +146,7 @@ static void scsifront_cdb_cmd_done(struc
        scsifront_gnttab_done(&info->shadow[id], id);
        add_id_to_freelist(info, id);
 
-       if (atomic_read(&info->abort_reset_cond) == VSCSI_IN_RESET) {
-               sc->result = (DID_RESET << 16);
-       } else {
-               sc->result = ring_res->rslt;
-       }
-
+       sc->result = ring_res->rslt;
        sc->resid  = 0;
 
        if (ring_res->sense_len > VSCSIIF_SENSE_BUFFERSIZE)
@@ -432,22 +427,18 @@ static int scsifront_dev_reset_handler(s
                (struct vscsifrnt_info *) sc->device->host->hostdata;
 
        vscsiif_request_t *ring_req;
+       uint16_t rqid;
        int err;
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
        spin_lock_irq(host->host_lock);
 #endif
 
-       atomic_set(&info->abort_reset_cond, VSCSI_IN_RESET);
-       while (RING_HAS_UNCONSUMED_RESPONSES(&info->ring)) {
-               if (!scsifront_cmd_done(info))
-                       break;
-       }
-
        ring_req      = scsifront_pre_request(info);
        ring_req->act = VSCSIIF_ACT_SCSI_RESET;
 
-       info->shadow[ring_req->rqid].act = VSCSIIF_ACT_SCSI_RESET;
+       rqid          = ring_req->rqid;
+       info->shadow[rqid].act = VSCSIIF_ACT_SCSI_RESET;
 
        ring_req->channel = sc->device->channel;
        ring_req->id      = sc->device->id;
@@ -463,20 +454,20 @@ static int scsifront_dev_reset_handler(s
        ring_req->timeout_per_command = (sc->timeout_per_command / HZ);
        ring_req->nr_segments         = 0;
 
+       scsifront_do_request(info);     
+
        spin_unlock_irq(host->host_lock);
-       scsifront_do_request(info);     
-       wait_event_interruptible(info->shadow[ring_req->rqid].wq_reset,
-                        info->shadow[ring_req->rqid].wait_reset);
-
+       wait_event_interruptible(info->shadow[rqid].wq_reset,
+                        info->shadow[rqid].wait_reset);
        spin_lock_irq(host->host_lock);
 
-       err = info->shadow[ring_req->rqid].rslt_reset;
-       atomic_set(&info->abort_reset_cond, 0);
+       err = info->shadow[rqid].rslt_reset;
+
+       add_id_to_freelist(info, rqid);
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
        spin_unlock_irq(host->host_lock);
 #endif
-
        return (err);
 }
 
diff -r 1bd3dbfdaf0f -r e0c15322ff6d drivers/xen/scsifront/xenbus.c
--- a/drivers/xen/scsifront/xenbus.c    Fri Jul 11 15:34:33 2008 +0100
+++ b/drivers/xen/scsifront/xenbus.c    Mon Jul 14 10:15:44 2008 +0100
@@ -195,8 +195,6 @@ static int scsifront_probe(struct xenbus
        }
        info->shadow[VSCSIIF_MAX_REQS - 1].next_free = 0x0fff;
 
-       atomic_set(&info->abort_reset_cond, 0);
-
        err = scsifront_init_ring(info);
        if (err) {
                scsi_host_put(host);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] pvSCSI: More fixes (including locking cleanups), Xen patchbot-linux-2.6.18-xen <=