Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1824988imm; Mon, 3 Sep 2018 10:24:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbP/Q3SWH+NlXmmosFQfBd/ZrgZvAj/uFYwNtZKqXaSKGmh5+V7UAHxQnE9ipB1wrf0YRLl X-Received: by 2002:a17:902:28aa:: with SMTP id f39-v6mr29938389plb.150.1535995449702; Mon, 03 Sep 2018 10:24:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995449; cv=none; d=google.com; s=arc-20160816; b=byCJA0pNadhL2F6rQwT70YLEwbrzIqWZYdmsfUeSXLK3ir9JPyvN9YK8yOwMpGIYLk SfdKWjOFq0DqUZKC9jeHdYccqNZfOtjR1uWxPZ3tS1TaQTC6MDRk89p6pu4s8cbJ1AlR KcM1fu2rFgfGWcfMAv4lUKvQCNcpWAGvteMZ5LiJ/jS0SjFrBtclXjmEWmHT55cd5HwI y19lTmhBeIozRIL3gL0M4AIRTxiBwx6XE96xsZH0pcyhmKotdpODQ26K4ug6YFtyzYkC A0ZArAJKJ6da9pVcFVewSUfwPLfTO3LU+Rc95MNMHo+qYXedNGLXqO4r7+ERESokttwA +G1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=m+yE/HN44upGaOE1lNMOnkUs9qJxYvz+3vSFyPJlnlc=; b=dbnWg+xRb0QJLX/9ZgEYC2RBQHx/mUV8BlaTVgsC5GKN2Y/WkjE4NIN9g2oWHa6ZiW UtXTHqiyH0vD9KxX4bxU4yODtnX3wTmdwncu5DFT3cA8uVr4p1BJ3MgwJXlDUGirnscZ zteyJxYmiiKXRuVuMjw4WwPtuL0o7stVNkJvcnJVqjtaT8zb2KHQ/zNo0tXTRpQmq6P5 EmtihpaTux1tJtfdAdc5QDSt6p3ZH9YJCGeOrUBxjlZz3E38NgOkuEmeVN96JPpgkUNn Dwxqb4gyVU+Y7yFIho0uwYkI6nDO32kqZkyjcqTNIL//5bqswDwK+MxrUWDYZrLx037r T3bA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4-v6si19310788plr.213.2018.09.03.10.23.54; Mon, 03 Sep 2018 10:24:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730119AbeICVnE (ORCPT + 99 others); Mon, 3 Sep 2018 17:43:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43296 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727873AbeICVnD (ORCPT ); Mon, 3 Sep 2018 17:43:03 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 53E21D2F; Mon, 3 Sep 2018 17:21:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jim Gill , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 081/165] scsi: vmw_pvscsi: Return DID_RESET for status SAM_STAT_COMMAND_TERMINATED Date: Mon, 3 Sep 2018 18:56:07 +0200 Message-Id: <20180903165659.140330968@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jim Gill [ Upstream commit e95153b64d03c2b6e8d62e51bdcc33fcad6e0856 ] Commands that are reset are returned with status SAM_STAT_COMMAND_TERMINATED. PVSCSI currently returns DID_OK | SAM_STAT_COMMAND_TERMINATED which fails the command. Instead, set hostbyte to DID_RESET to allow upper layers to retry. Tested by copying a large file between two pvscsi disks on same adapter while performing a bus reset at 1-second intervals. Before fix, commands sometimes fail with DID_OK. After fix, commands observed to fail with DID_RESET. Signed-off-by: Jim Gill Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/vmw_pvscsi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/scsi/vmw_pvscsi.c +++ b/drivers/scsi/vmw_pvscsi.c @@ -561,9 +561,14 @@ static void pvscsi_complete_request(stru (btstat == BTSTAT_SUCCESS || btstat == BTSTAT_LINKED_COMMAND_COMPLETED || btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) { - cmd->result = (DID_OK << 16) | sdstat; - if (sdstat == SAM_STAT_CHECK_CONDITION && cmd->sense_buffer) - cmd->result |= (DRIVER_SENSE << 24); + if (sdstat == SAM_STAT_COMMAND_TERMINATED) { + cmd->result = (DID_RESET << 16); + } else { + cmd->result = (DID_OK << 16) | sdstat; + if (sdstat == SAM_STAT_CHECK_CONDITION && + cmd->sense_buffer) + cmd->result |= (DRIVER_SENSE << 24); + } } else switch (btstat) { case BTSTAT_SUCCESS: