Linux ATA/IDE development
 help / color / mirror / Atom feed
From: yangxingui <yangxingui@huawei.com>
To: Niklas Cassel <cassel@kernel.org>
Cc: <dlemoal@kernel.org>, <linux-ide@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
	<liuyonglong@huawei.com>, <kangfenglong@huawei.com>
Subject: Re: [PATCH v1] ata: libata-eh: Add timeout table entry for STANDBY IMMEDIATE
Date: Mon, 17 Aug 2026 09:49:24 +0800	[thread overview]
Message-ID: <31bc1803-7242-c809-07e8-96b57b89576d@huawei.com> (raw)
In-Reply-To: <an72ZpuHX6JhukdS@ryzen>


Hi, Niklas.

On 2026/8/14 19:05, Niklas Cassel wrote:
> On Fri, Aug 14, 2026 at 11:58:46AM +0800, Xingui Yang wrote:
>> ATA_CMD_STANDBYNOW1 is not in the ata_eh_cmd_timeout_table and falls
>> back to the 5s default (ATA_EH_CMD_DFL_TIMEOUT), which is too short
>> for some drives to complete a STANDBY IMMEDIATE command issued from
>> ata_dev_power_set_standby() via ata_exec_internal():
>>
>>    ata1.00: qc timeout after 5000 msecs (cmd 0xe0)
>>    ata1.00: STANDBY IMMEDIATE failed (err_mask=0x4)
>>
>> Reuse the existing ata_eh_flush_timeouts for this command, as a drive
>> entering standby may need to flush its internal cache, making the flush
>> timeout a natural fit.
>>
>> Signed-off-by: Xingui Yang <yangxingui@huawei.com>
>> ---
>>   drivers/ata/libata-eh.c | 2 ++
>>   include/linux/libata.h  | 2 +-
>>   2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
>> index 05df7ea6954a..8f9e12f460c3 100644
>> --- a/drivers/ata/libata-eh.c
>> +++ b/drivers/ata/libata-eh.c
>> @@ -149,6 +149,8 @@ ata_eh_cmd_timeout_table[ATA_EH_CMD_TIMEOUT_TABLE_SIZE] = {
>>   	  .timeouts = ata_eh_flush_timeouts },
>>   	{ .commands = CMDS(ATA_CMD_VERIFY),
>>   	  .timeouts = ata_eh_reset_timeouts },
>> +	{ .commands = CMDS(ATA_CMD_STANDBYNOW1),
>> +	  .timeouts = ata_eh_flush_timeouts },
>>   };
>>   #undef CMDS
>>   
>> diff --git a/include/linux/libata.h b/include/linux/libata.h
>> index 96e626d6a7ca..6c0d385b2cde 100644
>> --- a/include/linux/libata.h
>> +++ b/include/linux/libata.h
>> @@ -425,7 +425,7 @@ enum {
>>   	/* This should match the actual table size of
>>   	 * ata_eh_cmd_timeout_table in libata-eh.c.
>>   	 */
>> -	ATA_EH_CMD_TIMEOUT_TABLE_SIZE = 8,
>> +	ATA_EH_CMD_TIMEOUT_TABLE_SIZE = 9,
>>   
>>   	/* User visible DMA mask for DMA control. DO NOT renumber. */
>>   	ATA_DMA_MASK_ATA	= (1 << 0),	/* DMA on ATA Disk */
>> -- 
>> 2.43.0
>>
> 
> This patch does not seem to be on top of latest Linus tree.
> 
> If you look at latest Linus tree, it already has:
> 1e024d2b41ee ("ata: libata-eh: Increase STANDBY IMMEDIATE timeout")
> 
> Which looks to solve the same problem as this patch.

Aha, thanks for the quick review!

I usually base my work on the "for-next" branches of 
"kernel/git/jejb/scsi.git" and kernel/git/mkp/scsi.git", and I 
mistakenly thought there were no new changes in latest Linus tree.

Thanks,
Xingui
.

      reply	other threads:[~2026-08-17  1:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14  3:58 [PATCH v1] ata: libata-eh: Add timeout table entry for STANDBY IMMEDIATE Xingui Yang
2026-08-14 11:05 ` Niklas Cassel
2026-08-17  1:49   ` yangxingui [this message]

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=31bc1803-7242-c809-07e8-96b57b89576d@huawei.com \
    --to=yangxingui@huawei.com \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=kangfenglong@huawei.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liuyonglong@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