Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp255824ybd; Tue, 25 Jun 2019 20:51:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRYuVvaYJjAYXln4PdBaTqc3XxsvaDRylPnjxajxLvEMIjUVZh2M5Mq3o4W/pFYHsj05in X-Received: by 2002:a17:902:1129:: with SMTP id d38mr2656573pla.220.1561521114290; Tue, 25 Jun 2019 20:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561521114; cv=none; d=google.com; s=arc-20160816; b=WxypUTZnEZocgKOLYdDGQI4sLDviJtS8pmwcOLbc5pNU40wsmjRSWQYtnfpJVkU8JL LSQjR/EWc4cnpPhUV3ywPA0naG2e3OhFhkSFY9swPv52eOnVeMH57CDuaR8JVqMdADAM S80otIM8cHg5a7JzXPG/i9sYJKdUoRsSmVDteR/PhWh1Qadan1g3QTOnJOwva+P9jWvm IEIbF0YxgsTARgcJgoHzt1nWN6ePH9ag/30mAIIwLt/RlUyJq/krbzbqoKwTz8Kc/sx7 a0DGPzs6QlCO3OD/rJqb1M0ATE2lC4Y/6CuwwvqvPBJ/JpfMcj1BT3zkmyhaxfYy+1F/ Ykmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PJeI/fwRX/M7VTU3vIjYXh/z7lHJeliH6N24F8JnSfU=; b=VFTT5UDkQvevYfkQpg/rsA01DcY69omY+TIDsWPDn2nTEGpYbVmG9UehOlxj4/J57J kFgH5t7QoDIvRC41VkLGg85y6UxE4wfiqDsGPZheQak6RbuyHJHf99u+J50klD3UT9BT JJ+H0nM2oaoKKTgoR8C3vr5+3zZA25mA7HWgs+WXU6Ugcf1MspQOPtQwzShqtGgC0IWy eG1kftGetDaztpsrF5RIjwTQJ97GGOITwuGU9foZB0QwYCBYYLh5C0G5uQcbgWBVmOHF 9+DOEVPzKelKr57lQfpDntu32lk1s8riOlF4GJaNRkXPbk2hdn9Q5jGc8ipjS9GpTCoK m9Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bdECyq5+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si15996482pgn.369.2019.06.25.20.51.38; Tue, 25 Jun 2019 20:51:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bdECyq5+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727210AbfFZDm6 (ORCPT + 99 others); Tue, 25 Jun 2019 23:42:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:53920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727188AbfFZDmx (ORCPT ); Tue, 25 Jun 2019 23:42:53 -0400 Received: from sasha-vm.mshome.net (mobile-107-77-172-74.mobile.att.net [107.77.172.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 18FD7214DA; Wed, 26 Jun 2019 03:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520572; bh=LR8F7yn4wUognNWRSSpe7/9BwwZsdeFhYyFPkkkiHG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bdECyq5+xkk6rKW5u9BPukPX57iRw/C2HWWm0dvI8eIf8A3YUlV+UpqoSCg4reVn2 3tgMsw3HI+/uHJXamS5ypRLOcKGtPuGTVYX5Y2CU5DyzdbZAQcKfgAW82HptJ63NYU j7nq+TtPX6fL9DM28HHTR9is2zUNKs859kv1slG0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Don Brace , Bader Ali - Saleh , Scott Teel , Matt Perricone , "Martin K . Petersen" , Sasha Levin , esc.storagedev@microsemi.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.1 34/51] scsi: hpsa: correct ioaccel2 chaining Date: Tue, 25 Jun 2019 23:40:50 -0400 Message-Id: <20190626034117.23247-34-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190626034117.23247-1-sashal@kernel.org> References: <20190626034117.23247-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Don Brace [ 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 Reviewed-by: Scott Teel Reviewed-by: Matt Perricone Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/hpsa.c | 7 ++++++- drivers/scsi/hpsa_cmd.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index f044e7d10d63..2d181e5e65ff 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -4925,7 +4925,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]; } @@ -4942,6 +4942,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 }; /* -- 2.20.1