svn commit: r273040 - head/sys/dev/mrsas

Kashyap D Desai kadesai at FreeBSD.org
Mon Oct 13 15:33:29 UTC 2014


Author: kadesai
Date: Mon Oct 13 15:33:27 2014
New Revision: 273040
URL: https://svnweb.freebsd.org/changeset/base/273040

Log:
  Fix for build issue on i386.xen and amd64.xen.
  
  This is a duplicate variable reference in mrsas, so now this patch isolate atomic_ variable and relavent
  function call using prefix mrsas_xx.
  
  Issue was introduced in r272737.
  
  MFC after:	2 weeks
  Sponsored by:	Avago Technology

Modified:
  head/sys/dev/mrsas/mrsas.c
  head/sys/dev/mrsas/mrsas.h
  head/sys/dev/mrsas/mrsas_cam.c
  head/sys/dev/mrsas/mrsas_fp.c

Modified: head/sys/dev/mrsas/mrsas.c
==============================================================================
--- head/sys/dev/mrsas/mrsas.c	Mon Oct 13 14:52:54 2014	(r273039)
+++ head/sys/dev/mrsas/mrsas.c	Mon Oct 13 15:33:27 2014	(r273040)
@@ -850,7 +850,7 @@ mrsas_attach(device_t dev)
 	TAILQ_INIT(&sc->mrsas_mpt_cmd_list_head);
 	TAILQ_INIT(&sc->mrsas_mfi_cmd_list_head);
 
-	atomic_set(&sc->fw_outstanding, 0);
+	mrsas_atomic_set(&sc->fw_outstanding, 0);
 
 	sc->io_cmds_highwater = 0;
 
@@ -1392,7 +1392,7 @@ mrsas_isr(void *arg)
 			return;
 	}
 	/* If we are resetting, bail */
-	if (test_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags)) {
+	if (mrsas_test_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags)) {
 		printf(" Entered into ISR when OCR is going active. \n");
 		mrsas_clear_intr(sc);
 		return;
@@ -1462,7 +1462,7 @@ mrsas_complete_cmd(struct mrsas_softc *s
 			lbinfo = &sc->load_balance_info[device_id];
 			if (cmd_mpt->load_balance == MRSAS_LOAD_BALANCE_FLAG) {
 				arm = lbinfo->raid1DevHandle[0] == scsi_io_req->DevHandle ? 0 : 1;
-				atomic_dec(&lbinfo->scsi_pending_cmds[arm]);
+				mrsas_atomic_dec(&lbinfo->scsi_pending_cmds[arm]);
 				cmd_mpt->load_balance &= ~MRSAS_LOAD_BALANCE_FLAG;
 			}
 			/* Fall thru and complete IO */
@@ -1471,7 +1471,7 @@ mrsas_complete_cmd(struct mrsas_softc *s
 			mrsas_cmd_done(sc, cmd_mpt);
 			scsi_io_req->RaidContext.status = 0;
 			scsi_io_req->RaidContext.exStatus = 0;
-			atomic_dec(&sc->fw_outstanding);
+			mrsas_atomic_dec(&sc->fw_outstanding);
 			break;
 		case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST:	/* MFI command */
 			cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx];
@@ -2672,7 +2672,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc)
 		    "mrsas: Hardware critical error, returning FAIL.\n");
 		return FAIL;
 	}
-	set_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags);
+	mrsas_set_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags);
 	sc->adprecovery = MRSAS_ADPRESET_SM_INFAULT;
 	mrsas_disable_intr(sc);
 	DELAY(1000 * 1000);
@@ -2689,7 +2689,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc)
 				ccb = (union ccb *)(mpt_cmd->ccb_ptr);
 				ccb->ccb_h.status = CAM_SCSI_BUS_RESET;
 				mrsas_cmd_done(sc, mpt_cmd);
-				atomic_dec(&sc->fw_outstanding);
+				mrsas_atomic_dec(&sc->fw_outstanding);
 			}
 		}
 
