From: Jason Yan <yanaijie@huawei.com>
To: John Garry <john.garry@huawei.com>,
martin.petersen@oracle.com, jejb@linux.vnet.ibm.com
Cc: linux-scsi@vger.kernel.org, zhaohongjiang@huawei.com,
miaoxie@huawei.com, hch@lst.de, hare@suse.com,
chenqilin <chenqilin2@huawei.com>,
chenxiang <chenxiang66@hisilicon.com>,
Linuxarm <linuxarm@huawei.com>
Subject: Re: [PATCH 2/3] scsi: libsas: fix error when getting phy events
Date: Wed, 3 Jan 2018 10:38:43 +0800 [thread overview]
Message-ID: <5A4C4233.8080306@huawei.com> (raw)
In-Reply-To: <e88b6f32-4830-2cd9-9239-937a136a0254@huawei.com>
On 2018/1/2 21:50, John Garry wrote:
> On 02/01/2018 12:15, Jason Yan wrote:
>> The intend purpose here was to goto out if smp_execute_task() returned
>> error. Obviously something got screwed up. We will never get these link
>> error statistics below:
>>
>> ~:/sys/class/sas_phy/phy-1:0:12 # cat invalid_dword_count
>> 0
>> ~:/sys/class/sas_phy/phy-1:0:12 # cat running_disparity_error_count
>> 0
>> ~:/sys/class/sas_phy/phy-1:0:12 # cat loss_of_dword_sync_count
>> 0
>> ~:/sys/class/sas_phy/phy-1:0:12 # cat phy_reset_problem_count
>> 0
>>
>> Obviously we should goto error handler if smp_execute_task() returns
>> non-zero.
>>
>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
>> CC: John Garry <john.garry@huawei.com>
>> CC: chenqilin <chenqilin2@huawei.com>
>> CC: chenxiang <chenxiang66@hisilicon.com>
>> ---
>> drivers/scsi/libsas/sas_expander.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/libsas/sas_expander.c
>> b/drivers/scsi/libsas/sas_expander.c
>> index 4b0c67f..6eab487 100644
>> --- a/drivers/scsi/libsas/sas_expander.c
>> +++ b/drivers/scsi/libsas/sas_expander.c
>> @@ -686,7 +686,7 @@ int sas_smp_get_phy_events(struct sas_phy *phy)
>> res = smp_execute_task(dev, req, RPEL_REQ_SIZE,
>> resp, RPEL_RESP_SIZE);
>>
>> - if (!res)
>> + if (res)
>> goto out;
>
> This seems to have been broken for some time.
>
> Could you inject some errors on the link to verify that this function
> actually works properly with this change, i.e. non-zero reading?
>
> Thanks,
> John
>
Yes, I have tested it. Before we fix, they are all zero. After we fix
it and do some test:
localhost:/sys/class/sas_phy/phy-1:0:1 #
localhost:/sys/class/sas_phy/phy-1:0:1 # cat invalid_dword_count
22
localhost:/sys/class/sas_phy/phy-1:0:1 # cat phy_reset_problem_count
1
localhost:/sys/class/sas_phy/phy-1:0:1 # cat running_disparity_error_count
23
localhost:/sys/class/sas_phy/phy-1:0:1 # cat loss_of_dword_sync_count
1
localhost:/sys/class/sas_phy/phy-1:0:1 #
>>
>> phy->invalid_dword_count = scsi_to_u32(&resp[12]);
>>
>
>
>
> .
>
next prev parent reply other threads:[~2018-01-03 2:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-02 12:15 [PATCH 0/3] Three small fixes for libsas Jason Yan
2018-01-02 12:15 ` [PATCH 1/3] scsi: libsas: fix memory leak in sas_smp_get_phy_events() Jason Yan
2018-01-02 12:15 ` [PATCH 2/3] scsi: libsas: fix error when getting phy events Jason Yan
2018-01-02 13:50 ` John Garry
2018-01-03 2:38 ` Jason Yan [this message]
2018-01-02 12:15 ` [PATCH 3/3] scsi: libsas: initialize sas_phy status according to response of DISCOVER 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=5A4C4233.8080306@huawei.com \
--to=yanaijie@huawei.com \
--cc=chenqilin2@huawei.com \
--cc=chenxiang66@hisilicon.com \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=jejb@linux.vnet.ibm.com \
--cc=john.garry@huawei.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=martin.petersen@oracle.com \
--cc=miaoxie@huawei.com \
--cc=zhaohongjiang@huawei.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;
as well as URLs for NNTP newsgroup(s).