From: Jason Yan <yanaijie@huawei.com>
To: John Garry <john.garry@huawei.com>, <jejb@linux.ibm.com>,
<martin.petersen@oracle.com>, <linux-scsi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: Xiang Chen <chenxiang66@hisilicon.com>
Subject: Re: [PATCH] scsi: hisi_sas: display correct proc_name in sysfs
Date: Tue, 12 May 2020 17:35:23 +0800 [thread overview]
Message-ID: <dacd7cbe-3d84-2b35-e63a-af6179aa5221@huawei.com> (raw)
In-Reply-To: <66c3318d-e8fa-9ff4-c7f4-ebe23925b807@huawei.com>
在 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 <john.garry@huawei.com>
>> Cc: Xiang Chen <chenxiang66@hisilicon.com>
>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
>> ---
>> 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,
>>
>
>
> .
next prev parent reply other threads:[~2020-05-12 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 6:33 [PATCH] scsi: hisi_sas: display correct proc_name in sysfs Jason Yan
2020-05-12 8:23 ` John Garry
2020-05-12 9:35 ` Jason Yan [this message]
2020-05-12 10:00 ` John Garry
2020-05-12 10:30 ` Jason Yan
2020-05-12 11:07 ` John Garry
2020-05-12 11:29 ` Jason Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dacd7cbe-3d84-2b35-e63a-af6179aa5221@huawei.com \
--to=yanaijie@huawei.com \
--cc=chenxiang66@hisilicon.com \
--cc=jejb@linux.ibm.com \
--cc=john.garry@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox