summaryrefslogtreecommitdiff
path: root/drivers/scsi/libsas/sas_internal.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2007-01-12 01:15:43 +0300
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-01-14 01:21:53 +0300
commit6b0efb8516a5298e12033df61f9e0c376a306adb (patch)
tree3f63587167905e86de330fb28219dbfb309aad9a /drivers/scsi/libsas/sas_internal.h
parent980fa2f9d64b9be96107c89e165953ace311af54 (diff)
downloadlinux-6b0efb8516a5298e12033df61f9e0c376a306adb.tar.xz
[SCSI] libsas: Add SAS_HA state flags to avoid queueing events while unloading
Track sas_ha_struct state so that we ignore events that come in while we're shutting things down. Signed-off-by: Malahal Naineni <malahal@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_internal.h')
-rw-r--r--drivers/scsi/libsas/sas_internal.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h
index 137d7e496b6d..a78638df2018 100644
--- a/drivers/scsi/libsas/sas_internal.h
+++ b/drivers/scsi/libsas/sas_internal.h
@@ -80,7 +80,7 @@ void sas_hae_reset(struct work_struct *work);
static inline void sas_queue_event(int event, spinlock_t *lock,
unsigned long *pending,
struct work_struct *work,
- struct Scsi_Host *shost)
+ struct sas_ha_struct *sas_ha)
{
unsigned long flags;
@@ -91,7 +91,12 @@ static inline void sas_queue_event(int event, spinlock_t *lock,
}
__set_bit(event, pending);
spin_unlock_irqrestore(lock, flags);
- scsi_queue_work(shost, work);
+
+ spin_lock_irqsave(&sas_ha->state_lock, flags);
+ if (sas_ha->state != SAS_HA_UNREGISTERED) {
+ scsi_queue_work(sas_ha->core.shost, work);
+ }
+ spin_unlock_irqrestore(&sas_ha->state_lock, flags);
}
static inline void sas_begin_event(int event, spinlock_t *lock,