From: Damien Le Moal <dlemoal@kernel.org>
To: chenxiang <chenxiang66@hisilicon.com>,
jejb@linux.vnet.ibm.com, martin.petersen@oracle.com
Cc: linuxarm@huawei.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/2] scsi: hisi_sas: Modify the deadline for ata_wait_after_reset()
Date: Mon, 1 Apr 2024 16:08:16 +0900 [thread overview]
Message-ID: <98d9748f-a723-4b35-9ff6-1e425fe5d5b2@kernel.org> (raw)
In-Reply-To: <20240401054914.721093-3-chenxiang66@hisilicon.com>
On 4/1/24 14:49, chenxiang wrote:
> From: Yihang Li <liyihang9@huawei.com>
>
> We found that the second parameter of function ata_wait_after_reset() is
> incorrectly used. We call smp_ata_check_ready_type() to poll the device
> type until the 30s timeout, so the correct deadline should be (jiffies +
> 30000).
>
> Fixes: 3c2673a09cf1 ("scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset")
> Signed-off-by: xiabing <xiabing12@h-partners.com>
> Signed-off-by: Yihang Li <liyihang9@huawei.com>
> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
> ---
> drivers/scsi/hisi_sas/hisi_sas_main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
> index 097dfe4b620d..7245600aedb2 100644
> --- a/drivers/scsi/hisi_sas/hisi_sas_main.c
> +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
> @@ -1796,8 +1796,10 @@ static int hisi_sas_debug_I_T_nexus_reset(struct domain_device *device)
>
> if (dev_is_sata(device)) {
> struct ata_link *link = &device->sata_dev.ap->link;
> + unsigned long deadline = ata_deadline(jiffies,
> + HISI_SAS_WAIT_PHYUP_TIMEOUT / HZ * 1000);
At the very least, you should use jiffies_to_msecs() here. But I do not see the
point though given that ata_deadline will do "jiffies + msecs_to_jiffies()".
So may be calling:
rc = ata_wait_after_reset(link, jiffies + HISI_SAS_WAIT_PHYUP_TIMEOUT,
smp_ata_check_ready_type);
May be simpler and more readable.
>
> - rc = ata_wait_after_reset(link, HISI_SAS_WAIT_PHYUP_TIMEOUT,
> + rc = ata_wait_after_reset(link, deadline,
> smp_ata_check_ready_type);
> } else {
> msleep(2000);
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2024-04-01 7:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 5:49 [PATCH 0/2] Some small fixes for hisi_sas chenxiang
2024-04-01 5:49 ` [PATCH 1/2] scsi: hisi_sas: Handle the NCQ error returned by D2H frame chenxiang
2024-04-01 7:10 ` Damien Le Moal
2024-04-02 1:10 ` chenxiang (M)
2024-04-01 5:49 ` [PATCH 2/2] scsi: hisi_sas: Modify the deadline for ata_wait_after_reset() chenxiang
2024-04-01 7:08 ` Damien Le Moal [this message]
2024-04-02 1:51 ` chenxiang (M)
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=98d9748f-a723-4b35-9ff6-1e425fe5d5b2@kernel.org \
--to=dlemoal@kernel.org \
--cc=chenxiang66@hisilicon.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxarm@huawei.com \
--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