Received: by 10.223.185.116 with SMTP id b49csp2273589wrg; Thu, 15 Feb 2018 09:06:13 -0800 (PST) X-Google-Smtp-Source: AH8x227uNCnZVr2HuCMx0wH40m7kVZBItSSZpP1iujRXCxC3hAcwmYmPjWwgSv33bAQZAG8PMitB X-Received: by 2002:a17:902:59d3:: with SMTP id d19-v6mr3130705plj.394.1518714373743; Thu, 15 Feb 2018 09:06:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518714373; cv=none; d=google.com; s=arc-20160816; b=U3azKO6DE6HwlDpX2i5sN4fhHj0lPgTk1g3yRegen/Mn60yH7VHxrp9M1U6naxsVmE fsgiPAR12hA1SYTBokY6w1OFuo6s98srgbMA/cv2kCbpDt9dtNIM/zhi3jz8H+BL4E5u N/y8seF7XNoQvL9CilxeTtFbC9egPu6lVk8y590ywBkFPWv1mln2K0m3nBJ61Cd65yho Sg1UIEUZV6VAJHB4GDK1+0NC9RuZXIMRXidGdSvRuRCWF7ms2KsJAoSfU6vKDKKm2rZu Gve1WuTUtxX4R7G7YvaTDVJdtuvL0pQPkSZcWeLVMteUL/JFgA0RIyZCbJfSBF7yRnWo Alyg== 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=JMmqeCSHQclvXok/LY64dBzAFogYXRJfeBArcLcDQH8=; b=DtgF5zzYKA1BS7v4hL7avyhmpgBTyQKoNjH4p7flcbpCs6tM95JyJdsJqMPYC8DIjo 5YJy56g/HHMZiMEozxdrgnhKGsexpVy1t6uZ6HbZ2SnTigOg2IzKbr/R5F+VW+D+r4QK 9MSTU46ddBvwE1OdzyrZy/poHVWUAiESxJx6bk3l9MA85xBdLN5Wp2rCuJ0MBCrMg2mx w1BCb0JvJsHW6AOeBDQXAKSdd1qXW7DJ6fIWd6OzHB3rVcG11QbmiXJlDMt6NEyx4xZz B3LG7s72LXxsj7TtOxwIVn99c1IphdWdimKy0nzGTC7nbh7NcEhkVwAJmFJtYTFl6CzW /1Yw== 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 c23-v6si1646958plo.45.2018.02.15.09.05.54; Thu, 15 Feb 2018 09:06:13 -0800 (PST) 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 S1423347AbeBOPig (ORCPT + 99 others); Thu, 15 Feb 2018 10:38:36 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:59446 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423334AbeBOPic (ORCPT ); Thu, 15 Feb 2018 10:38:32 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 502AD10C0; Thu, 15 Feb 2018 15:38:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Uma Krishnan , "Matthew R. Ochs" , "Martin K. Petersen" Subject: [PATCH 4.14 195/195] scsi: cxlflash: Reset command ioasc Date: Thu, 15 Feb 2018 16:18:06 +0100 Message-Id: <20180215151716.146947676@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151705.738773577@linuxfoundation.org> References: <20180215151705.738773577@linuxfoundation.org> User-Agent: quilt/0.65 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: Uma Krishnan commit 96cf727fe8f102bf92150b741db71ee39fb8c521 upstream. In the event of a command failure, cxlflash returns the failure to the upper layers to process. After processing the error, when the command is queued again, the private command structure will not be zeroed and the ioasc could be stale. Per the SISLite specification, the AFU only sets the ioasc in the presence of a failure. Thus, even though the original command succeeds the second time, the command is considered a failure due to stale ioasc. This cycle repeats indefinitely and can cause a hang or IO failure. To fix the issue, clear the ioasc before queuing any command. [mkp: added Cc: stable per request] Fixes: 479ad8e9d48c ("scsi: cxlflash: Remove zeroing of private command data") Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/cxlflash/main.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -620,6 +620,7 @@ static int cxlflash_queuecommand(struct cmd->parent = afu; cmd->hwq_index = hwq_index; + cmd->sa.ioasc = 0; cmd->rcb.ctx_id = hwq->ctx_hndl; cmd->rcb.msi = SISL_MSI_RRQ_UPDATED; cmd->rcb.port_sel = CHAN2PORTMASK(scp->device->channel);