Received: by 10.223.185.116 with SMTP id b49csp2188317wrg; Thu, 15 Feb 2018 07:50:31 -0800 (PST) X-Google-Smtp-Source: AH8x22428BtKl5+qknmAINZ5zRPd4g8zpm67Ag5kHGa2R71YZqWH7bMq8PWziGiLWvYijef2YGTM X-Received: by 2002:a17:902:6946:: with SMTP id k6-v6mr2955366plt.205.1518709831612; Thu, 15 Feb 2018 07:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518709831; cv=none; d=google.com; s=arc-20160816; b=gzm/FvSE71oAH3vWkw5olMhrhQmoP7rg1qlZKQyI5QsAAMeg0H07KSrdLxtnLd0ogp FtBKem/s2RM4QeRkzFBG9T7oWAcRprfRc1vXkJ7Z3MniL0VS3o2JH+Z+o9wGhpVWBGDY tHxP5JDbvfRju01YPLMq+aZWKtJquubnLQmNgVqzMWby+yzqKKkE9BgVg8xT6DpyRMTV R2ihJ1VFBGidKJau83pHjYkNZpcu1Q8prpFfHlkezTnIFkn+cE4dd4yQEW6L2sTJNFPz t1iLCWJU2otE5p5P/celgnxXJB/t1FuBHG1sKQSrXhG8tOP/hnW8cfV6L6TwNTYvAW8i 16rA== 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=o3swicdNpwaq3XLuJQ6OzuZEccBnw0l0vqPcGE3HYzQ=; b=ILdAPGD3GULKdvbmLi0qcAWNXNObNEkwRP2CBTxxpwgeRuZ92nx4kdXSwhgIUop77w zWvk/LAQQzdJTS+c2DIw8fQTHLAd00nCiaJFD4dQ8F3VuH76l3wkR5UtUxJkNDMWP2an XrB4rdu6FMVAJsqmG+YrwpSZblEp+QMQ32rnaJjLHbV0PNgfpBHoARQatRw4wOY4qJNv iVT+ufwJEMg2lNKDpaO6xFYvQsaxj4xeEYfWDBFHvEU+fytMSsOzjDJw86mXMFPyovss GCcXYNQ0C1IoR8KS/fgioTdcLI7nPVRdFMWFpt2s4HnbPR2UW7y57Xx5xbdyFdYGU7fE YvyA== 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 a62si1406497pgc.650.2018.02.15.07.50.16; Thu, 15 Feb 2018 07:50:31 -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 S1425102AbeBOPsu (ORCPT + 99 others); Thu, 15 Feb 2018 10:48:50 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36496 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424663AbeBOPsP (ORCPT ); Thu, 15 Feb 2018 10:48:15 -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 101AF108A; Thu, 15 Feb 2018 15:48:14 +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.15 202/202] scsi: cxlflash: Reset command ioasc Date: Thu, 15 Feb 2018 16:18:22 +0100 Message-Id: <20180215151723.228605143@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@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.15-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);