aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSalyzyn, Mark <Mark_Salyzyn@adaptec.com>2008-01-08 15:48:25 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 12:29:19 -0500
commita3940da5e6fe8b833eecdbca3fac9456b4204d6e (patch)
treee7254ab5376f92b427e283eba55e2f66a7ce1c19 /drivers
parent06a43d1725f59a0f5e043bd06081c44ae528098e (diff)
[SCSI] aacraid: fix big endian issues
Big endian systems issues discovered in the aacraid driver. Somewhat reverses a patch from November 7th of last year that removed swap operations because they formerly were being assigned to an u8 array when they should have been assigned to an le32 array. This patch is largely inert for any little endian processor architecture. It resolves a bug in delivering the BlinkLED AIF event to registered applications when the adapter or associated hardware was reset due to ill health. A rare corner case occurrence, also largely unnoticed by any as it was a new (untested!) feature. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/aacraid/aachba.c7
-rw-r--r--drivers/scsi/aacraid/aacraid.h6
-rw-r--r--drivers/scsi/aacraid/comminit.c4
-rw-r--r--drivers/scsi/aacraid/commsup.c17
-rw-r--r--drivers/scsi/aacraid/linit.c10
-rw-r--r--drivers/scsi/aacraid/rx.c2
6 files changed, 22 insertions, 24 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 94577c03a23a..3cddcc0901b2 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -1325,10 +1325,9 @@ int aac_get_adapter_info(struct aac_dev* dev)
1325 (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid), 1325 (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid),
1326 dev->supplement_adapter_info.VpdInfo.Tsid); 1326 dev->supplement_adapter_info.VpdInfo.Tsid);
1327 } 1327 }
1328 if (!aac_check_reset || 1328 if (!aac_check_reset || ((aac_check_reset != 1) &&
1329 ((aac_check_reset != 1) && 1329 (dev->supplement_adapter_info.SupportedOptions2 &
1330 (dev->supplement_adapter_info.SupportedOptions2 & 1330 AAC_OPTION_IGNORE_RESET))) {
1331 cpu_to_le32(AAC_OPTION_IGNORE_RESET)))) {
1332 printk(KERN_INFO "%s%d: Reset Adapter Ignored\n", 1331 printk(KERN_INFO "%s%d: Reset Adapter Ignored\n",
1333 dev->name, dev->id); 1332 dev->name, dev->id);
1334 } 1333 }
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 6d4e24cea3dc..07def7261004 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -869,9 +869,9 @@ struct aac_supplement_adapter_info
869 __le32 SupportedOptions2; 869 __le32 SupportedOptions2;
870 __le32 ReservedGrowth[1]; 870 __le32 ReservedGrowth[1];
871}; 871};
872#define AAC_FEATURE_FALCON 0x00000010 872#define AAC_FEATURE_FALCON cpu_to_le32(0x00000010)
873#define AAC_OPTION_MU_RESET 0x00000001 873#define AAC_OPTION_MU_RESET cpu_to_le32(0x00000001)
874#define AAC_OPTION_IGNORE_RESET 0x00000002 874#define AAC_OPTION_IGNORE_RESET cpu_to_le32(0x00000002)
875#define AAC_SIS_VERSION_V3 3 875#define AAC_SIS_VERSION_V3 3
876#define AAC_SIS_SLOT_UNKNOWN 0xFF 876#define AAC_SIS_SLOT_UNKNOWN 0xFF
877 877
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index 8736813a0296..89cc8b7b42a2 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -301,10 +301,10 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
301 if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES, 301 if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES,
302 0, 0, 0, 0, 0, 0, status+0, status+1, status+2, NULL, NULL)) && 302 0, 0, 0, 0, 0, 0, status+0, status+1, status+2, NULL, NULL)) &&
303 (status[0] == 0x00000001)) { 303 (status[0] == 0x00000001)) {
304 if (status[1] & AAC_OPT_NEW_COMM_64) 304 if (status[1] & le32_to_cpu(AAC_OPT_NEW_COMM_64))
305 dev->raw_io_64 = 1; 305 dev->raw_io_64 = 1;
306 if (dev->a_ops.adapter_comm && 306 if (dev->a_ops.adapter_comm &&
307 (status[1] & AAC_OPT_NEW_COMM)) 307 (status[1] & le32_to_cpu(AAC_OPT_NEW_COMM)))
308 dev->comm_interface = AAC_COMM_MESSAGE; 308 dev->comm_interface = AAC_COMM_MESSAGE;
309 if ((dev->comm_interface == AAC_COMM_MESSAGE) && 309 if ((dev->comm_interface == AAC_COMM_MESSAGE) &&
310 (status[2] > dev->base_size)) { 310 (status[2] > dev->base_size)) {
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 81cdac166d4b..e82d89ccaf15 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1343,11 +1343,11 @@ int aac_check_health(struct aac_dev * aac)
1343 fib->data = hw_fib->data; 1343 fib->data = hw_fib->data;
1344 aif = (struct aac_aifcmd *)hw_fib->data; 1344 aif = (struct aac_aifcmd *)hw_fib->data;
1345 aif->command = cpu_to_le32(AifCmdEventNotify); 1345 aif->command = cpu_to_le32(AifCmdEventNotify);
1346 aif->seqnum = cpu_to_le32(0xFFFFFFFF); 1346 aif->seqnum = cpu_to_le32(0xFFFFFFFF);
1347 aif->data[0] = AifEnExpEvent; 1347 ((__le32 *)aif->data)[0] = cpu_to_le32(AifEnExpEvent);
1348 aif->data[1] = AifExeFirmwarePanic; 1348 ((__le32 *)aif->data)[1] = cpu_to_le32(AifExeFirmwarePanic);
1349 aif->data[2] = AifHighPriority; 1349 ((__le32 *)aif->data)[2] = cpu_to_le32(AifHighPriority);
1350 aif->data[3] = BlinkLED; 1350 ((__le32 *)aif->data)[3] = cpu_to_le32(BlinkLED);
1351 1351
1352 /* 1352 /*
1353 * Put the FIB onto the 1353 * Put the FIB onto the
@@ -1377,10 +1377,9 @@ int aac_check_health(struct aac_dev * aac)
1377 1377
1378 printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED); 1378 printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED);
1379 1379
1380 if (!aac_check_reset || 1380 if (!aac_check_reset || ((aac_check_reset != 1) &&
1381 ((aac_check_reset != 1) && 1381 (aac->supplement_adapter_info.SupportedOptions2 &
1382 (aac->supplement_adapter_info.SupportedOptions2 & 1382 AAC_OPTION_IGNORE_RESET)))
1383 cpu_to_le32(AAC_OPTION_IGNORE_RESET))))
1384 goto out; 1383 goto out;
1385 host = aac->scsi_host_ptr; 1384 host = aac->scsi_host_ptr;
1386 if (aac->thread->pid != current->pid) 1385 if (aac->thread->pid != current->pid)
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index e6bdc930d528..742e1a8edc60 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -614,11 +614,11 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
614 * support a register, instead of a commanded, reset. 614 * support a register, instead of a commanded, reset.
615 */ 615 */
616 if ((aac->supplement_adapter_info.SupportedOptions2 & 616 if ((aac->supplement_adapter_info.SupportedOptions2 &
617 cpu_to_le32(AAC_OPTION_MU_RESET)) && 617 AAC_OPTION_MU_RESET) &&
618 aac_check_reset && 618 aac_check_reset &&
619 ((aac_check_reset != 1) || 619 ((aac_check_reset != 1) ||
620 (aac->supplement_adapter_info.SupportedOptions2 & 620 (aac->supplement_adapter_info.SupportedOptions2 &
621 cpu_to_le32(AAC_OPTION_IGNORE_RESET)))) 621 AAC_OPTION_IGNORE_RESET)))
622 aac_reset_adapter(aac, 2); /* Bypass wait for command quiesce */ 622 aac_reset_adapter(aac, 2); /* Bypass wait for command quiesce */
623 return SUCCESS; /* Cause an immediate retry of the command with a ten second delay after successful tur */ 623 return SUCCESS; /* Cause an immediate retry of the command with a ten second delay after successful tur */
624} 624}
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index 9b831519a6fa..a08bbf1fd76c 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -465,7 +465,7 @@ static int aac_rx_restart_adapter(struct aac_dev *dev, int bled)
465 u32 var; 465 u32 var;
466 466
467 if (!(dev->supplement_adapter_info.SupportedOptions2 & 467 if (!(dev->supplement_adapter_info.SupportedOptions2 &
468 cpu_to_le32(AAC_OPTION_MU_RESET)) || (bled >= 0) || (bled == -2)) { 468 AAC_OPTION_MU_RESET) || (bled >= 0) || (bled == -2)) {
469 if (bled) 469 if (bled)
470 printk(KERN_ERR "%s%d: adapter kernel panic'd %x.\n", 470 printk(KERN_ERR "%s%d: adapter kernel panic'd %x.\n",
471 dev->name, dev->id, bled); 471 dev->name, dev->id, bled);