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");