diff mbox series

hpsa: correct ioaccel2 chaining

Message ID 155959820906.12441.16284446831021860511.stgit@brunhilda (mailing list archive)
State Mainlined
Commit 625d7d3518875c4d303c652a198feaa13d9f52d9
Headers show
Series hpsa: correct ioaccel2 chaining | expand

Commit Message

Don Brace June 3, 2019, 9:43 p.m. UTC
- set ioaccel2_sg_element member 'chain_indicator'
  to IOACCEL2_LAST_SG for the last s/g element.
- set ioaccel2_sg_element member 'chain_indicator'
  to IOACCEL2_CHAIN when chaining.

Reviewed-by: Bader Ali - Saleh <bader.alisaleh@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Matt Perricone < matt.perricone@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/hpsa.c     |    7 ++++++-
 drivers/scsi/hpsa_cmd.h |    1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Martin K. Petersen June 7, 2019, 1:20 p.m. UTC | #1
Don,

> - set ioaccel2_sg_element member 'chain_indicator'
>   to IOACCEL2_LAST_SG for the last s/g element.
> - set ioaccel2_sg_element member 'chain_indicator'
>   to IOACCEL2_CHAIN when chaining.

Applied to 5.2/scsi-fixes, thanks.
diff mbox series

Patch

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 1bef1da273c2..8068520cf89e 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4940,7 +4940,7 @@  static int hpsa_scsi_ioaccel2_queue_command(struct ctlr_info *h,
 			curr_sg->reserved[0] = 0;
 			curr_sg->reserved[1] = 0;
 			curr_sg->reserved[2] = 0;
-			curr_sg->chain_indicator = 0x80;
+			curr_sg->chain_indicator = IOACCEL2_CHAIN;
 
 			curr_sg = h->ioaccel2_cmd_sg_list[c->cmdindex];
 		}
@@ -4957,6 +4957,11 @@  static int hpsa_scsi_ioaccel2_queue_command(struct ctlr_info *h,
 			curr_sg++;
 		}
 
+		/*
+		 * Set the last s/g element bit
+		 */
+		(curr_sg - 1)->chain_indicator = IOACCEL2_LAST_SG;
+
 		switch (cmd->sc_data_direction) {
 		case DMA_TO_DEVICE:
 			cp->direction &= ~IOACCEL2_DIRECTION_MASK;
diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h
index 21a726e2eec6..f6afca4b2319 100644
--- a/drivers/scsi/hpsa_cmd.h
+++ b/drivers/scsi/hpsa_cmd.h
@@ -517,6 +517,7 @@  struct ioaccel2_sg_element {
 	u8 reserved[3];
 	u8 chain_indicator;
 #define IOACCEL2_CHAIN 0x80
+#define IOACCEL2_LAST_SG 0x40
 };
 
 /*