Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3940da5 authored by Salyzyn, Mark's avatar Salyzyn, Mark Committed by James Bottomley
Browse files

[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: default avatarMark Salyzyn <aacraid@adaptec.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 06a43d17
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -1325,10 +1325,9 @@ int aac_get_adapter_info(struct aac_dev* dev)
			  (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid),
			  (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid),
			  dev->supplement_adapter_info.VpdInfo.Tsid);
			  dev->supplement_adapter_info.VpdInfo.Tsid);
		}
		}
		if (!aac_check_reset ||
		if (!aac_check_reset || ((aac_check_reset != 1) &&
		    ((aac_check_reset != 1) &&
		  (dev->supplement_adapter_info.SupportedOptions2 &
		  (dev->supplement_adapter_info.SupportedOptions2 &
		      cpu_to_le32(AAC_OPTION_IGNORE_RESET)))) {
		  AAC_OPTION_IGNORE_RESET))) {
			printk(KERN_INFO "%s%d: Reset Adapter Ignored\n",
			printk(KERN_INFO "%s%d: Reset Adapter Ignored\n",
			  dev->name, dev->id);
			  dev->name, dev->id);
		}
		}
+3 −3
Original line number Original line Diff line number Diff line
@@ -869,9 +869,9 @@ struct aac_supplement_adapter_info
	__le32	SupportedOptions2;
	__le32	SupportedOptions2;
	__le32	ReservedGrowth[1];
	__le32	ReservedGrowth[1];
};
};
#define AAC_FEATURE_FALCON	0x00000010
#define AAC_FEATURE_FALCON	cpu_to_le32(0x00000010)
#define AAC_OPTION_MU_RESET	0x00000001
#define AAC_OPTION_MU_RESET	cpu_to_le32(0x00000001)
#define AAC_OPTION_IGNORE_RESET	0x00000002
#define AAC_OPTION_IGNORE_RESET	cpu_to_le32(0x00000002)
#define AAC_SIS_VERSION_V3	3
#define AAC_SIS_VERSION_V3	3
#define AAC_SIS_SLOT_UNKNOWN	0xFF
#define AAC_SIS_SLOT_UNKNOWN	0xFF


+2 −2
Original line number Original line Diff line number Diff line
@@ -301,10 +301,10 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
	if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES,
	if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES,
		0, 0, 0, 0, 0, 0, status+0, status+1, status+2, NULL, NULL)) &&
		0, 0, 0, 0, 0, 0, status+0, status+1, status+2, NULL, NULL)) &&
	 		(status[0] == 0x00000001)) {
	 		(status[0] == 0x00000001)) {
		if (status[1] & AAC_OPT_NEW_COMM_64)
		if (status[1] & le32_to_cpu(AAC_OPT_NEW_COMM_64))
			dev->raw_io_64 = 1;
			dev->raw_io_64 = 1;
		if (dev->a_ops.adapter_comm &&
		if (dev->a_ops.adapter_comm &&
		    (status[1] & AAC_OPT_NEW_COMM))
		    (status[1] & le32_to_cpu(AAC_OPT_NEW_COMM)))
			dev->comm_interface = AAC_COMM_MESSAGE;
			dev->comm_interface = AAC_COMM_MESSAGE;
		if ((dev->comm_interface == AAC_COMM_MESSAGE) &&
		if ((dev->comm_interface == AAC_COMM_MESSAGE) &&
		    (status[2] > dev->base_size)) {
		    (status[2] > dev->base_size)) {
+8 −9
Original line number Original line Diff line number Diff line
@@ -1344,10 +1344,10 @@ int aac_check_health(struct aac_dev * aac)
			aif = (struct aac_aifcmd *)hw_fib->data;
			aif = (struct aac_aifcmd *)hw_fib->data;
			aif->command = cpu_to_le32(AifCmdEventNotify);
			aif->command = cpu_to_le32(AifCmdEventNotify);
			aif->seqnum = cpu_to_le32(0xFFFFFFFF);
			aif->seqnum = cpu_to_le32(0xFFFFFFFF);
			aif->data[0] = AifEnExpEvent;
			((__le32 *)aif->data)[0] = cpu_to_le32(AifEnExpEvent);
			aif->data[1] = AifExeFirmwarePanic;
			((__le32 *)aif->data)[1] = cpu_to_le32(AifExeFirmwarePanic);
			aif->data[2] = AifHighPriority;
			((__le32 *)aif->data)[2] = cpu_to_le32(AifHighPriority);
			aif->data[3] = BlinkLED;
			((__le32 *)aif->data)[3] = cpu_to_le32(BlinkLED);


			/*
			/*
			 * Put the FIB onto the
			 * Put the FIB onto the
@@ -1377,10 +1377,9 @@ int aac_check_health(struct aac_dev * aac)


	printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED);
	printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED);


	if (!aac_check_reset ||
	if (!aac_check_reset || ((aac_check_reset != 1) &&
	    ((aac_check_reset != 1) &&
		(aac->supplement_adapter_info.SupportedOptions2 &
		(aac->supplement_adapter_info.SupportedOptions2 &
	      cpu_to_le32(AAC_OPTION_IGNORE_RESET))))
			AAC_OPTION_IGNORE_RESET)))
		goto out;
		goto out;
	host = aac->scsi_host_ptr;
	host = aac->scsi_host_ptr;
	if (aac->thread->pid != current->pid)
	if (aac->thread->pid != current->pid)
+5 −5
Original line number Original line Diff line number Diff line
@@ -614,11 +614,11 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
	 * support a register, instead of a commanded, reset.
	 * support a register, instead of a commanded, reset.
	 */
	 */
	if ((aac->supplement_adapter_info.SupportedOptions2 &
	if ((aac->supplement_adapter_info.SupportedOptions2 &
	     cpu_to_le32(AAC_OPTION_MU_RESET)) &&
	   AAC_OPTION_MU_RESET) &&
	  aac_check_reset &&
	  aac_check_reset &&
	  ((aac_check_reset != 1) ||
	  ((aac_check_reset != 1) ||
	   (aac->supplement_adapter_info.SupportedOptions2 &
	   (aac->supplement_adapter_info.SupportedOptions2 &
	      cpu_to_le32(AAC_OPTION_IGNORE_RESET))))
	    AAC_OPTION_IGNORE_RESET)))
		aac_reset_adapter(aac, 2); /* Bypass wait for command quiesce */
		aac_reset_adapter(aac, 2); /* Bypass wait for command quiesce */
	return SUCCESS; /* Cause an immediate retry of the command with a ten second delay after successful tur */
	return SUCCESS; /* Cause an immediate retry of the command with a ten second delay after successful tur */
}
}
Loading