Linux-ide Archive mirror
 help / color / mirror / Atom feed
From: Phillip Susi <phill@thesusis.net>
To: Damien Le Moal <dlemoal@kernel.org>, linux-ide@vger.kernel.org
Cc: Sergey Shtylyov <s.shtylyov@omp.ru>
Subject: Re: [PATCH 1/3] libata: avoid waking disk for several commands
Date: Mon, 05 Feb 2024 14:52:01 -0500	[thread overview]
Message-ID: <87ttmmit9a.fsf@vps.thesusis.net> (raw)
In-Reply-To: <c12cc683-1fbd-4f9b-92f4-dba01ae235bf@kernel.org>

Damien Le Moal <dlemoal@kernel.org> writes:

> See ata_dev_revalidate() and ata_dev_configure() and all the drive features that
> are checked using the identify data. We need to preserve that to ensure that
> nothing changed on the drive so that its representation in libata is kept in
> sync with the drive config. That is why drive starting with PUIS and not giving
> full identify data *must* be woken up, which is the current libata behavior.

Yes, the information is needed to revalidate, but why must this
revalidation be done during system resume, rather than postponed until later?

> You do not need to change the hierarchy of devices. An ata_dev is already a
> child of its scsi_dev. So if you want to set the ata device to runtime
> suspend

How is an ata_dev a child of its own scsi_dev?  Or did you mean to say
the reverse: the scsi_dev is a child of the ata_dev?  But that isn't the
case either.  In sysfs, you have:

ata_port
 - scsi_host
   - scsi_target
     - scsi_lun
 - ata_link
   - ata_dev

The link and dev hang off to the side, not in the ancestry of the scsi
disk.

> state, you have to have the parent in the same state too. runtime suspend work
> top-to-bottom in the device chain. You cannot have random device in the middle
> of the chain going to suspend without the devices above it also being suspended.
>
> Also, the user does not use ata devices directly. They use the scsi device
> representing the ata device. You must thus have that in sync with the ata device
> state.

Right... so when the system is resumed, first the ata_port is resumed,
then it has to be on for the scsi host, target, and lun to resume.  At
that point sd could check if the disk is actually spinning, and if not,
force it to suspend, which then allows the target to suspend, wich then
allows the host to suspend, and finally the ata_port.

  reply	other threads:[~2024-02-05 19:52 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-25 15:19 [PATCH 0/1] Only activate drive once during system resume Phillip Susi
2023-12-25 15:19 ` [PATCH 1/1] libata: only wake a drive once on " Phillip Susi
2023-12-30 18:21 ` [PATCH 0/1 v2] Only activate drive once during " Phillip Susi
2023-12-30 18:21   ` [PATCH 1/1] libata: only wake a drive once on " Phillip Susi
2023-12-30 19:42     ` Sergey Shtylyov
2024-01-02 23:17     ` Damien Le Moal
2024-01-03 21:00       ` Phillip Susi
2024-01-04  1:21         ` Damien Le Moal
2024-01-04 14:05           ` Phillip Susi
2024-01-04 22:39             ` [PATCH 1/4] " Phillip Susi
2024-01-04 22:39               ` [PATCH 2/4] libata: don't wake sleeping disk during system suspend Phillip Susi
2024-01-05 12:25                 ` Damien Le Moal
2024-01-05 16:18                   ` Phillip Susi
2024-01-04 22:39               ` [PATCH 3/4] libata: avoid waking disk for several commands Phillip Susi
2024-01-05  8:46                 ` Sergei Shtylyov
2024-01-05 16:24                   ` Phillip Susi
2024-01-05 18:33                     ` Sergei Shtylyov
2024-01-06 19:49                       ` Phillip Susi
2024-01-06 20:29                   ` Phillip Susi
2024-01-08  8:57                     ` Sergei Shtylyov
2024-01-05 12:29                 ` Damien Le Moal
2024-01-05 16:30                   ` Phillip Susi
2024-01-06 23:14                     ` Damien Le Moal
2024-01-07 17:57                       ` Phillip Susi
2024-01-07 18:02                         ` [PATCH 0/3] Let sleeping disks lie Phillip Susi
2024-01-07 18:02                           ` [PATCH 1/3] libata: avoid waking disk for several commands Phillip Susi
2024-01-08  6:25                             ` Damien Le Moal
2024-01-08 13:27                               ` Phillip Susi
2024-01-10  2:39                                 ` Damien Le Moal
2024-01-16 17:06                                   ` Phillip Susi
2024-01-19 20:43                                     ` Phillip Susi
2024-01-20 18:08                                       ` Phillip Susi
2024-01-21  0:37                                         ` Damien Le Moal
2024-01-21  0:37                                       ` Damien Le Moal
2024-01-24 16:04                                         ` Phillip Susi
2024-01-24 21:51                                           ` Damien Le Moal
2024-02-01 20:01                                             ` Phillip Susi
2024-02-02  1:08                                               ` Damien Le Moal
2024-02-02 19:53                                                 ` Phillip Susi
2024-02-02 23:17                                                   ` Damien Le Moal
2024-02-05 19:52                                                     ` Phillip Susi [this message]
2024-01-08  8:48                             ` Sergey Shtylyov
2024-01-08 13:30                               ` Phillip Susi
2024-01-07 18:02                           ` [PATCH 2/3] libata: only wake a drive once on system resume Phillip Susi
2024-01-08  6:04                             ` Damien Le Moal
2024-01-07 18:02                           ` [PATCH 3/3] libata: don't start PuiS disks on resume Phillip Susi
2024-01-08  6:03                             ` Damien Le Moal
2024-01-08 13:39                               ` Phillip Susi
2024-01-10  2:19                                 ` Damien Le Moal
2024-01-16 17:13                                   ` Phillip Susi
2024-01-04 22:39               ` [PATCH 4/4] " Phillip Susi
2024-01-05  8:57                 ` Sergei Shtylyov
2024-01-05 12:42                 ` Damien Le Moal
2024-01-05 16:44                   ` Phillip Susi
2024-01-05 12:13               ` [PATCH 1/4] libata: only wake a drive once on system resume Damien Le Moal
2024-01-05 17:03                 ` Phillip Susi
2024-01-06 23:06                   ` Damien Le Moal
2024-01-05 12:44               ` Damien Le Moal
2024-01-09 15:20   ` [PATCH 0/1 v2] Only activate drive once during " Niklas Cassel
2024-01-16 17:23     ` Phillip Susi
2024-01-02 22:46 ` [PATCH 0/1] " Damien Le Moal

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=87ttmmit9a.fsf@vps.thesusis.net \
    --to=phill@thesusis.net \
    --cc=dlemoal@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=s.shtylyov@omp.ru \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).