]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: hpsa: correct ioaccel2 chaining
authorDon Brace <don.brace@microsemi.com>
Mon, 3 Jun 2019 21:43:29 +0000 (16:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jul 2019 07:56:41 +0000 (09:56 +0200)
[ Upstream commit 625d7d3518875c4d303c652a198feaa13d9f52d9 ]

- 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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/hpsa.c
drivers/scsi/hpsa_cmd.h

index 910b795fc5eb5a2edb2bbd38546d0babc58d15de..e0952882e13208f9cfed454b11a03dd33a1132ff 100644 (file)
@@ -4562,7 +4562,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];
                }
@@ -4579,6 +4579,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;
index 26488e2a7f02f80fcd6898b3ead81d2cc75cd35b..7ffde12d57d499f9b72921fb54333b8ba9f611f0 100644 (file)
@@ -513,6 +513,7 @@ struct ioaccel2_sg_element {
        u8 reserved[3];
        u8 chain_indicator;
 #define IOACCEL2_CHAIN 0x80
+#define IOACCEL2_LAST_SG 0x40
 };
 
 /*