Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp806913pxb; Tue, 12 Apr 2022 14:00:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTwFiG7yvA+oQ6ewc+KIMAuFOcNiA3IK0+0M66vREy3KDuacAzeoTYYKOZ2q3N4Wha4Vwr X-Received: by 2002:a17:902:d2c4:b0:158:6bde:1d90 with SMTP id n4-20020a170902d2c400b001586bde1d90mr10677543plc.85.1649797239948; Tue, 12 Apr 2022 14:00:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649797239; cv=none; d=google.com; s=arc-20160816; b=Yfyi0mJWsneW6DW68oRn+FWB+kdw1GgCgnq+WHclofIbg8f1TpSc5sn8C3z+7G6Xmw SYvsFp/18nQx5Lg+7MK0ShB7kbi0SiYDhqJLC+jskl2Hrkn6FAKx1hXJJPMHj0bycggZ lk2+HQ3kE+hqzyCb9sygr6n5kekcmlF7IESOUejW8TmAGk1SE09tHQ+b9rpQ9v/WxNEp 7c1mvt6uZxjk8zV2COJrJFzfAWat8/DhapFAyIN2FWh7gGulyylvnz5mD/Ocnxt/r4dX OeHIPG2OaKhvhFV4grvIBzJHa6DoV/K65s3dyOp0z/wKze0O3jNoLwUWmA2nE1G9WvG9 MJoA== 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=I1nE0rDp0/3GiSLpUy4ZFO6zazicQVYHY72j+gMKfcI=; b=SlOLiEJt8dJaL+NYVcqihFoZJKQZeB4KVCmv3RV3Bmnh6i67qft005W+919Xl58dS9 SNDyZFrSkHXL0ytuky5BLcz4QFBBBqLoXgodGhlttqDA4ml3wZtpAOyDKEK1qnqOoB8a YfKoBHDOhvMFo2OXFyBp5u7QbliUqvSfmyDvE45TTsIeKqrzFbSO8UY5RcN6J3FMS6YE TyE5N5i3WlsxkwdR8hfOIwj6uC1XmQbGc33yQ/rRYIuR52kW0HhstBLRzZZeVit3oTdJ mqviKsWwiqj25So+NdUgZIPvQ2fdoIv+hEYnX+pC4zbG0OSK2MQbbatwCXfmu18og5v5 iTjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="nT5V/OaY"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id q18-20020a170902c75200b001581fe7543fsi8644164plq.521.2022.04.12.14.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:00:39 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="nT5V/OaY"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E1683D4C9F; Tue, 12 Apr 2022 13:22:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357491AbiDLHkX (ORCPT + 99 others); Tue, 12 Apr 2022 03:40:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353069AbiDLHOs (ORCPT ); Tue, 12 Apr 2022 03:14:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD20525291; Mon, 11 Apr 2022 23:56:13 -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 84626B81B43; Tue, 12 Apr 2022 06:56:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB3CEC385A1; Tue, 12 Apr 2022 06:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649746571; bh=g0S1xJM0BJ86DQH0IZzY6uj6KRFPYEHUsBoXY82RMEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nT5V/OaYrgKZ8qN8smnTC2Rx1RWODfjPS6FqlzAQekC9JL6RQN9G9bBiEucH2kDb8 Q5qBjuu+94kGb7ZDxcxJ40y8DnIr7TuKQBUR/1VLm2Yf1bZ/KzvR2ilzF9dr5ZJRU+ nKneX/8/xGDeDGXkMeyuWl5Iok6SCGC9884tCYII= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sreekanth Reddy , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.16 053/285] scsi: mpi3mr: Fix reporting of actual data transfer size Date: Tue, 12 Apr 2022 08:28:30 +0200 Message-Id: <20220412062945.202371210@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062943.670770901@linuxfoundation.org> References: <20220412062943.670770901@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: Sreekanth Reddy [ Upstream commit 9992246127246a27cc7184f05cce6f62ac48f84e ] The driver is missing to set the residual size while completing an I/O. Ensure proper data transfer size is reported to the kernel on I/O completion based on the transfer length reported by the firmware. Link: https://lore.kernel.org/r/20220210095817.22828-7-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/mpi3mr/mpi3mr_os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index fe10f257b5a4..224a4155d9b4 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -2204,6 +2204,8 @@ void mpi3mr_process_op_reply_desc(struct mpi3mr_ioc *mrioc, scmd->result = DID_OK << 16; goto out_success; } + + scsi_set_resid(scmd, scsi_bufflen(scmd) - xfer_count); if (ioc_status == MPI3_IOCSTATUS_SCSI_DATA_UNDERRUN && xfer_count == 0 && (scsi_status == MPI3_SCSI_STATUS_BUSY || scsi_status == MPI3_SCSI_STATUS_RESERVATION_CONFLICT || -- 2.35.1