Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2566902ybk; Tue, 12 May 2020 02:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydgvn84Rr65Rfk63JsI3mopaxRf2fA8WIdam6/Ubs9SYOoXUtZLy3KdwI7Xd8/MCpsgv3Z X-Received: by 2002:a17:906:2dc8:: with SMTP id h8mr2787107eji.108.1589276245556; Tue, 12 May 2020 02:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589276245; cv=none; d=google.com; s=arc-20160816; b=xw1wM4/hO8gi0JdFAhThteY6yWSWRaNW0MF+S52QUXaP5VPwUzHLUjNNHLpJk7aqOz QxyjK9rtn9z5dprpKENWXq3nFB7VVKE7WVlEGswmx+Jh7n4Frmj9Ksw/lC24q60xv34D ZDq2xiJ2qWTXNSlC/m0/HZCZyF6VNFxNlLLdSseKAK03wyr17DARcPKdhq6/c9zCiu3p /JhnDTK4AJ2ohy49QvMHUh2d8eWXgTnsUrl7XgHan8EHgjSerID7hdQc7a1YOnecmreM +a7HeAwwmlhBg8zg7LzMJCv90OCGcFgwyHQJcBm/MpLQOXvlc/LbC+t1lIUPvGW1NMpG lz+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=vhdccmhT5H5+b5aMfEcay0guZ9iGkA2SraiQqVc+ISA=; b=vY8zmSiweg9tVPIbpk1RrdexYXiiYtw0QtnEGgEhpCPX/SqOxSkRFJ0oxsW3qJDwOq 6/RCMyH+4TL3ImHv3xRI+SYaeXuL41ctQxnT4TrdJV3EKuhcld9Hy0qEnaEObseSTXHv V1VCnFsKC1e5OQVEWksWoE3x6QYJJ6CVmlOWmMYXuHtL2TFwmj1YHJY4Kd/HK6uAkEHH JzPVrpnfpTwb1Sy0JLp6xLr0KKG8X+WeNCLZ+ytLyQmUTvtcfT5Atk1UlVdEi01LoKSC WRAGm3F5Bm/dbwatTwFsLR/gziyo4CiOsAKUyWXgwTDgYZskczBm7X4sUp+ycHeZgjvg laLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 o14si7974527edv.216.2020.05.12.02.37.02; Tue, 12 May 2020 02:37:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728416AbgELJfh (ORCPT + 99 others); Tue, 12 May 2020 05:35:37 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4778 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725889AbgELJfh (ORCPT ); Tue, 12 May 2020 05:35:37 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 5A47A4F51B544F654850; Tue, 12 May 2020 17:35:33 +0800 (CST) Received: from [127.0.0.1] (10.166.213.7) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Tue, 12 May 2020 17:35:24 +0800 Subject: Re: [PATCH] scsi: hisi_sas: display correct proc_name in sysfs To: John Garry , , , , CC: Xiang Chen References: <20200512063318.13825-1-yanaijie@huawei.com> <66c3318d-e8fa-9ff4-c7f4-ebe23925b807@huawei.com> From: Jason Yan Message-ID: Date: Tue, 12 May 2020 17:35:23 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <66c3318d-e8fa-9ff4-c7f4-ebe23925b807@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.166.213.7] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2020/5/12 16:23, John Garry 写道: > On 12/05/2020 07:33, Jason Yan wrote: >> The 'proc_name' entry in sysfs for hisi_sas is 'null' now becuase it is >> not initialized in scsi_host_template. It looks like: >> >> [root@localhost ~]# cat /sys/class/scsi_host/host2/proc_name >> (null) >> > > hmmm.. it would be good to tell us what this buys us, apart from the > proc_name file. > When there is more than one storage cards(or controllers) in the system, I'm tring to find out which host is belong to which card. And then I found this in scsi_host in sysfs but the output is '(null)' which is odd. > I mean, if we had the sht show_info method implemented, then it could be > useful (which is even marked as obsolete now). > I found this is interesting while in the sysfs filesystem we have a procfs stuff in it. I was planned to rename this entry to 'name' and use the struct member 'name' directly in struct scsi_host_template. But this may break userspace applications. > Thanks, > John > >> While the other driver's entry looks like: >> >> linux-vnMQMU:~ # cat /sys/class/scsi_host/host0/proc_name >> megaraid_sas >> >> Cc: John Garry >> Cc: Xiang Chen >> Signed-off-by: Jason Yan >> --- >>   drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 1 + >>   drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 1 + >>   drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + >>   3 files changed, 3 insertions(+) >> >> diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c >> b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c >> index fa25766502a2..c205bff20943 100644 >> --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c >> +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c >> @@ -1757,6 +1757,7 @@ static struct device_attribute >> *host_attrs_v1_hw[] = { >>   static struct scsi_host_template sht_v1_hw = { >>       .name            = DRV_NAME, >> +    .proc_name        = DRV_NAME, >>       .module            = THIS_MODULE, >>       .queuecommand        = sas_queuecommand, >>       .target_alloc        = sas_target_alloc, >> diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c >> b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c >> index e05faf315dcd..c725cffe141e 100644 >> --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c >> +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c >> @@ -3533,6 +3533,7 @@ static struct device_attribute >> *host_attrs_v2_hw[] = { >>   static struct scsi_host_template sht_v2_hw = { >>       .name            = DRV_NAME, >> +    .proc_name        = DRV_NAME, >>       .module            = THIS_MODULE, >>       .queuecommand        = sas_queuecommand, >>       .target_alloc        = sas_target_alloc, >> diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c >> b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c >> index 374885aa8d77..59b1421607dd 100644 >> --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c >> +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c >> @@ -3071,6 +3071,7 @@ static int debugfs_set_bist_v3_hw(struct >> hisi_hba *hisi_hba, bool enable) >>   static struct scsi_host_template sht_v3_hw = { >>       .name            = DRV_NAME, >> +    .proc_name        = DRV_NAME, >>       .module            = THIS_MODULE, >>       .queuecommand        = sas_queuecommand, >>       .target_alloc        = sas_target_alloc, >> > > > .