From patchwork Tue Aug 24 10:01:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 501802 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp2993983jab; Tue, 24 Aug 2021 03:06:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU9qQ9ncnRzhs/WJZEp1gDjYW2gvs3ZsLv2fb7zFBAEUPndiJUj34k7C/PSzBZ8IKFywxN X-Received: by 2002:a92:da0c:: with SMTP id z12mr25883415ilm.205.1629799570547; Tue, 24 Aug 2021 03:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629799570; cv=none; d=google.com; s=arc-20160816; b=FA45cS54dNuVfeF6qS+gOSKoQGNfZ/TyoB0KynZhqRnIPnitbSba1s8qZJEvDJUttN JZrjcYLRPDAolxKPoasALLNrQ2dq84kyX7lNXvEK4Eier3h94tpkZ2bCFJKDBc+yK1Iz Slk5BQgL3PBevCO7t/VrQPH5/x432FK3D4VGig9XRu0ZMG8tfKipaGqiu5zSDipKguFk VTwW4dZ/9WhKz8wdMF6fPcSVB9Wlm0FwTkJNEXE3aATe8SGLIPSSLvF/7ZApNgS3p629 wwPGka2nAntIbRF04Gdm75soPK8oyU6dfDxQ/R3b/9CvGeHzCi7ejkKDJ9qUg1+TZ2aY YWSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=miMAW8yvGAShIiN25MckWUYK6tVzwixUIXdc86Z4plY=; b=fAsibY3l/DKpH2glkH4aZLRi6YR/d57DDDRD3ifvKQ0MV3jCbUQV/w308SGQHIgj0k 6J/eSJhQFz0dGqMlBprHPIjQEW5jdshFBJPXv0FahXKDlbpDJeSEqEjOXPLW7uaLe7dZ XYgt/53qpzRykDXStPyJ3/AfcRZtiqzhjSvLcC0AOn6Y1fsKfU7rw8yol50H+Yh5hXlB uEz3oJJRoVvllFOsNl4KyTLAtzWXy2Vy+EzEoCbdE0eObxd93L/pRT35PYJXhCE9xNg+ bZg2ju5M5u80+1WL7GmUK70qupjYDHd10C/9uXp9W6AzdThioicFba0aGuoqQV2c9dHQ VC+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si13300111ilg.86.2021.08.24.03.06.10 for ; Tue, 24 Aug 2021 03:06:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236204AbhHXKGx (ORCPT ); Tue, 24 Aug 2021 06:06:53 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3686 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236068AbhHXKGm (ORCPT ); Tue, 24 Aug 2021 06:06:42 -0400 Received: from fraeml743-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Gv4Tj03klz67Mm9; Tue, 24 Aug 2021 18:04:41 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml743-chm.china.huawei.com (10.206.15.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Tue, 24 Aug 2021 12:05:57 +0200 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Tue, 24 Aug 2021 11:05:55 +0100 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 5/5] scsi: hisi_sas: Increase debugfs_dump_index after dump is completed Date: Tue, 24 Aug 2021 18:01:00 +0800 Message-ID: <1629799260-120116-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1629799260-120116-1-git-send-email-john.garry@huawei.com> References: <1629799260-120116-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing The hisi_hba debugfs_dump_index member should increased after a dump insertion completed, and not before it has started, so fix the code to do so. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index cbc6c2d86745..f4517f3eb922 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -3688,7 +3688,6 @@ static void debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba) do_div(timestamp, NSEC_PER_MSEC); hisi_hba->debugfs_timestamp[debugfs_dump_index] = timestamp; - hisi_hba->debugfs_dump_index++; debugfs_snapshot_prepare_v3_hw(hisi_hba); @@ -3704,6 +3703,7 @@ static void debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba) debugfs_create_files_v3_hw(hisi_hba); debugfs_snapshot_restore_v3_hw(hisi_hba); + hisi_hba->debugfs_dump_index++; } static ssize_t debugfs_trigger_dump_v3_hw_write(struct file *file,