summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2013-09-23 13:33:30 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-12-16 10:57:52 -0800
commit702890e3b910cd14c3d0ee3b4842d7e946e66b8d (patch)
tree8cb550f64d798007eb68c59c3e8af78b1283b25b /drivers/scsi/hpsa.c
parent6627b38fd902cd31c6ad52f9be12a17a38f0faef (diff)
downloadblackbird-op-linux-702890e3b910cd14c3d0ee3b4842d7e946e66b8d.tar.gz
blackbird-op-linux-702890e3b910cd14c3d0ee3b4842d7e946e66b8d.zip
[SCSI] hpsa: do not attempt to flush the cache on locked up controllers
There's no point in trying since it can't work, and if you do try, it will just hang the system on shutdown. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 20a5e6ecf945..c3db9bb1c235 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4942,6 +4942,15 @@ static void hpsa_flush_cache(struct ctlr_info *h)
{
char *flush_buf;
struct CommandList *c;
+ unsigned long flags;
+
+ /* Don't bother trying to flush the cache if locked up */
+ spin_lock_irqsave(&h->lock, flags);
+ if (unlikely(h->lockup_detected)) {
+ spin_unlock_irqrestore(&h->lock, flags);
+ return;
+ }
+ spin_unlock_irqrestore(&h->lock, flags);
flush_buf = kzalloc(4, GFP_KERNEL);
if (!flush_buf)
OpenPOWER on IntegriCloud