diff options
author | Don Brace <don.brace@microsemi.com> | 2019-06-03 17:43:29 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-06-07 09:19:08 -0400 |
commit | 625d7d3518875c4d303c652a198feaa13d9f52d9 (patch) | |
tree | c0fa774b6f8c8cc9b6dc336cb179780aa20d0db3 | |
parent | cc8f52609bb4177febade24d11713e20c0893b0a (diff) |
scsi: hpsa: correct ioaccel2 chaining
- 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>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/hpsa.c | 7 | ||||
-rw-r--r-- | drivers/scsi/hpsa_cmd.h | 1 |
2 files changed, 7 insertions, 1 deletions
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, | |||
4940 | curr_sg->reserved[0] = 0; | 4940 | curr_sg->reserved[0] = 0; |
4941 | curr_sg->reserved[1] = 0; | 4941 | curr_sg->reserved[1] = 0; |
4942 | curr_sg->reserved[2] = 0; | 4942 | curr_sg->reserved[2] = 0; |
4943 | curr_sg->chain_indicator = 0x80; | 4943 | curr_sg->chain_indicator = IOACCEL2_CHAIN; |
4944 | 4944 | ||
4945 | curr_sg = h->ioaccel2_cmd_sg_list[c->cmdindex]; | 4945 | curr_sg = h->ioaccel2_cmd_sg_list[c->cmdindex]; |
4946 | } | 4946 | } |
@@ -4957,6 +4957,11 @@ static int hpsa_scsi_ioaccel2_queue_command(struct ctlr_info *h, | |||
4957 | curr_sg++; | 4957 | curr_sg++; |
4958 | } | 4958 | } |
4959 | 4959 | ||
4960 | /* | ||
4961 | * Set the last s/g element bit | ||
4962 | */ | ||
4963 | (curr_sg - 1)->chain_indicator = IOACCEL2_LAST_SG; | ||
4964 | |||
4960 | switch (cmd->sc_data_direction) { | 4965 | switch (cmd->sc_data_direction) { |
4961 | case DMA_TO_DEVICE: | 4966 | case DMA_TO_DEVICE: |
4962 | cp->direction &= ~IOACCEL2_DIRECTION_MASK; | 4967 | 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 { | |||
517 | u8 reserved[3]; | 517 | u8 reserved[3]; |
518 | u8 chain_indicator; | 518 | u8 chain_indicator; |
519 | #define IOACCEL2_CHAIN 0x80 | 519 | #define IOACCEL2_CHAIN 0x80 |
520 | #define IOACCEL2_LAST_SG 0x40 | ||
520 | }; | 521 | }; |
521 | 522 | ||
522 | /* | 523 | /* |