From patchwork Thu Feb 10 09:58:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 12741636 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEE60C433FE for ; Thu, 10 Feb 2022 09:48:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239001AbiBJJs4 (ORCPT ); Thu, 10 Feb 2022 04:48:56 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239021AbiBJJso (ORCPT ); Thu, 10 Feb 2022 04:48:44 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E904C138 for ; Thu, 10 Feb 2022 01:48:45 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id i21so7782978pfd.13 for ; Thu, 10 Feb 2022 01:48:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=SHislU+NeeqYgOP5VfRm8/Gf/+lEikgdd//bIbwUA/c=; b=EIFg2W50iUjf2Y8W5bJa3m37FZ+ArAKlUzPOQ/usY46/V7e59/vyQokYLyAptHd9/U zVn0eic4Rpzx1Wc4XqDe16WpulGt1IUwb3pQlhSN5EqK0v4kfHRhb2bp4p4LWQcaXQS0 yFght7SpyNDnL9yR6ErgJUsb3YvmVHnoI55mw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=SHislU+NeeqYgOP5VfRm8/Gf/+lEikgdd//bIbwUA/c=; b=GshDNZU1MVeea8c/bBZGISiyfUUTOj/1NH1vOEZhUYeNEIzuTcI0xywfIqUwUNRLEZ gmSi7T3W24zOBWCU5O9LH9cTRgQ/F6r/SkX5F//nQfCqZdKEkhwYXDHbt95EYomhBub1 hXamIDdgEogF02S+X14VKld6H9WNSE9wpVAsE7z5frp+HZPa1MTRtnoN77n0vxP1Wdgr DaUsqys/q1iGmLVyCwTBZ6EDHiE64+wiz8joCwPe8bg+DRY7pc81tQArpAmm6mCTnTpd 9Jfy+pPrenVHtUfUM1Hp1uPDH3+aJI6Pby9ubXMxryxQdF3JbC6tHveaYRS5H35NGuvM gCzw== X-Gm-Message-State: AOAM5327npQO//8VACctbFFqo5eeKyzco+BElPaxz6p/uX0IBVRraNAT lo7gov5INlHseUKNYgptZ1DBL8Hn1znR+DFp3um0icd7IDILIGsxDUDuxwBCBhKVnnMaSO03FZ5 mjOWvpTLJvTp+jtOzR2FhdB3pd47+y6HfNQt4CW+mRnUdyf8asjzVr7qOux1vjpeyrJZBLRELdU 0sys3nse82v1g= X-Google-Smtp-Source: ABdhPJyfuGZ6sWSo7TlFvjGrObUyqO5bCIeukAwN8jvUQK75WZh5101L1BUTT6YzV8E/MzY2mNp2FA== X-Received: by 2002:a05:6a00:a87:: with SMTP id b7mr6651895pfl.51.1644486525105; Thu, 10 Feb 2022 01:48:45 -0800 (PST) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id o21sm23706698pfu.100.2022.02.10.01.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 01:48:44 -0800 (PST) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, mpi3mr-linuxdrv.pdl@broadcom.com, Sreekanth Reddy Subject: [PATCH 6/9] mpi3mr: Fix report actual data transfer sz Date: Thu, 10 Feb 2022 15:28:14 +0530 Message-Id: <20220210095817.22828-7-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220210095817.22828-1-sreekanth.reddy@broadcom.com> References: <20220210095817.22828-1-sreekanth.reddy@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The driver is missing to set the residual size while completing an IO. Hence, proper data transfer size is reported to the kernel on IO completion based on the transfer length reported by the firmware. Signed-off-by: Sreekanth Reddy --- 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 1c2e7d3..dd15c1f 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -2600,6 +2600,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 ||