@@ -2787,7 +2787,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc)
 				mrsas_dprint(sc, MRSAS_OCR, "mrsas_ioc_init() failed!\n");
 				continue;
 			}
-			clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags);
+			mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags);
 			mrsas_enable_intr(sc);
 			sc->adprecovery = MRSAS_HBA_OPERATIONAL;
 
@@ -2833,12 +2833,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc)
 		mrsas_kill_hba(sc);
 		retval = FAIL;
 	} else {
-		clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags);
+		mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags);
 		mrsas_enable_intr(sc);
 		sc->adprecovery = MRSAS_HBA_OPERATIONAL;
 	}
 out:
-	clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags);
+	mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags);
 	mrsas_dprint(sc, MRSAS_OCR,
 	    "Reset Exit with %d.\n", retval);
 	return retval;
@@ -2890,7 +2890,7 @@ mrsas_wait_for_outstanding(struct mrsas_
 			retval = 1;
 			goto out;
 		}
-		outstanding = atomic_read(&sc->fw_outstanding);
+		outstanding = mrsas_atomic_read(&sc->fw_outstanding);
 		if (!outstanding)
 			goto out;
 
@@ -2904,7 +2904,7 @@ mrsas_wait_for_outstanding(struct mrsas_
 		DELAY(1000 * 1000);
 	}
 
