* [PATCH 0/2] Fix a couple hpsa bugs related to device discovery
@ 2010-12-16 19:00 Stephen M. Cameron
  2010-12-16 19:00 ` [PATCH 1/2] hpsa: do not consider firmware revision when looking for device changes Stephen M. Cameron
  2010-12-16 19:01 ` [PATCH 2/2] hpsa: do not consider RAID level to be part of device identity Stephen M. Cameron
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen M. Cameron @ 2010-12-16 19:00 UTC (permalink / raw)
  To: james.bottomley
  Cc: linux-scsi, mike.miller, linux-kernel, thenzl, akpm, smcameron
This series fixes a couple of bugs related to discovering changes to
devices.  1) We should not consider a firmware change to mean the
device identity has changed.  Just because a logical drive's firmware
changes doesn't mean it's not the same drive with the same data, so
it should not be removed and re-added to the scsi mid layer.
2) Likewise if the RAID level is observed to change.  This can happen
for instance by doing a RAID level migration from with the Array
Configuration Utility. 
---
Stephen M. Cameron (2):
      hpsa: do not consider firmware revision when looking for device changes.
      hpsa: do not consider RAID level to be part of device identity
 drivers/scsi/hpsa.c |   11 -----------
 drivers/scsi/hpsa.h |    1 -
 2 files changed, 0 insertions(+), 12 deletions(-)
-- 
-- steve
^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH 1/2] hpsa: do not consider firmware revision when looking for device changes.
  2010-12-16 19:00 [PATCH 0/2] Fix a couple hpsa bugs related to device discovery Stephen M. Cameron
@ 2010-12-16 19:00 ` Stephen M. Cameron
  2010-12-16 19:01 ` [PATCH 2/2] hpsa: do not consider RAID level to be part of device identity Stephen M. Cameron
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen M. Cameron @ 2010-12-16 19:00 UTC (permalink / raw)
  To: james.bottomley
  Cc: linux-scsi, mike.miller, linux-kernel, thenzl, akpm, smcameron
From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
The firmware may have been updated, in which case, it's the same device,
and in that case, we do not want to remove and add the device, we want to
let it continue as is.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
---
 drivers/scsi/hpsa.c |    9 ---------
 drivers/scsi/hpsa.h |    1 -
 2 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index a6dea08..a2408e5 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -641,11 +641,6 @@ static void fixup_botched_add(struct ctlr_info *h,
 static inline int device_is_the_same(struct hpsa_scsi_dev_t *dev1,
 	struct hpsa_scsi_dev_t *dev2)
 {
-	if ((is_logical_dev_addr_mode(dev1->scsi3addr) ||
-		(dev1->lun != -1 && dev2->lun != -1)) &&
-		dev1->devtype != 0x0C)
-		return (memcmp(dev1, dev2, sizeof(*dev1)) == 0);
-
 	/* we compare everything except lun and target as these
 	 * are not yet assigned.  Compare parts likely
 	 * to differ first
@@ -660,8 +655,6 @@ static inline int device_is_the_same(struct hpsa_scsi_dev_t *dev1,
 		return 0;
 	if (memcmp(dev1->vendor, dev2->vendor, sizeof(dev1->vendor)) != 0)
 		return 0;
-	if (memcmp(dev1->revision, dev2->revision, sizeof(dev1->revision)) != 0)
-		return 0;
 	if (dev1->devtype != dev2->devtype)
 		return 0;
 	if (dev1->raid_level != dev2->raid_level)
@@ -1477,8 +1470,6 @@ static int hpsa_update_device_info(struct ctlr_info *h,
 		sizeof(this_device->vendor));
 	memcpy(this_device->model, &inq_buff[16],
 		sizeof(this_device->model));
-	memcpy(this_device->revision, &inq_buff[32],
-		sizeof(this_device->revision));
 	memset(this_device->device_id, 0,
 		sizeof(this_device->device_id));
 	hpsa_get_device_id(h, scsi3addr, this_device->device_id,
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
index a203ef6..19586e1 100644
--- a/drivers/scsi/hpsa.h
+++ b/drivers/scsi/hpsa.h
@@ -45,7 +45,6 @@ struct hpsa_scsi_dev_t {
 	unsigned char device_id[16];    /* from inquiry pg. 0x83 */
 	unsigned char vendor[8];        /* bytes 8-15 of inquiry data */
 	unsigned char model[16];        /* bytes 16-31 of inquiry data */
-	unsigned char revision[4];      /* bytes 32-35 of inquiry data */
 	unsigned char raid_level;	/* from inquiry page 0xC1 */
 };
 
^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH 2/2] hpsa: do not consider RAID level to be part of device identity
  2010-12-16 19:00 [PATCH 0/2] Fix a couple hpsa bugs related to device discovery Stephen M. Cameron
  2010-12-16 19:00 ` [PATCH 1/2] hpsa: do not consider firmware revision when looking for device changes Stephen M. Cameron
@ 2010-12-16 19:01 ` Stephen M. Cameron
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen M. Cameron @ 2010-12-16 19:01 UTC (permalink / raw)
  To: james.bottomley
  Cc: linux-scsi, mike.miller, linux-kernel, thenzl, akpm, smcameron
From: Stephen M. Cameron <StephenM.Cameron>
Otherwise, after doing a RAID level migration, the disk will be
disruptively removed and re-added as a different disk on rescan.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
---
 drivers/scsi/hpsa.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index a2408e5..12deffc 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -657,8 +657,6 @@ static inline int device_is_the_same(struct hpsa_scsi_dev_t *dev1,
 		return 0;
 	if (dev1->devtype != dev2->devtype)
 		return 0;
-	if (dev1->raid_level != dev2->raid_level)
-		return 0;
 	if (dev1->bus != dev2->bus)
 		return 0;
 	return 1;
^ permalink raw reply related	[flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-16 19:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-16 19:00 [PATCH 0/2] Fix a couple hpsa bugs related to device discovery Stephen M. Cameron
2010-12-16 19:00 ` [PATCH 1/2] hpsa: do not consider firmware revision when looking for device changes Stephen M. Cameron
2010-12-16 19:01 ` [PATCH 2/2] hpsa: do not consider RAID level to be part of device identity Stephen M. Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).