Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1456434ybi; Fri, 14 Jun 2019 15:24:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOayXo9ID6WWYXN5Qe7hOYCo2VplStZiciUr8+O5JqBr/VfoZAYgl0f1mIgG8ATTPAcSgS X-Received: by 2002:a63:c106:: with SMTP id w6mr38283581pgf.422.1560551066000; Fri, 14 Jun 2019 15:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560551065; cv=none; d=google.com; s=arc-20160816; b=V+1fUsTSiNpkPC982gnM1VbyUnSYA4pPPI61LtRYyWqmre6yPQbf1LHMKmgTFqej1Z jzUHpQr69LwHVbXpOQgDvYUW6xHRNrPIa7oaSLhIPaEbRQpC2Pf5VfOouLeqF8iftDLd 0CSFPooQxMv/L1k5Gs4amHZtHJ55nJfxPfhAaMcoTgOO+GitcyY3FPKDkUizm2B5Boyr EKQuO3Aowu0jMXQAdFIw7mQcwSspDnRskDdEkiuILgbgcMqWtmJ1DmQlIWsWCJGBR17S z7q7eASNfo2wvPlW2N8tR7y9SVhJjKFWaCT8lsijE4Azd3OXQ3X86DqBRpIcpYt0Sv6o G/5w== 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 :date:cc:to:from:subject:message-id:dkim-signature:dkim-signature; bh=P4TI/3y89Wp0G75hEyPVeSu492b6HP9DIxAGr50KBkM=; b=mTSI5SplZfbDcXuJEmee4Fma9fBbzllBPkAqSHrqP8bRuKrjIMWgbFPbJza1X3Jw9r MB8PDxnw/Y3fKqFcfk7gXyPaRCgZxvnFsz6ZoS94aI+JAw41+16UAy84DP3KjyH0gpZt XbWso6nOTixUJmQcA2j34o7eHPlYeqp/9dySsiqBnRnmkZQclPRUymcL3M8QuEEoU2c8 oF8EsZZCUIU9dMza6q2Kz6DENIQkMzla2YIzhtUZOsG4oVzujfB/jBA1nUMjcRr2r48Y udJomOLFQROrA589KhOq65McC0q8fpeHiLRfROqsND+PGxQrt8/wxnMg59lpd3qI9g5K j6gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=EjLlQE4P; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=G2dVBLpw; 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=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 188si3649131pff.20.2019.06.14.15.24.10; Fri, 14 Jun 2019 15:24:25 -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=fail header.i=@hansenpartnership.com header.s=20151216 header.b=EjLlQE4P; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=G2dVBLpw; 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=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726193AbfFNWYF (ORCPT + 99 others); Fri, 14 Jun 2019 18:24:05 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:46750 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbfFNWYF (ORCPT ); Fri, 14 Jun 2019 18:24:05 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 1EB3C8EE147; Fri, 14 Jun 2019 15:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1560551045; bh=7IkzCl5xuesXjn4kt8C9Xue+PKpF+HaeTeLvv0akPX8=; h=Subject:From:To:Cc:Date:From; b=EjLlQE4PEOVec8zihsgV/qNJN+U/EnAa5yHCF5eFMIBCRKJVd5EB1zihEzzRJI96f BzsnzZDRD0PFZ8uuVTSIFBPrM7Vm/cGh1gzWH2Z9XzQHSMsBufklenIKdHu3JJNV/f D/tOnaSXeAnY8w5gGuE7k7HISKzVI9bGBAMKBSaE= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eqTXls4_4FLu; Fri, 14 Jun 2019 15:24:05 -0700 (PDT) Received: from jarvis.lan (unknown [50.35.68.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id A758F8EE134; Fri, 14 Jun 2019 15:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1560551044; bh=7IkzCl5xuesXjn4kt8C9Xue+PKpF+HaeTeLvv0akPX8=; h=Subject:From:To:Cc:Date:From; b=G2dVBLpwI9+wqT2dxWGEKnfaTTJvlvzw+zdy4AmVn9G7pNiATWg+ypGsh1OnZvaqp DIyAhPA18XF9Nt0D380NIb6EQaor4rKFsYUzhcFIJbUrv5GgtIHn63jpSr1gz/6Ubt cK2Xf/prhNWiiU7xu/P4xx1Lxl8pdXddnI7biPRY= Message-ID: <1560551043.27102.99.camel@HansenPartnership.com> Subject: [GIT PULL] SCSI fixes for 5.2-rc4 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Date: Fri, 14 Jun 2019 15:24:03 -0700 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A single bug fix for hpsa. The user visible consequences aren't clear, but the ioaccel2 raid acceleration may misfire on the malformed request assuming the payload is big enough to require chaining (more than 31 sg entries). The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Don Brace (1): scsi: hpsa: correct ioaccel2 chaining And the diffstat: drivers/scsi/hpsa.c | 7 ++++++- drivers/scsi/hpsa_cmd.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) With full diff below. James --- 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 }; /*