Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4602166ybh; Tue, 6 Aug 2019 14:40:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1T0zRWYIe550ENDy7iZmNlBy9ZqV282rXh7HtMCG/Hvvlt5cE8VvPunU6IbTi+TEQ3e9P X-Received: by 2002:a17:90a:8c90:: with SMTP id b16mr5154472pjo.133.1565127615158; Tue, 06 Aug 2019 14:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565127615; cv=none; d=google.com; s=arc-20160816; b=xpC2sM9BK2sEz8zQD1+qnfs4J2nxB97IFB6qKbDbVCg6jGrs9B3TmnpmaWpSX/KVJ4 9dzjuJEJZYjeSNpN9FccUceNh41QLL4Cst6H7W6mc8F/9LuoAh6XNeIPLmyo1ZqH1A90 Tcc8e6MD+VqiwmdqYs9n3ups8KgB0rLdna+IApRTl+beZgkcDJEwywWAYoEi4jeZN+dg PwvhmmTe2eynDIwN9ZXwLL7TJZ1FEH8M5sCqxh9bz/IF7Ko+YU1PRSXRmlNYQZFmsRnT qqhrAL/90R8frpEV9gqYX/s7WwVqCl947ZmFdlcXIITZ7ms8wGqEXW9mCzvJzIm3h2GG QTPg== 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=cuuOFucG4G+04x+/PaMQlugxuB7YnJiDtS3FKGD1mzg=; b=q1FxRwd9RWVy8csdozi0HVdAmDCjo2WITaYIAsBtmjmOtP5vlr8v+vo0yAYyKTN9zA 9r6zTRvBc+Mulo79RW5IqyFAjzpEdRyTqx6LW6dgWxWNd7bJk9lNIALSxeCXsfFF3pb8 +ux8rmxYGGLbDnzlXfrPnT5QkH+Aftz7SICOxdW+XfopHS6Rdab2crEyx3GMU0vGTIBB wSgd6sHkkPHtpjhwizCdfeOUCruubH/NrKmKuJM0HSjJNeBDeAIU8hpmAfr1WYSECk3D cRHwzGFruaFXIQr49+f+d7UZJdNs8lY6Jp0RchsrWl7Ef/WUeKtX1HA1Bc8kFb26rC4U PCgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HVIiqojL; 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 l71si48654978pgd.314.2019.08.06.14.39.59; Tue, 06 Aug 2019 14:40:15 -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=HVIiqojL; 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 S1729633AbfHFViH (ORCPT + 99 others); Tue, 6 Aug 2019 17:38:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:55746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729583AbfHFViD (ORCPT ); Tue, 6 Aug 2019 17:38:03 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 0360B2189E; Tue, 6 Aug 2019 21:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565127483; bh=6++WtZkK6nDEnlyx/al3i56a+F9edKAwW/l6M1rHbpI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HVIiqojLZPxcmkrX6U0jmQ0Y4yH3YYdv46cxtTi7br5SZPXVZww7S+hXEYIL3F/A4 9C1xMpCeef9XdUkgD8ueK0gipUaKOi0fS14Y2qjRElnC3Jbq1um3iGcXkZpdf/DbB9 BDsyDr+QJqAzL9PqIMBebcsls3BtR6IcQ5uVNbQg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Don Brace , Bader Ali - Saleh , Scott Teel , Scott Benesh , Kevin Barnett , "Martin K . Petersen" , Sasha Levin , esc.storagedev@microsemi.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 4.4 07/14] scsi: hpsa: correct scsi command status issue after reset Date: Tue, 6 Aug 2019 17:37:41 -0400 Message-Id: <20190806213749.20689-7-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190806213749.20689-1-sashal@kernel.org> References: <20190806213749.20689-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 eeebce1862970653cdf5c01e98bc669edd8f529a ] Reviewed-by: Bader Ali - Saleh Reviewed-by: Scott Teel Reviewed-by: Scott Benesh Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/hpsa.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index e0952882e1320..fcce3ae119fa4 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -2153,6 +2153,8 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, case IOACCEL2_SERV_RESPONSE_COMPLETE: switch (c2->error_data.status) { case IOACCEL2_STATUS_SR_TASK_COMP_GOOD: + if (cmd) + cmd->result = 0; break; case IOACCEL2_STATUS_SR_TASK_COMP_CHK_COND: cmd->result |= SAM_STAT_CHECK_CONDITION; @@ -2320,8 +2322,10 @@ static void process_ioaccel2_completion(struct ctlr_info *h, /* check for good status */ if (likely(c2->error_data.serv_response == 0 && - c2->error_data.status == 0)) + c2->error_data.status == 0)) { + cmd->result = 0; return hpsa_cmd_free_and_done(h, c, cmd); + } /* * Any RAID offload error results in retry which will use @@ -5236,6 +5240,12 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd) } c = cmd_tagged_alloc(h, cmd); + /* + * This is necessary because the SML doesn't zero out this field during + * error recovery. + */ + cmd->result = 0; + /* * Call alternate submit routine for I/O accelerated commands. * Retries always go down the normal I/O path. -- 2.20.1