Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1022626pxb; Wed, 6 Apr 2022 06:58:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb0yb9PAWxIzgDTWs7DvNMtVuRI0//2ZbJTF0iDVwwmP2DgL5OA3Xwh2rbPtiiKgsl5W69 X-Received: by 2002:a05:6a00:2392:b0:4fa:dcd2:5bc1 with SMTP id f18-20020a056a00239200b004fadcd25bc1mr8926043pfc.8.1649253528687; Wed, 06 Apr 2022 06:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649253528; cv=none; d=google.com; s=arc-20160816; b=Z4aSECqKYfw4IdO1CcC3cD3ikyi9ZeSuHsfHA7VflzCBKBLQU4+pXDSpAH61ZyfW3n zJElmkIQ8W2Z0suylkyO8A/6Hh2YmQxawtkl7zLZuVP2lXa6G+efEm08E+35w912gx6C hfXlTV5CpSMpvWfO0osx6z3HxKlSvTVeYa/RT9C9Hr+6Pnx9DsF8dHXaiB8GKcizj7+N R3G1Kov5yvWIqAVFMQQhlqJOzCzyCdt2KNYrsI8tyM7dFaVyhIk8tnoCIV3Xzg5b9xKx gGcVq1wN6xDVG6TMYrjgW8y87bY9nVkI/wLpxh5FN56mAQIefK2fG5B3j993bwNkjZFy X2/w== 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=VBkpGUlFY3yIAf32NSff2EhfrUuc5XeMsvOWOV0swxI=; b=DHRu1VB5T24+965IK+RbWImmS4OV6RwE/DomHH/1oHnqG7lU/lHiKpC6afohaaxgek 5/jxjju8ZsHNfL5l2/tMui0+l5+9eIgpDZW9njpBkP3SmzlpkIbw6sR9h5d4/g4WwZpB BbqIaV9gyiNsFDtFDmiNBKOsyxtogzOlUjUJPCSqiP07AiMsImYAAMJhz/x1aO/G0rSh oje1hXB18TJXfhsF0qzWTJQnVpgyot1Nln+KGHi974etrOZj9rbSSL2bgqThwhWb2hmt PhqVZO5GcbQseXiwifXLGX4YVSS/2lZSqXE+wL9DJGBp4IhMwemL/Y88UYgVoNmhnmhD DzmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S6yWCc3z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z6-20020aa79586000000b004fa95dfe8f7si14536537pfj.174.2022.04.06.06.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:58:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S6yWCc3z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7D3C91EE9FB; Wed, 6 Apr 2022 04:50:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441874AbiDEWKT (ORCPT + 99 others); Tue, 5 Apr 2022 18:10:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353526AbiDEKIF (ORCPT ); Tue, 5 Apr 2022 06:08:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00EE7C12F9; Tue, 5 Apr 2022 02:55:12 -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 ams.source.kernel.org (Postfix) with ESMTPS id B64E1B818F6; Tue, 5 Apr 2022 09:55:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2078EC385A2; Tue, 5 Apr 2022 09:55:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649152509; bh=/I/zLdzm2gsuJ9WWc/ryxB706G+Iv3NgRS+greiYe5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S6yWCc3zcJCd33u/oeR9H5QHxAU5Wu08cTLbGiH5f2Qo+nNM04orCZPKKPqz1G9T4 tk+C3rTWTm3yps9vobgVIeJJels+cO2MrTrhYQ2xq4Piwshz/Ez/7bl4KhtjrQyay3 eUtc7AQptr1eUexODYzlbaFkv0G/xnbyyTyrHHWc= 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.15 802/913] scsi: qla2xxx: Fix incorrect reporting of task management failure Date: Tue, 5 Apr 2022 09:31:04 +0200 Message-Id: <20220405070403.871983146@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 @@ -2494,6 +2494,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",