From: Phillip Susi <phill@thesusis.net>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH v8 04/23] scsi: sd: Differentiate system and runtime start/stop management
Date: Tue, 07 Nov 2023 08:45:29 -0500 [thread overview]
Message-ID: <871qd1n0cm.fsf@vps.thesusis.net> (raw)
In-Reply-To: <9868ba0d-7d31-4671-84a3-33bca029f89d@kernel.org>
Damien Le Moal <dlemoal@kernel.org> writes:
> Revalidation is needed to make sure that the device settings did not change, or
> that the device itself did not change. This must be done before we start using
> the drive again on a system resume or on a port runtime resume.
>
> The current code always revalidates the devices attached to a port on system
> resume, unless the port was runtime suspended. If the port was runtime
> suspended, then revalidation will be done on runtime resume.
I don't see any checks for whether the port was previously runtime
suspended or not. It looks to me like it unconditionally revalidates
all devices on system resume, which is why I'm trying to patch it to
defer that until runtime resume.
> The main issue here which make things messy is the fact that the PM ops are
> defined for the port, not for the device. Separating things would be cleaner,
> but I think that is extremely hard to do considering the cases where we have
> multiple devices per port. For these cases, setting the link speed etc may
> depend on all the devices responding. So leaving some devices sleeping may be
> very dangerous to do.
Ahh, right.... you mean for PATA right? Does anyone still have any of
those these days? :)
> udisks2 issues passthrough commands, no ? We do not parse these currently, and
> we will *not* start doing that. For other operations like sync etc which end up
> as a FLUSH CACHE command, or any other command that require medium access,
> triggering EH when we prepare these commands in the submission path is not
> nice. Not even sure that can work. That may need some significant changes to work.
Isn't the NORMAL time eh is triggered is in response to normal IO being
submitted? Power management is kind of the auxiliary use of eh.
I had another patch in my old series that had libata fake several
commands rather than waking up the drive from SLEEP. That included
IDENTIFY, FLUSH CACHE, STANDBY1_NOW, and CHECK POWER CONDITION. Those were needed to
keep udisks or smartd from waking up the drive.
> Well, I do not see that happening. "cat
> /sys/class/ata_port/ataX/power/runtime_status" always says "unsupported" on my
> system. So not sure how you can get that... The only "link" between a scsi disk
> device and an ata_port device is created by libata with the RPM_ACTIVE flag
> which runs pm_runtime_get_sync() on the supplier, that is, the ata_port. So I
> do not see how runtime suspend could ever work for a port as-is.
I normally cd -P /sys/block/sda, which gets me into what appears to be
the scsi lun. Going up a few directories through the scsi target, scsi
host, and finally to the ataX, I find that node's power/control is
set to on, and if I change it to auto, then dmesg shows the port doing
runtime suspend and resume. I think there was another ata_port
subdirectory in there somewhere, maybe that's the one you're looking at?
I'm not sure what the difference is between ata8 and ata8/ata_port/ata8,
but I think the latter did not support runtime pm, so I'm guessing that
is the one you are looking at.
> The fact that you seem to be seeing a different behavior than me kind of
> indicates that something is still broken with the runtime port management. Not
> sure what exactly. Could you send me your kernel config please ? I would like
> to see if using that I get a different behavior. Also, what are your ata
> adapters (vendor/model) ?
I'll try to get you the config tonight. My internal drives are on an
Intel AHCI controller built into the southbridge of my chipset. My
external drives are on another cheap AHCI eSATA controller I got, since
the Intel doesn't support hotplug or PMP iirc.
next prev parent reply other threads:[~2023-11-07 13:47 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <c0b086ab-dcd5-4b7b-b931-4d407dd7ad47()kernel!org>
2023-10-12 19:01 ` [PATCH v8 04/23] scsi: sd: Differentiate system and runtime start/stop management Phillip Susi
2023-10-13 0:57 ` Damien Le Moal
2023-10-13 14:36 ` Phillip Susi
2023-10-15 22:09 ` Damien Le Moal
2023-10-21 17:56 ` Phillip Susi
2023-10-23 5:49 ` Damien Le Moal
2023-11-03 18:05 ` Phillip Susi
2023-11-03 23:01 ` Phillip Susi
2023-11-06 2:32 ` Damien Le Moal
2023-11-07 13:27 ` Phillip Susi
2023-11-07 21:59 ` Damien Le Moal
2023-11-08 22:07 ` Phillip Susi
2023-11-06 3:00 ` Damien Le Moal
2023-11-07 13:45 ` Phillip Susi [this message]
2023-11-07 21:48 ` Phillip Susi
2023-11-07 23:11 ` Damien Le Moal
2023-11-08 22:15 ` Phillip Susi
2023-11-09 22:09 ` Phillip Susi
2023-11-09 22:57 ` Damien Le Moal
2023-11-10 16:41 ` Phillip Susi
2023-11-10 0:43 ` Damien Le Moal
2023-11-07 22:13 ` Damien Le Moal
2023-11-08 22:25 ` Phillip Susi
2023-09-27 14:18 [PATCH v8 00/23] Fix libata suspend/resume handling and code cleanup Damien Le Moal
2023-09-27 14:18 ` [PATCH v8 04/23] scsi: sd: Differentiate system and runtime start/stop management Damien Le Moal
2023-09-27 19:50 ` Martin K. Petersen
2023-10-10 13:09 ` Phillip Susi
2023-10-10 14:04 ` Damien Le Moal
2023-10-15 16:14 ` Phillip Susi
2023-10-15 22:44 ` Damien Le Moal
2023-10-16 12:39 ` Phillip Susi
2023-10-16 12:55 ` Damien Le Moal
2023-10-17 18:03 ` Phillip Susi
2023-10-17 23:32 ` Damien Le Moal
2023-10-20 19:00 ` Phillip Susi
2023-10-18 6:16 ` Damien Le Moal
2023-10-20 21:23 ` Phillip Susi
2023-10-23 5:51 ` Damien Le Moal
2023-10-26 21:21 ` Phillip Susi
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=871qd1n0cm.fsf@vps.thesusis.net \
--to=phill@thesusis.net \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
/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