Commit a473d86c authored by Robert Elliott's avatar Robert Elliott Committed by James Bottomley

hpsa: print accurate SSD Smart Path Enabled status

offload_enabled changes are deferred until after the
added/updated prints occur, so the values are incorrect.

defer printing SSD Smart Path Enabled status information until the
information is correct
Reviewed-by: default avatarScott Teel <scott.teel@pmcs.com>
Reviewed-by: default avatarKevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Reviewed-by: default avatarHannes Reinecke <hare@Suse.de>
Signed-off-by: default avatarRobert Elliott <elliott@hp.com>
Signed-off-by: default avatarDon Brace <don.brace@pmcs.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 592a0ad5
...@@ -1060,12 +1060,12 @@ static int hpsa_scsi_add_entry(struct ctlr_info *h, int hostno, ...@@ -1060,12 +1060,12 @@ static int hpsa_scsi_add_entry(struct ctlr_info *h, int hostno,
h->dev[n] = device; h->dev[n] = device;
h->ndevices++; h->ndevices++;
device->offload_to_be_enabled = device->offload_enabled;
device->offload_enabled = 0;
added[*nadded] = device; added[*nadded] = device;
(*nadded)++; (*nadded)++;
hpsa_show_dev_msg(KERN_INFO, h, device, hpsa_show_dev_msg(KERN_INFO, h, device,
device->expose_state & HPSA_SCSI_ADD ? "added" : "masked"); device->expose_state & HPSA_SCSI_ADD ? "added" : "masked");
device->offload_to_be_enabled = device->offload_enabled;
device->offload_enabled = 0;
return 0; return 0;
} }
...@@ -1073,6 +1073,7 @@ static int hpsa_scsi_add_entry(struct ctlr_info *h, int hostno, ...@@ -1073,6 +1073,7 @@ static int hpsa_scsi_add_entry(struct ctlr_info *h, int hostno,
static void hpsa_scsi_update_entry(struct ctlr_info *h, int hostno, static void hpsa_scsi_update_entry(struct ctlr_info *h, int hostno,
int entry, struct hpsa_scsi_dev_t *new_entry) int entry, struct hpsa_scsi_dev_t *new_entry)
{ {
int offload_enabled;
/* assumes h->devlock is held */ /* assumes h->devlock is held */
BUG_ON(entry < 0 || entry >= HPSA_MAX_DEVICES); BUG_ON(entry < 0 || entry >= HPSA_MAX_DEVICES);
...@@ -1105,7 +1106,10 @@ static void hpsa_scsi_update_entry(struct ctlr_info *h, int hostno, ...@@ -1105,7 +1106,10 @@ static void hpsa_scsi_update_entry(struct ctlr_info *h, int hostno,
if (!new_entry->offload_enabled) if (!new_entry->offload_enabled)
h->dev[entry]->offload_enabled = 0; h->dev[entry]->offload_enabled = 0;
offload_enabled = h->dev[entry]->offload_enabled;
h->dev[entry]->offload_enabled = h->dev[entry]->offload_to_be_enabled;
hpsa_show_dev_msg(KERN_INFO, h, h->dev[entry], "updated"); hpsa_show_dev_msg(KERN_INFO, h, h->dev[entry], "updated");
h->dev[entry]->offload_enabled = offload_enabled;
} }
/* Replace an entry from h->dev[] array. */ /* Replace an entry from h->dev[] array. */
...@@ -1128,12 +1132,12 @@ static void hpsa_scsi_replace_entry(struct ctlr_info *h, int hostno, ...@@ -1128,12 +1132,12 @@ static void hpsa_scsi_replace_entry(struct ctlr_info *h, int hostno,
new_entry->lun = h->dev[entry]->lun; new_entry->lun = h->dev[entry]->lun;
} }
new_entry->offload_to_be_enabled = new_entry->offload_enabled;
new_entry->offload_enabled = 0;
h->dev[entry] = new_entry; h->dev[entry] = new_entry;
added[*nadded] = new_entry; added[*nadded] = new_entry;
(*nadded)++; (*nadded)++;
hpsa_show_dev_msg(KERN_INFO, h, new_entry, "replaced"); hpsa_show_dev_msg(KERN_INFO, h, new_entry, "replaced");
new_entry->offload_to_be_enabled = new_entry->offload_enabled;
new_entry->offload_enabled = 0;
} }
/* Remove an entry from h->dev[] array. */ /* Remove an entry from h->dev[] array. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment