public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Phillip Susi <phill@thesusis.net>, linux-ide@vger.kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH 2/2] ata: libata-core: Improve ata_dev_power_set_active()
Date: Mon, 16 Oct 2023 07:12:27 +0900	[thread overview]
Message-ID: <d3497bc5-dded-4030-ab28-ff374164634c@kernel.org> (raw)
In-Reply-To: <87y1g6ftby.fsf@vps.thesusis.net>

On 10/14/23 00:14, Phillip Susi wrote:
> Damien Le Moal <dlemoal@kernel.org> writes:
>>  /**
>>   *	ata_dev_power_set_active -  Set a device power mode to active
>>   *	@dev: target device
>> @@ -2065,6 +2092,13 @@ void ata_dev_power_set_active(struct ata_device *dev)
>>  	if (!ata_dev_power_init_tf(dev, &tf, true))
>>  		return;
>>  
>> +	/*
>> +	 * Check the device power state & condition and force a spinup with
>> +	 * VERIFY command only if the drive is not already ACTIVE or IDLE.
>> +	 */
>> +	if (ata_dev_power_is_active(dev))
>> +		return;
>> +
>>  	ata_dev_notice(dev, "Entering active power mode\n");
>>  
>>  	err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
> 
> This bit didn't apply cleanly to what I just pulled from Linus.  It

The patches are for 6.7 so they are based on for-6.7 branch (for-next is the same).

> seems there are soem differences in how the tf is set up.  Why not move
> this check to before the tf is set up?  There isn't much point in
> setting it up if it isn't going to be used.

ata_dev_power_init_tf() also checks for the device type and horkage flags and
return false if the operation is not necessary or desired. I left these checks
in that function instead of moving them to different places. That is easier to
maintain this way. This is not the hot path, so I really prefer prioritizing
simplicity here.

-- 
Damien Le Moal
Western Digital Research


  parent reply	other threads:[~2023-10-15 22:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12  7:17 [PATCH 0/2] Improve drive spinup on resume Damien Le Moal
2023-10-12  7:17 ` [PATCH 1/2] ata: libata-eh: Spinup disk on resume after revalidation Damien Le Moal
2023-10-12 11:03   ` Niklas Cassel
2023-10-12  7:18 ` [PATCH 2/2] ata: libata-core: Improve ata_dev_power_set_active() Damien Le Moal
2023-10-12 11:07   ` Niklas Cassel
2023-10-13  8:51   ` Niklas Cassel
2023-10-13 15:14   ` Phillip Susi
2023-10-13 20:12     ` Niklas Cassel
2023-10-15 22:12     ` Damien Le Moal [this message]
2023-10-12 11:47 ` [PATCH 0/2] Improve drive spinup on resume Geert Uytterhoeven

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=d3497bc5-dded-4030-ab28-ff374164634c@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=phill@thesusis.net \
    /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