From patchwork Fri Jan 25 14:22:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 156593 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp417411jaa; Fri, 25 Jan 2019 06:22:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN7iZkLDLBNTPuRAJtfuY720mpfPYTzyvA1YrMiTITnNhRPCKWK6kTXwfO+HxLAMf2V3mWP9 X-Received: by 2002:a63:e74b:: with SMTP id j11mr10207931pgk.397.1548426130849; Fri, 25 Jan 2019 06:22:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548426130; cv=none; d=google.com; s=arc-20160816; b=01/TLRn3y57DoJmFpIZBerIaH02zeNCnE3EOIUE8BNaS6zGxuJi2ZVugniTC6zwT0J /A/t6Lmbnu+v3/Lb4YVPwoCwoC9YoJABmVqUf4Xqk7W1mMIFrFH8Vbix7Po1cHHm5+gm NraMgjSXJqllSkzT5Uu1wiYGY+9FRgad3QAbxqPSHDCAVsnj40nER+ZW5Zq0/cUVPqqv 54dslvrpyCQ715nAwpLPUzIA0SsUfrQ+otrPGW1BeNY4GAhVBz3pfMI7NQ5QPmsT78Oi hARLpQRxsWdWEzmOG6Hji/nL8dVkOhnWhK+34Edn5F76Qg0NrKG8MaAcADniYwYzUt42 fAiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=urU4vzrfMeJoeJ4Aqn3neWN1S8vs5tL2+E4q+JRqrog=; b=EpNUv+DdL16MLrK5imcBKOxC5DYNJ3CExP9jfGqTmgjLAL26gcF2FPIvyAjFSo0hJ6 h/p4MoynJSTgTRTrnDMYStx2abqZ0VfpNDPcwv1dCTPbshYHHUJFmsEs+Um6KNwGgQkU mgrnIKXELt6I2PSz4qeLq4cBvtde4SD0jLWK5Uqhhgz42s5p4H47+MHu+htZVtJLaakd lWAqO6t4w2QTo9A6YTfNKTvM5qCraRYRIOK/7NoEWojMS1gUeO6NSLBkhRj1TAalrIux nY6e2fK9X4aincJOEnIiAKL0CZHpVXS1INFe3icGYP4XieFMEEhvkFf8HkFbb4fJSGNk QPbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14si22659376pgi.158.2019.01.25.06.22.10; Fri, 25 Jan 2019 06:22:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728993AbfAYOWK (ORCPT + 1 other); Fri, 25 Jan 2019 09:22:10 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2765 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728892AbfAYOWJ (ORCPT ); Fri, 25 Jan 2019 09:22:09 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5B916DE4DE27FD796834; Fri, 25 Jan 2019 22:21:59 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.408.0; Fri, 25 Jan 2019 22:21:51 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , "John Garry" Subject: [PATCH 03/13] scsi: hisi_sas: Add debugfs ITCT file and add file operations Date: Fri, 25 Jan 2019 22:22:29 +0800 Message-ID: <1548426159-225679-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1548426159-225679-1-git-send-email-john.garry@huawei.com> References: <1548426159-225679-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing This patch create debugfs file for ITCT and add file operations. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 73a545a..c0aacb0 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2773,6 +2773,36 @@ static int hisi_sas_debugfs_iost_open(struct inode *inode, struct file *filp) .owner = THIS_MODULE, }; +static int hisi_sas_debugfs_itct_show(struct seq_file *s, void *p) +{ + int i, ret; + struct hisi_hba *hisi_hba = s->private; + struct hisi_sas_itct *debugfs_itct = hisi_hba->debugfs_itct; + __le64 *itct = &debugfs_itct->qw0; + + for (i = 0; i < HISI_SAS_MAX_ITCT_ENTRIES; i++, debugfs_itct++) { + ret = hisi_sas_show_row_64(s, i, sizeof(*debugfs_itct), + itct); + if (ret) + return ret; + } + + return 0; +} + +static int hisi_sas_debugfs_itct_open(struct inode *inode, struct file *filp) +{ + return single_open(filp, hisi_sas_debugfs_itct_show, inode->i_private); +} + +static const struct file_operations hisi_sas_debugfs_itct_fops = { + .open = hisi_sas_debugfs_itct_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .owner = THIS_MODULE, +}; + static void hisi_sas_debugfs_create_files(struct hisi_hba *hisi_hba) { struct dentry *dump_dentry; @@ -2819,6 +2849,9 @@ static void hisi_sas_debugfs_create_files(struct hisi_hba *hisi_hba) debugfs_create_file("iost", 0400, dump_dentry, hisi_hba, &hisi_sas_debugfs_iost_fops); + debugfs_create_file("itct", 0400, dump_dentry, hisi_hba, + &hisi_sas_debugfs_itct_fops); + return; }