From patchwork Tue Jan 26 11:04:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 370618 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4909574jam; Tue, 26 Jan 2021 04:14:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8NHVI/mIKH+6NTTqwMVwLT7w+0gjdq84LqMVE4Fju1YEjfB7mhZ1pKa8B7EADMnoaa2/A X-Received: by 2002:a05:6402:254b:: with SMTP id l11mr4293341edb.202.1611663242838; Tue, 26 Jan 2021 04:14:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611663242; cv=none; d=google.com; s=arc-20160816; b=TA2MFoaFAw91b65TmyyV3i0CmHkBuJ4rJjS7aYzkezJhA8xBtbkDeMuDusNPsbrVxP YBAFRXmk7YWjsr8dNA8EiIpwk1iB8zIDOfd1yzAStofwgZVM1YBHnRLJzt7yIL3jEvTj tUucoat6WmQKjV1N+yqhYvi0ZFgVIJ49EBA/YQ7qG+IHDJTjJczGKwqmpnuZyv2UHyqZ n26NfHiBIOVit8oJkr3egMI4/gbnV3HTobAkM/4UJnvDVhtQmh5NzD2gcep4arhxOAqk at4FMu0J0kzV9DSWrL1Fxgy+idz6mvAL1X2dj2wFwNfPV0t+veY4M/KBf2gdgVXzSnrv 2AFA== 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=yDIi6u7px+yQuANa1R5mB0O4fbbZHthViMNGx59LxYM=; b=rIIzO/Mypby/wa1TxGZet13X3uvGpFxMv9t4ohx7FdYA+Dbqv/DRW5GuvQ3KtgXsrV M2HtnljSWsdt0zo5VEqgXtLf7deTf+3gWL9Bab8ySuvdVSo9758qQIqc71cbQSdIN2SP YDPoW06skOirkAUWy1/b52nUa+oiNRgQQUNrXES45/RfnB9Va+qoTjLH/asMVhE+KA6P AoUT8djw5QO61NREhSOYlQuLnk9S2REV5EZDuC0r9fBPkCfb29aC7hPIYB2YNRhHcGkL GFMrstTuOnrgigDFQF5ITfAL5nTB1PpR3ieH79Z14TxtwhA+rsN2UdlTRifyQ8DZd6qz mh3A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a73si8889453edf.23.2021.01.26.04.14.02 for ; Tue, 26 Jan 2021 04:14:02 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405096AbhAZMNR (ORCPT ); Tue, 26 Jan 2021 07:13:17 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:11881 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404904AbhAZLJS (ORCPT ); Tue, 26 Jan 2021 06:09:18 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DQ3pw2Y5sz7Zpw; Tue, 26 Jan 2021 19:07:20 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Tue, 26 Jan 2021 19:08:24 +0800 From: John Garry To: , CC: , , , John Garry Subject: [PATCH 1/5] scsi: hisi_sas: Remove deferred probe check in hisi_sas_v2_probe() Date: Tue, 26 Jan 2021 19:04:24 +0800 Message-ID: <1611659068-131975-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1611659068-131975-1-git-send-email-john.garry@huawei.com> References: <1611659068-131975-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The platform_get_irq() check for -EPROBE_DEFER was to ensure that all the steps to add the SCSI host are not done and then only to realise that the probe needs to be deferred. However, since there is now an earlier check for this in hisi_sas_interrupt_preinit(), this check is superfluous and may be removed. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 12 ------------ 1 file changed, 12 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 502ad3e4f7cd..46f60fc2a069 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -3627,18 +3627,6 @@ static const struct hisi_sas_hw hisi_sas_v2_hw = { static int hisi_sas_v2_probe(struct platform_device *pdev) { - /* - * Check if we should defer the probe before we probe the - * upper layer, as it's hard to defer later on. - */ - int ret = platform_get_irq(pdev, 0); - - if (ret < 0) { - if (ret != -EPROBE_DEFER) - dev_err(&pdev->dev, "cannot obtain irq\n"); - return ret; - } - return hisi_sas_probe(pdev, &hisi_sas_v2_hw); } From patchwork Tue Jan 26 11:04:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 370619 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4909579jam; Tue, 26 Jan 2021 04:14:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwO8FyAIPrczlFO5eFbim36E2NdVrDGH/V1NVddGa0Wb57/AHpLakNM92zBFEO67NMdIrY2 X-Received: by 2002:a17:906:7a42:: with SMTP id i2mr3414282ejo.27.1611663243172; Tue, 26 Jan 2021 04:14:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611663243; cv=none; d=google.com; s=arc-20160816; b=il7KksA4lhiht5UlyIlGXD3r4GU8WYytbArGnMY61SHzbpSDMgf6A8FqkUN9XVqYZn AbgDSEGaa45b0RiiZDvouIJBbp+gH2CBqxcJu7Hyd6GtPY2YtFuPxzpTAFwKuVJrbyHz YJLmZKIOYAOafDMFK0dczRUvwDLwhPJnO/kK4MNU9LKFR7eDhtrPQUWiFldshdftlUAt BGzIRM6wLjWhTBMmoAzG53CqM1oaqVpkBeRO5VXF+hs7MaADc9QtzMCTMvkTlzq3qrP2 8cl1aq0bxnfRIU/y6cRaYW5uDFI8SxbxOOKQDKSXqr1IefYIogvh7z5TNGj+ra3n9Wov Iaxw== 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=1mmEw98Ob5714/PyQnx0POH0Iprr+HZtG+gKtZ1ZqNQ=; b=sFSJiUIVKcQESJ0au5SWzxHQqNejdDS9jM9clTcUlM8Dr8RQoU3GjaWsOHHnNDRrO+ t1uRQIZep9D1ufRB3GpcHhAJHuTvFJvBKd7nx2/xDZ3hgKIzJrHUTkQCM3mfGyvBBSvn ttmIbadQr+2nACsBbZw1DH9NUFE8G2ecLayVHUwCktAeZHn4kKfSikkZJ31MpAdJOYZ/ DJIiqLqADca7nHEEofgHq1lya+ma7CWvDR8/IG/ms/idyk2Tc7waOm3gPeADSLK9e0O5 vPjIptW9sjYSCcrBx2gv5WTcr5sWYRIwg57tgRSrleNkRgrAOq5ME3N3oSX/k4dSP7c9 cL4w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a73si8889453edf.23.2021.01.26.04.14.03 for ; Tue, 26 Jan 2021 04:14:03 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405132AbhAZMNT (ORCPT ); Tue, 26 Jan 2021 07:13:19 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:11882 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404910AbhAZLJS (ORCPT ); Tue, 26 Jan 2021 06:09:18 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DQ3pw35q2z7bKw; Tue, 26 Jan 2021 19:07:20 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Tue, 26 Jan 2021 19:08:25 +0800 From: John Garry To: , CC: , , , John Garry Subject: [PATCH 2/5] scsi: hisi_sas: Don't check .nr_hw_queues in hisi_sas_task_prep() Date: Tue, 26 Jan 2021 19:04:25 +0800 Message-ID: <1611659068-131975-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1611659068-131975-1-git-send-email-john.garry@huawei.com> References: <1611659068-131975-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Now that v2 and v3 hw expose their HW queues (and so shost.nr_hw_queues is set), remove the conditional checks in hisi_sas_task_prep(). This change would affect v1 HW performance (as it does not expose HW queues), but nobody uses it and support may be dropped soon. Reviewed-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 625327e99b06..d469ffda9008 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -445,21 +445,19 @@ static int hisi_sas_task_prep(struct sas_task *task, } } - if (scmd && hisi_hba->shost->nr_hw_queues) { + if (scmd) { unsigned int dq_index; u32 blk_tag; blk_tag = blk_mq_unique_tag(scmd->request); dq_index = blk_mq_unique_tag_to_hwq(blk_tag); *dq_pointer = dq = &hisi_hba->dq[dq_index]; - } else if (hisi_hba->shost->nr_hw_queues) { + } else { struct Scsi_Host *shost = hisi_hba->shost; struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT]; int queue = qmap->mq_map[raw_smp_processor_id()]; *dq_pointer = dq = &hisi_hba->dq[queue]; - } else { - *dq_pointer = dq = sas_dev->dq; } port = to_hisi_sas_port(sas_port); From patchwork Tue Jan 26 11:04:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 370622 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4910684jam; Tue, 26 Jan 2021 04:15:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJynvRpC8kUwvaSIZra+V0krvD6JHIU4ReLnzwwYHJTTccjtqilnm8e9Myc/g2AL7EYn9Wlq X-Received: by 2002:a17:906:538c:: with SMTP id g12mr3281251ejo.248.1611663325859; Tue, 26 Jan 2021 04:15:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611663325; cv=none; d=google.com; s=arc-20160816; b=Bc0NZleDOI7ulW8H7VtWRZfSCNjlxP+WKSOcj7DaSTeexmNMQEKbPzdrd9ME65YmsT o7qw6t05f7yI2VDdYjyqAQDBjy+mSOHwfUiHhaLAcSeKrIEpUKNWy7p+/ekbZ996QMDo tj4s42YkSl9JPgWR8h69tg1D/YGD2CrVVigjXohHyFQvcl7Xi/7G1Uqtox6wiITVQiFz ULN8zWxlpPRtGbVab2zX7a8BmVft47sX1CCBxXsmY1NTgI30RhZP0jP7YnrE6pPGd+9c o5hNtTmmZS6xBL37z8WCAIrw1f1bs54i2TLgzAc9qoF2bFWLJOedaJL2QIBc4PVK5dfE RdQg== 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=Eucm/cZtk4viEdhV/6OjPf2K1jkR8pvnu9W5g9DgSFs=; b=hM5Uijycviln5Ar28SDx5XRjkv3TunQOpUPe4DfDk+9mBHilm+0dTb90TlCrMjmG6d U4eoglS6a4+kyHtbZp4PRISNkyjVLQnq51VjnucEg4id5atv2Cuh2wLBQ0WcmnYxEQCX 0+WRXqQZJN87NPIXnF+DblkDPEg6zyWyltpxEUvunjSYRHlxgTJ+d+gd60E0b7wKWlqK rboqrKL0DWW2nfWUJA6fSDkTYZxYUEwBroyJWCkWzPndDt/IDKYTN0/ajy5HWNh5adGm C30V1xEXitKJyj79MdWBwyDq/hYAfWGY6gySe0+st1IgC++TWvOV8DDaE/KgKQ3Hmfa9 /v2g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp29si3539916ejc.304.2021.01.26.04.15.25 for ; Tue, 26 Jan 2021 04:15:25 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405019AbhAZMOD (ORCPT ); Tue, 26 Jan 2021 07:14:03 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11597 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404899AbhAZLJS (ORCPT ); Tue, 26 Jan 2021 06:09:18 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DQ3pw1yM6z15yMc; Tue, 26 Jan 2021 19:07:20 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Tue, 26 Jan 2021 19:08:25 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 3/5] scsi: hisi_sas: Enable debugfs support by default Date: Tue, 26 Jan 2021 19:04:26 +0800 Message-ID: <1611659068-131975-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1611659068-131975-1-git-send-email-john.garry@huawei.com> References: <1611659068-131975-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing Add a config option to enable debugfs support by default. And if debugfs support is enabled by default, dump count default value is increased to 50 as generally users want something bigger than the current default in that situation. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/Kconfig | 6 ++++++ drivers/scsi/hisi_sas/hisi_sas_main.c | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/Kconfig b/drivers/scsi/hisi_sas/Kconfig index b8148b1733f8..4ba3a8eadb77 100644 --- a/drivers/scsi/hisi_sas/Kconfig +++ b/drivers/scsi/hisi_sas/Kconfig @@ -18,3 +18,9 @@ config SCSI_HISI_SAS_PCI depends on ACPI help This driver supports HiSilicon's SAS HBA based on PCI device + +config SCSI_HISI_SAS_DEBUGFS_DEFAULT_ENABLE + bool "HiSilicon SAS debugging default enable" + depends on SCSI_HISI_SAS + help + Set Y to default enable DEBUGFS for SCSI_HISI_SAS diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index d469ffda9008..a979edfd9a78 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2722,12 +2722,21 @@ int hisi_sas_remove(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(hisi_sas_remove); +#if IS_ENABLED(CONFIG_SCSI_HISI_SAS_DEBUGFS_DEFAULT_ENABLE) +#define DEBUGFS_ENABLE_DEFAULT "enabled" +bool hisi_sas_debugfs_enable = true; +u32 hisi_sas_debugfs_dump_count = 50; +#else +#define DEBUGFS_ENABLE_DEFAULT "disabled" bool hisi_sas_debugfs_enable; +u32 hisi_sas_debugfs_dump_count = 1; +#endif + EXPORT_SYMBOL_GPL(hisi_sas_debugfs_enable); module_param_named(debugfs_enable, hisi_sas_debugfs_enable, bool, 0444); -MODULE_PARM_DESC(hisi_sas_debugfs_enable, "Enable driver debugfs (default disabled)"); +MODULE_PARM_DESC(hisi_sas_debugfs_enable, + "Enable driver debugfs (default "DEBUGFS_ENABLE_DEFAULT")"); -u32 hisi_sas_debugfs_dump_count = 1; EXPORT_SYMBOL_GPL(hisi_sas_debugfs_dump_count); module_param_named(debugfs_dump_count, hisi_sas_debugfs_dump_count, uint, 0444); MODULE_PARM_DESC(hisi_sas_debugfs_dump_count, "Number of debugfs dumps to allow"); From patchwork Tue Jan 26 11:04:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 370620 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4909593jam; Tue, 26 Jan 2021 04:14:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwE/Ojx6RYMlg2mK985jz3DlNrITegXWLUvR0Qq58H15wyo+NyfYvhk9KCRH0rJtIj/+Q0t X-Received: by 2002:a05:6402:558:: with SMTP id i24mr4354603edx.141.1611663244585; Tue, 26 Jan 2021 04:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611663244; cv=none; d=google.com; s=arc-20160816; b=OVqjNV0aNe1dSEjSJWQ4+b3+khnnnsSHu0UjEjQ3K6Ayu2l+SDsnB6UvP0ZD22DOf+ uxLJCaLttFW0nogObxP9yduHe53ZH+HkcOpIysA9aiFImiEflHiHPUO9r/18lFrN5R1r Jvi9LXHimymu27l5+aXwkXXQ+GRoX9KICHSnwkoWF3m3FeSCtkpf1lA/PmMxLSLzhQdD qQGoX1Af70XbZFpQTrakIFupA2ogECnjNVR5MBNzWjqdcrIZcWh8h+/uIMcGjrySkSsS aEnjS5VwzodrN0MxCTt3rfFtQZIU3UbbYWBf3u/QYvdlPiQRHHE//yd2JCswd83rfS6q fcsQ== 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=LuhonrBX64qPUHH7K8KW51SOOZiSvI04poCNhMgQ+gw=; b=YJE1Vls+SW6L0NnD33laql4txpswXsE1UCC+oXkohOYQSGPoJMwuIhGPk5YXWvEgKC WmEqmmY3+S8PpSVQa3ihDlOvJA0I8QXwFXT2Gxxv33PzyN3d74Em3qfzEblZNqk4cZy9 r8az4rSnsCVZyuiga82tGuV18dtDLaXG2pKqxiQ0oO9nB6dmKKyDgGZIiH/rmJ0+/uid I2tiwUG3cqDRR+tx35niSlqZMkvBmbR8uLwQOZAC20GrclsY43e2QuKaJDM7zdfVBekX DjrH6hOW4qSKnZ845+pfJAd51ns70u9kcTLspFUbca3gpPKsb8wF+CkKWV0OytpdSmEm thsA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a73si8889453edf.23.2021.01.26.04.14.04 for ; Tue, 26 Jan 2021 04:14:04 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405444AbhAZMNx (ORCPT ); Tue, 26 Jan 2021 07:13:53 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:11883 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404902AbhAZLJS (ORCPT ); Tue, 26 Jan 2021 06:09:18 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DQ3pw3Ky8z7bL0; Tue, 26 Jan 2021 19:07:20 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Tue, 26 Jan 2021 19:08:25 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 4/5] scsi: hisi_sas: Flush workqueue in hisi_sas_v3_remove() Date: Tue, 26 Jan 2021 19:04:27 +0800 Message-ID: <1611659068-131975-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1611659068-131975-1-git-send-email-john.garry@huawei.com> References: <1611659068-131975-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing If the controller reset occurs at the same time as driver removal, it may be possible that the interrupts have been released prior to the host softreset, and calling pci_irq_vector() there causes a WARN: WARNING: CPU: 37 PID: 1542 /pci/msi.c:1275 pci_irq_vector+0xc0/0xd0 Call trace: pci_irq_vector+0xc0/0xd0 disable_host_v3_hw+0x58/0x5b0 [hisi_sas_v3_hw] soft_reset_v3_hw+0x40/0xc0 [hisi_sas_v3_hw] hisi_sas_controller_reset+0x150/0x260 [hisi_sas_main] hisi_sas_rst_work_handler+0x3c/0x58 [hisi_sas_main] To fix, flush the driver workqueue prior to releasing the interrupts to ensure any resets have been completed. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + 1 file changed, 1 insertion(+) -- 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 e91df469e36b..4cc344ca121c 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -4572,6 +4572,7 @@ static void hisi_sas_v3_remove(struct pci_dev *pdev) del_timer(&hisi_hba->timer); sas_unregister_ha(sha); + flush_workqueue(hisi_hba->wq); sas_remove_host(sha->core.shost); hisi_sas_v3_destroy_irqs(pdev, hisi_hba); From patchwork Tue Jan 26 11:04:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 370617 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4909522jam; Tue, 26 Jan 2021 04:13:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpMgGu01fTF1X3+RZLLTyT00CJqavFrM+hrhGAU9W3ZiF0K6MqxfjtHO6EU2WSbVtbeOOi X-Received: by 2002:a17:906:780c:: with SMTP id u12mr3199670ejm.125.1611663239261; Tue, 26 Jan 2021 04:13:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611663239; cv=none; d=google.com; s=arc-20160816; b=FYOz1HJoILiB3q8oDkiHZXeTskvIFvgTpSE8tAtGwBnB1ujUsPN1EEHro8ud4ccDAB On1b7jGhp1rsDU3ng8IwJYoOPhXc3b0OJQfYeBKdiQcaAxaIxfEZ2UWQBlSZH7AtFC6g dkrfativOXeEOnnOO4ERFNiisyJXDU6fyaMPfy+v2Yz3vl8To9Yj00zvJ2QvDr0UX7IV 9VehjHpTA35Y6ayvxJ5vetxXLSPBch+pWak3igwk4bCBEUYAaPv20oLpc8i4mrxx+aGn qsIM194JCNI2wvqTXg07GQRHn/CLx8cVkuv4P35Csf8aTZScjN7ee1y6xoJA178CoSCs 1N2w== 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=7/j5t4rItmVfPkh7dW/TAoLuEU5tMIrOBV+3vVF9gJA=; b=yENP7ry7PK9Ik+3kw/93iyyfnWnF31dEg0s0xYmPeuPqWw8EDDH10LqZ3VgO2gnNzP wnxotnAfgTnisbpSJbv1s5j1bL+/VE42eYS8bAwnfuXjD6RwtKzi7spnvRnArvFHrrCk I3ea4YyUhzXpmBY8d4saFGXJLARhRr/DMuznt5rijM+ynYABUKrkn6j0CVaegzim+MeD JCSYmONY6b34Ju7FPXZAU7ygIe6qrKHG7K6jKtMN7D544/6oKhQ4R5pjF6RIl4Re+GrW B4rHXCXdREVA7mBATquMk9wkKxmCePBTcZV6qfK6QLfTgaJbbHavcbZu37Hl6ekCbq4V kbKQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a73si8889453edf.23.2021.01.26.04.13.58 for ; Tue, 26 Jan 2021 04:13:59 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404786AbhAZMNM (ORCPT ); Tue, 26 Jan 2021 07:13:12 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11596 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404907AbhAZLJT (ORCPT ); Tue, 26 Jan 2021 06:09:19 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DQ3pw1b7Jz15y3D; Tue, 26 Jan 2021 19:07:20 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Tue, 26 Jan 2021 19:08:25 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 5/5] scsi: hisi_sas: Add trace FIFO debugfs support Date: Tue, 26 Jan 2021 19:04:28 +0800 Message-ID: <1611659068-131975-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1611659068-131975-1-git-send-email-john.garry@huawei.com> References: <1611659068-131975-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing The controller provides trace FIFO DFX tool to assist link fault debug and link optimization. This tool can be helpful when debug link faults without SAS analyzers. Each PHY has an independent trace FIFO interface. The user can configure trace FIFO tool of one PHY by using the following six interfaces: signal_sel: select signal group applies to different scenarios. 0x0: linkrate negotiation 0x1: Host 12G TX train 0x2: Disk 12G TX train 0x3: SAS PHY CTRL DFX 0 0x4: SAS PHY CTRL DFX 1 0x5: SAS PCS DFX other: linkrate negotiation dump_mask: The masked hardware status bit will not be updated. dump_mode: determines how to dump data after trigger signal is generated. 0x0: dump forever 0x1: dump 32 data after trigger signal is generated 0x2: no more dump after trigger signal is generated trigger_mode: determines the trigger mode, level or edge. 0x0: dump when trigger signal changed 0x1: dump when trigger signal's level equal to trigger_level 0x2: dump when trigger signal's level different from trigger_level trigger_level: determines the trigger level. trigger_msk: mask trigger signal The user can get 32 signal datas from hardware by reading the rd_data. These 32 signal datas is the status record of hardware at different time points. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 15 ++ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 251 +++++++++++++++++++++++++ 2 files changed, 266 insertions(+) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 873bfffa626d..2401a9575215 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -44,6 +44,7 @@ #define HISI_SAS_IOST_ITCT_CACHE_NUM 64 #define HISI_SAS_IOST_ITCT_CACHE_DW_SZ 10 +#define HISI_SAS_FIFO_DATA_DW_SIZE 32 #define HISI_SAS_STATUS_BUF_SZ (sizeof(struct hisi_sas_status_buffer)) #define HISI_SAS_COMMAND_TABLE_SZ (sizeof(union hisi_sas_command_table)) @@ -154,6 +155,16 @@ enum hisi_sas_phy_event { HISI_PHYES_NUM, }; +struct hisi_sas_debugfs_fifo { + u32 signal_sel; + u32 dump_msk; + u32 dump_mode; + u32 trigger; + u32 trigger_msk; + u32 trigger_mode; + u32 rd_data[HISI_SAS_FIFO_DATA_DW_SIZE]; +}; + struct hisi_sas_phy { struct work_struct works[HISI_PHYES_NUM]; struct hisi_hba *hisi_hba; @@ -175,6 +186,9 @@ struct hisi_sas_phy { enum sas_linkrate maximum_linkrate; int enable; atomic_t down_cnt; + + /* Trace FIFO */ + struct hisi_sas_debugfs_fifo fifo; }; struct hisi_sas_port { @@ -474,6 +488,7 @@ struct hisi_hba { struct dentry *debugfs_dir; struct dentry *debugfs_dump_dentry; struct dentry *debugfs_bist_dentry; + struct dentry *debugfs_fifo_dentry; }; /* Generic HW DMA host memory structures */ diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 4cc344ca121c..4580e081e489 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -303,6 +303,19 @@ #define ERR_CNT_INVLD_DW (PORT_BASE + 0x390) #define ERR_CNT_CODE_ERR (PORT_BASE + 0x394) #define ERR_CNT_DISP_ERR (PORT_BASE + 0x398) +#define DFX_FIFO_CTRL (PORT_BASE + 0x3a0) +#define DFX_FIFO_CTRL_TRIGGER_MODE_OFF 0 +#define DFX_FIFO_CTRL_TRIGGER_MODE_MSK (0x7 << DFX_FIFO_CTRL_TRIGGER_MODE_OFF) +#define DFX_FIFO_CTRL_DUMP_MODE_OFF 3 +#define DFX_FIFO_CTRL_DUMP_MODE_MSK (0x7 << DFX_FIFO_CTRL_DUMP_MODE_OFF) +#define DFX_FIFO_CTRL_SIGNAL_SEL_OFF 6 +#define DFX_FIFO_CTRL_SIGNAL_SEL_MSK (0xF << DFX_FIFO_CTRL_SIGNAL_SEL_OFF) +#define DFX_FIFO_CTRL_DUMP_DISABLE_OFF 10 +#define DFX_FIFO_CTRL_DUMP_DISABLE_MSK (0x1 << DFX_FIFO_CTRL_DUMP_DISABLE_OFF) +#define DFX_FIFO_TRIGGER (PORT_BASE + 0x3a4) +#define DFX_FIFO_TRIGGER_MSK (PORT_BASE + 0x3a8) +#define DFX_FIFO_DUMP_MSK (PORT_BASE + 0x3aC) +#define DFX_FIFO_RD_DATA (PORT_BASE + 0x3b0) #define DEFAULT_ITCT_HW 2048 /* reset value, not reprogrammed */ #if (HISI_SAS_MAX_DEVICES > DEFAULT_ITCT_HW) @@ -4153,6 +4166,243 @@ static const struct file_operations debugfs_phy_down_cnt_v3_hw_fops = { .owner = THIS_MODULE, }; +enum fifo_dump_mode_v3_hw { + FIFO_DUMP_FORVER = (1U << 0), + FIFO_DUMP_AFTER_TRIGGER = (1U << 1), + FIFO_DUMP_UNTILL_TRIGGER = (1U << 2), +}; + +enum fifo_trigger_mode_v3_hw { + FIFO_TRIGGER_EDGE = (1U << 0), + FIFO_TRIGGER_SAME_LEVEL = (1U << 1), + FIFO_TRIGGER_DIFF_LEVEL = (1U << 2), +}; + +static int debugfs_is_fifo_config_valid_v3_hw(struct hisi_sas_phy *phy) +{ + struct hisi_hba *hisi_hba = phy->hisi_hba; + + if (phy->fifo.signal_sel > 0xf) { + dev_info(hisi_hba->dev, "Invalid signal select: %u\n", + phy->fifo.signal_sel); + return -EINVAL; + } + + switch (phy->fifo.dump_mode) { + case FIFO_DUMP_FORVER: + case FIFO_DUMP_AFTER_TRIGGER: + case FIFO_DUMP_UNTILL_TRIGGER: + break; + default: + dev_info(hisi_hba->dev, "Invalid dump mode: %u\n", + phy->fifo.dump_mode); + return -EINVAL; + } + + /* when FIFO_DUMP_FORVER, no need to check trigger_mode */ + if (phy->fifo.dump_mode == FIFO_DUMP_FORVER) + return 0; + + switch (phy->fifo.trigger_mode) { + case FIFO_TRIGGER_EDGE: + case FIFO_TRIGGER_SAME_LEVEL: + case FIFO_TRIGGER_DIFF_LEVEL: + break; + default: + dev_info(hisi_hba->dev, "Invalid trigger mode: %u\n", + phy->fifo.trigger_mode); + return -EINVAL; + } + return 0; +} + +static int debugfs_update_fifo_config_v3_hw(struct hisi_sas_phy *phy) +{ + u32 trigger_mode = phy->fifo.trigger_mode; + u32 signal_sel = phy->fifo.signal_sel; + u32 dump_mode = phy->fifo.dump_mode; + struct hisi_hba *hisi_hba = phy->hisi_hba; + int phy_no = phy->sas_phy.id; + u32 reg_val; + int res; + + /* Check the validity of trace FIFO configuration */ + res = debugfs_is_fifo_config_valid_v3_hw(phy); + if (res) + return res; + + reg_val = hisi_sas_phy_read32(hisi_hba, phy_no, DFX_FIFO_CTRL); + /* Disable trace FIFO before update configuration */ + reg_val |= DFX_FIFO_CTRL_DUMP_DISABLE_MSK; + + /* Update trace FIFO configuration */ + reg_val &= ~(DFX_FIFO_CTRL_DUMP_MODE_MSK | + DFX_FIFO_CTRL_SIGNAL_SEL_MSK | + DFX_FIFO_CTRL_TRIGGER_MODE_MSK); + + reg_val |= ((trigger_mode << DFX_FIFO_CTRL_TRIGGER_MODE_OFF) | + (dump_mode << DFX_FIFO_CTRL_DUMP_MODE_OFF) | + (signal_sel << DFX_FIFO_CTRL_SIGNAL_SEL_OFF)); + hisi_sas_phy_write32(hisi_hba, phy_no, DFX_FIFO_CTRL, reg_val); + + hisi_sas_phy_write32(hisi_hba, phy_no, DFX_FIFO_DUMP_MSK, + phy->fifo.dump_msk); + + hisi_sas_phy_write32(hisi_hba, phy_no, DFX_FIFO_TRIGGER, + phy->fifo.trigger); + + hisi_sas_phy_write32(hisi_hba, phy_no, DFX_FIFO_TRIGGER_MSK, + phy->fifo.trigger_msk); + + /* Enable trace FIFO after updated configuration */ + reg_val = hisi_sas_phy_read32(hisi_hba, phy_no, DFX_FIFO_CTRL); + reg_val &= ~DFX_FIFO_CTRL_DUMP_DISABLE_MSK; + hisi_sas_phy_write32(hisi_hba, phy_no, DFX_FIFO_CTRL, reg_val); + + return 0; +} + +static ssize_t debugfs_fifo_update_cfg_v3_hw_write(struct file *filp, + const char __user *buf, + size_t count, loff_t *ppos) +{ + struct hisi_sas_phy *phy = filp->private_data; + bool update; + int val; + + val = kstrtobool_from_user(buf, count, &update); + if (val) + return val; + + if (update != 1) + return -EINVAL; + + val = debugfs_update_fifo_config_v3_hw(phy); + if (val) + return val; + + return count; +} + +static const struct file_operations debugfs_fifo_update_cfg_v3_hw_fops = { + .open = simple_open, + .write = debugfs_fifo_update_cfg_v3_hw_write, + .owner = THIS_MODULE, +}; + +static void debugfs_read_fifo_data_v3_hw(struct hisi_sas_phy *phy) +{ + struct hisi_hba *hisi_hba = phy->hisi_hba; + u32 *buf = phy->fifo.rd_data; + int phy_no = phy->sas_phy.id; + u32 val; + int i; + + memset(buf, 0, sizeof(phy->fifo.rd_data)); + + /* Disable trace FIFO before read data */ + val = hisi_sas_phy_read32(hisi_hba, phy_no, DFX_FIFO_CTRL); + val |= DFX_FIFO_CTRL_DUMP_DISABLE_MSK; + hisi_sas_phy_write32(hisi_hba, phy_no, DFX_FIFO_CTRL, val); + + for (i = 0; i < HISI_SAS_FIFO_DATA_DW_SIZE; i++) { + val = hisi_sas_phy_read32(hisi_hba, phy_no, + DFX_FIFO_RD_DATA); + buf[i] = val; + } + + /* Enable trace FIFO after read data */ + val = hisi_sas_phy_read32(hisi_hba, phy_no, DFX_FIFO_CTRL); + val &= ~DFX_FIFO_CTRL_DUMP_DISABLE_MSK; + hisi_sas_phy_write32(hisi_hba, phy_no, DFX_FIFO_CTRL, val); +} + +static int debugfs_fifo_data_v3_hw_show(struct seq_file *s, void *p) +{ + struct hisi_sas_phy *phy = s->private; + + debugfs_read_fifo_data_v3_hw(phy); + + debugfs_show_row_32_v3_hw(s, 0, HISI_SAS_FIFO_DATA_DW_SIZE * 4, + phy->fifo.rd_data); + + return 0; +} +DEFINE_SHOW_ATTRIBUTE(debugfs_fifo_data_v3_hw); + +static void debugfs_fifo_init_v3_hw(struct hisi_hba *hisi_hba) +{ + int phy_no; + + hisi_hba->debugfs_fifo_dentry = + debugfs_create_dir("fifo", hisi_hba->debugfs_dir); + + for (phy_no = 0; phy_no < hisi_hba->n_phy; phy_no++) { + struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no]; + struct dentry *port_dentry; + char name[256]; + u32 val; + + /* get default configuration for trace FIFO */ + val = hisi_sas_phy_read32(hisi_hba, phy_no, DFX_FIFO_CTRL); + val &= DFX_FIFO_CTRL_DUMP_MODE_MSK; + val >>= DFX_FIFO_CTRL_DUMP_MODE_OFF; + phy->fifo.dump_mode = val; + + val = hisi_sas_phy_read32(hisi_hba, phy_no, DFX_FIFO_CTRL); + val &= DFX_FIFO_CTRL_TRIGGER_MODE_MSK; + val >>= DFX_FIFO_CTRL_TRIGGER_MODE_OFF; + phy->fifo.trigger_mode = val; + + val = hisi_sas_phy_read32(hisi_hba, phy_no, DFX_FIFO_CTRL); + val &= DFX_FIFO_CTRL_SIGNAL_SEL_MSK; + val >>= DFX_FIFO_CTRL_SIGNAL_SEL_OFF; + phy->fifo.signal_sel = val; + + val = hisi_sas_phy_read32(hisi_hba, phy_no, DFX_FIFO_DUMP_MSK); + phy->fifo.dump_msk = val; + + val = hisi_sas_phy_read32(hisi_hba, phy_no, DFX_FIFO_TRIGGER); + phy->fifo.trigger = val; + val = hisi_sas_phy_read32(hisi_hba, phy_no, DFX_FIFO_TRIGGER_MSK); + phy->fifo.trigger_msk = val; + + snprintf(name, 256, "%d", phy_no); + port_dentry = debugfs_create_dir(name, + hisi_hba->debugfs_fifo_dentry); + + debugfs_create_file("update_config", 0200, port_dentry, phy, + &debugfs_fifo_update_cfg_v3_hw_fops); + + debugfs_create_file("signal_sel", 0600, port_dentry, + &phy->fifo.signal_sel, + &debugfs_v3_hw_fops); + + debugfs_create_file("dump_msk", 0600, port_dentry, + &phy->fifo.dump_msk, + &debugfs_v3_hw_fops); + + debugfs_create_file("dump_mode", 0600, port_dentry, + &phy->fifo.dump_mode, + &debugfs_v3_hw_fops); + + debugfs_create_file("trigger_mode", 0600, port_dentry, + &phy->fifo.trigger_mode, + &debugfs_v3_hw_fops); + + debugfs_create_file("trigger", 0600, port_dentry, + &phy->fifo.trigger, + &debugfs_v3_hw_fops); + + debugfs_create_file("trigger_msk", 0600, port_dentry, + &phy->fifo.trigger_msk, + &debugfs_v3_hw_fops); + + debugfs_create_file("fifo_data", 0400, port_dentry, phy, + &debugfs_fifo_data_v3_hw_fops); + } +} + static void debugfs_work_handler_v3_hw(struct work_struct *work) { struct hisi_hba *hisi_hba = @@ -4388,6 +4638,7 @@ static void debugfs_init_v3_hw(struct hisi_hba *hisi_hba) debugfs_create_dir("dump", hisi_hba->debugfs_dir); debugfs_phy_down_cnt_init_v3_hw(hisi_hba); + debugfs_fifo_init_v3_hw(hisi_hba); for (i = 0; i < hisi_sas_debugfs_dump_count; i++) { if (debugfs_alloc_v3_hw(hisi_hba, i)) {