Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp666021pxb; Tue, 5 Apr 2022 17:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2fLNP8NaOsGfpIPhJw4+64ch+O7H25vlCUiJ0DkRO4Z3NhYcqwRj9GTCyni/pYOLUB656 X-Received: by 2002:a50:d098:0:b0:41c:bd64:b0de with SMTP id v24-20020a50d098000000b0041cbd64b0demr6158949edd.366.1649206659065; Tue, 05 Apr 2022 17:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206659; cv=none; d=google.com; s=arc-20160816; b=eetlDOt9B+V61KSCyzpSNiEGP0XgKkRkmPLPNPXL4H7bwKsT6S0m9Wxow+A9n9Fvlk pMboCBCFJjC0sej4sHik03tVlsYAmNGIPnUZXgEhh1WrkvqvqX3LBSRobPmHQAmVBbT7 RJckYy4YsuYghqZcpg1i7hIhl26BlRBKF1UhMB5cDEQ6qPsgDVS7iB3Z1q0UjpI4O9rn MoSGsz6OhAQis4nwhG9OGuj8/0mjYx6vKWIbJl3LLmMpJtQwNxbCm7/1H0moSq7H5mbc bq3imHwBhRAOPRLmYf4CLMAxaE7/JEfbJciAVyv92EGs2ViRNy+qmUCfkwC6/000ox/9 7cvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+JBVLoYEk6tpaZzop8HF/xEzpX9iFhy5tmv0AYc9eoA=; b=iRe0VbAnEon9LWmMDqgsltByqddkwezTTUzZHM5fVQpUibOUmbFQ01W1FMoVvaLUf1 XSXivAhgP3zeEX7oNzjVYP1VcFEqUUu41gV+kcvKlblHKQijFWTbdczNBuL7px8cjsTG Sjd4C03f7PRuZJC9bxcBXYgE8wkpYA3YawOPwoivTxaXP6fCqJwJGn3MaBh/L66ZvWC8 yPc4I+KbnycBD/HjJlsgqANXl3ieE1Mryhxjg8EKfQKw5SUzlidm/ON7rAfR/MlIqslK svjRZyBLaO8dwkNGONV5VVu2XLITn0fyl1VTmkFhpRZfqHhGE7+iaBh25CpPgULa5QMU KQIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k7An7QnD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a056402520100b0041950bc67c6si11195405edd.184.2022.04.05.17.57.12; Tue, 05 Apr 2022 17:57:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k7An7QnD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384148AbiDENcF (ORCPT + 99 others); Tue, 5 Apr 2022 09:32:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345734AbiDEJW7 (ORCPT ); Tue, 5 Apr 2022 05:22:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 291397658C; Tue, 5 Apr 2022 02:12:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 96C18614FC; Tue, 5 Apr 2022 09:12:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DD57C385A0; Tue, 5 Apr 2022 09:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149921; bh=SFn7HXy38WbuXIdV25XiRFO7vWz4qgzjQwSg/20WH1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k7An7QnDtbrTOdxlC47MV1kSUViawNsI7SLNUbF7zOciDqS41kRFPFusWiJ0FtX0N iGZsJt6g9qb2CbGBFabvyJs6CSxztPzpoiLzA17OUPdOn16VxnuiBqwpx9BDowfQqT ZjUVpXLMQSplw0rJ+rYmNTR5EFeApDae+u3/0+GY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Himanshu Madhani , Quinn Tran , Nilesh Javali , "Martin K. Petersen" Subject: [PATCH 5.16 0890/1017] scsi: qla2xxx: Fix incorrect reporting of task management failure Date: Tue, 5 Apr 2022 09:30:03 +0200 Message-Id: <20220405070420.647761568@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quinn Tran commit 58ca5999e0367d131de82a75257fbfd5aed0195d upstream. User experienced no task management error while target device is responding with error. The RSP_CODE field in the status IOCB is in little endian. Driver assumes it's big endian and it picked up erroneous data. Convert the data back to big endian as is on the wire. Link: https://lore.kernel.org/r/20220310092604.22950-2-njavali@marvell.com Fixes: faef62d13463 ("[SCSI] qla2xxx: Fix Task Management command asynchronous handling") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_isr.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -2498,6 +2498,7 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *v iocb->u.tmf.data = QLA_FUNCTION_FAILED; } else if ((le16_to_cpu(sts->scsi_status) & SS_RESPONSE_INFO_LEN_VALID)) { + host_to_fcp_swap(sts->data, sizeof(sts->data)); if (le32_to_cpu(sts->rsp_data_len) < 4) { ql_log(ql_log_warn, fcport->vha, 0x503b, "Async-%s error - hdl=%x not enough response(%d).\n",