-	if (atomic_read(&sc->fw_outstanding)) {
+	if (mrsas_atomic_read(&sc->fw_outstanding)) {
 		mrsas_dprint(sc, MRSAS_OCR,
 		    " pending commands remain after waiting,"
 		    " will reset adapter.\n");

Modified: head/sys/dev/mrsas/mrsas.h
==============================================================================
--- head/sys/dev/mrsas/mrsas.h	Mon Oct 13 14:52:54 2014	(r273039)
+++ head/sys/dev/mrsas/mrsas.h	Mon Oct 13 15:33:27 2014	(r273040)
@@ -101,7 +101,7 @@ __FBSDID("$FreeBSD$");
  */
 #define	BYTE_ALIGNMENT					1
 #define	MRSAS_MAX_NAME_LENGTH			32
-#define	MRSAS_VERSION					"06.705.10.01-fbsd"
+#define	MRSAS_VERSION					"06.705.10.02-fbsd"
 #define	MRSAS_ULONG_MAX					0xFFFFFFFFFFFFFFFF
 #define	MRSAS_DEFAULT_TIMEOUT			0x14	/* Temporarily set */
 #define	DONE							0
@@ -513,12 +513,12 @@ Mpi2ReplyDescriptorsUnion_t, MPI2_POINTE
 
 typedef struct {
 	volatile unsigned int val;
-} atomic_t;
+} mrsas_atomic_t;
 
-#define	atomic_read(v)	atomic_load_acq_int(&(v)->val)
-#define	atomic_set(v,i)	atomic_store_rel_int(&(v)->val, i)
-#define	atomic_dec(v)	atomic_fetchadd_int(&(v)->val, -1)
-#define	atomic_inc(v)	atomic_fetchadd_int(&(v)->val, 1)
+#define	mrsas_atomic_read(v)	atomic_load_acq_int(&(v)->val)
+#define	mrsas_atomic_set(v,i)	atomic_store_rel_int(&(v)->val, i)
+#define	mrsas_atomic_dec(v)	atomic_fetchadd_int(&(v)->val, -1)
+#define	mrsas_atomic_inc(v)	atomic_fetchadd_int(&(v)->val, 1)
 
 /* IOCInit Request message */
 typedef struct _MPI2_IOC_INIT_REQUEST {
@@ -813,7 +813,7 @@ typedef struct _LD_LOAD_BALANCE_INFO {
 	u_int8_t loadBalanceFlag;
 	u_int8_t reserved1;
 	u_int16_t raid1DevHandle[2];
-	atomic_t scsi_pending_cmds[2];
+	mrsas_atomic_t scsi_pending_cmds[2];
 	u_int64_t last_accessed_block[2];
 }	LD_LOAD_BALANCE_INFO, *PLD_LOAD_BALANCE_INFO;
 
@@ -2524,7 +2524,7 @@ struct mrsas_softc {
 	bus_addr_t ctlr_info_phys_addr;
 	u_int32_t max_sectors_per_req;
 	u_int8_t disableOnlineCtrlReset;
-	atomic_t fw_outstanding;
+	mrsas_atomic_t fw_outstanding;
 	u_int32_t mrsas_debug;
 	u_int32_t mrsas_io_timeout;
 	u_int32_t mrsas_fw_fault_check_delay;
@@ -2577,19 +2577,19 @@ struct mrsas_softc {
 #endif
 
 static __inline void
-clear_bit(int b, volatile void *p)
+mrsas_clear_bit(int b, volatile void *p)
 {
 	atomic_clear_int(((volatile int *)p) + (b >> 5), 1 << (b & 0x1f));
 }
 
 static __inline void
-set_bit(int b, volatile void *p)
+mrsas_set_bit(int b, volatile void *p)
 {
 	atomic_set_int(((volatile int *)p) + (b >> 5), 1 << (b & 0x1f));
 }
 
 static __inline int
-test_bit(int b, volatile void *p)
+mrsas_test_bit(int b, volatile void *p)
 {
 	return ((volatile int *)p)[b >> 5] & (1 << (b & 0x1f));
 }

Modified: head/sys/dev/mrsas/mrsas_cam.c
==============================================================================
--- head/sys/dev/mrsas/mrsas_cam.c	Mon Oct 13 14:52:54 2014	(r273039)
+++ head/sys/dev/mrsas/mrsas_cam.c	Mon Oct 13 15:33:27 2014	(r273040)
@@ -532,9 +532,9 @@ mrsas_startio(struct mrsas_softc *sc, st
 	 */
 	callout_reset(&cmd->cm_callout, (sc->mrsas_io_timeout * hz) / 1000,
 	    mrsas_scsiio_timeout, cmd);
-	atomic_inc(&sc->fw_outstanding);
+	mrsas_atomic_inc(&sc->fw_outstanding);
 
-	if (atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater)
+	if (mrsas_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater)
 		sc->io_cmds_highwater++;
 
 	mrsas_fire_cmd(sc, req_desc->addr.u.low, req_desc->addr.u.high);

Modified: head/sys/dev/mrsas/mrsas_fp.c
==============================================================================
--- head/sys/dev/mrsas/mrsas_fp.c	Mon Oct 13 14:52:54 2014	(r273039)
+++ head/sys/dev/mrsas/mrsas_fp.c	Mon Oct 13 15:33:27 2014	(r273040)
@@ -1347,8 +1347,8 @@ mrsas_get_best_arm(PLD_LOAD_BALANCE_INFO
 	u_int8_t bestArm;
 
 	/* get the pending cmds for the data and mirror arms */
-	pend0 = atomic_read(&lbInfo->scsi_pending_cmds[0]);
-	pend1 = atomic_read(&lbInfo->scsi_pending_cmds[1]);
+	pend0 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[0]);
+	pend1 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[1]);
 
 	/* Determine the disk whose head is nearer to the req. block */
 	diff0 = ABS_DIFF(block, lbInfo->last_accessed_block[0]);
@@ -1382,7 +1382,7 @@ mrsas_get_updated_dev_handle(PLD_LOAD_BA
 	/* get best new arm */
 	arm = mrsas_get_best_arm(lbInfo, old_arm, io_info->ldStartBlock, io_info->numBlocks);
 	devHandle = lbInfo->raid1DevHandle[arm];
-	atomic_inc(&lbInfo->scsi_pending_cmds[arm]);
+	mrsas_atomic_inc(&lbInfo->scsi_pending_cmds[arm]);
 
 	return devHandle;
 }


More information about the svn-src-all mailing list