From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-1841884-1518709759-5-13325920016487716060 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no X-Spam-score: 0.0 X-Spam-hits: BAYES_00 -1.9, HEADER_FROM_DIFFERENT_DOMAINS 0.001, ME_NOAUTH 0.01, RCVD_IN_DNSWL_HI -5, T_RP_MATCHES_RCVD -0.01, LANGUAGES en, BAYES_USED global, SA_VERSION 3.4.0 X-Spam-source: IP='209.132.180.67', Host='vger.kernel.org', Country='US', FromHeader='org', MailFrom='org' X-Spam-charsets: plain='UTF-8' X-Resolved-to: greg@kroah.com X-Delivered-to: greg@kroah.com X-Mail-from: stable-owner@vger.kernel.org ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=arctest; t=1518709759; b=eaeiOI9jDmlGK5g6WHKEOk+Zp4vJUKo89lGWv7OosKvxQhJ Fr1YSekFQTbtxim6QE2oRGE3dRcBvcbVEco4eW3bsSjwLYvcKhBeCQQMuH04RGsw bNy2btLZSxh+i6EjaV6RV153H2yasAqb9bsv/vd7O2zsVF6bpATMndep4K5VEX8N LDN5xim5D9ho91N3oMZhcj7XxKKQjZM/18XOywU7cfyeyNBkF8raF4VCNCTFBu5h SFoDPLW5qVAvtBcnutdrnUq4eX8LbJuIKzECVvvFWTIetEY3L8td0RUyqkxY4WMg tHvBYLe+3gT2KMW4sofhsxRtznzyamh6JE8Uvaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender :list-id; s=arctest; t=1518709759; bh=o3swicdNpwaq3XLuJQ6OzuZEcc Bnw0l0vqPcGE3HYzQ=; b=sptY7fs23XNHfmzRRffD5BXaqeKPDPJYFf3fBO2Xvi SdTmVZ3FIhogoPrqiiQxD0OLbkxGNKbIGKGMpd25X5yQG5mVaG/Xp/3lUiGyLW4K eZXR/Ay8+tIvIi1Nd8kPwQon7iNqWtPHJHCgD1Kd53nkTIIiG4u3blFPUBpShGP6 XTBXzOzmiN1y3nT1NhMMxWieiZ2AjVKnPHFIbfi7LxXDE/NFyj5eOUCNfOkQTySM GLsUo4s6+HuSQ9+Y4CfuVd+1o5eoaB5qTuOhFYW3nkFl3ZLX/rpPXkVDB0tf7LQc LIFC8yg7lDxtKzwv6hgUPM1Ti75RMfzcTJ9E7m3EfPVA== ARC-Authentication-Results: i=1; mx3.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=none (p=none,has-list-id=yes,d=none) header.from=linuxfoundation.org; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=stable-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=linuxfoundation.org header.result=pass header_is_org_domain=yes Authentication-Results: mx3.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=none (p=none,has-list-id=yes,d=none) header.from=linuxfoundation.org; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=stable-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=linuxfoundation.org header.result=pass header_is_org_domain=yes Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424715AbeBOPsu (ORCPT ); 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 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: stable-owner@vger.kernel.org X-Mailing-List: stable@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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);