Linux-ide Archive mirror
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>, Niklas Cassel <cassel@kernel.org>
Cc: Werner Fischer <devlists@wefi.net>,
	Daniel Drake <drake@endlessos.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Jian-Hong Pan <jhp@endlessos.org>,
	Dieter Mummenschanz <dmummenschanz@web.de>,
	linux-ide@vger.kernel.org
Subject: [PATCH 0/5] drop low power policy board type
Date: Thu,  1 Feb 2024 17:14:57 +0100	[thread overview]
Message-ID: <20240201161507.1147521-1-cassel@kernel.org> (raw)

The series is based on top of:
https://git.kernel.org/pub/scm/linux/kernel/git/libata/linux.git/log/?h=for-next


Hello all,

This revives a patch sent out almost two years ago from Mario Limonciello:
https://lore.kernel.org/linux-ide/20220524170508.563-1-mario.limonciello@amd.com/T/#u

The reason why we did not merge it back then, is because LPM and hotplug
events are mutually exclusive.

The difference with this series compared to what was sent out back then:
I've added a patch that checks if the port is external, i.e. either
hotplug capable or eSATA. For external ports, we never enable LPM, as
that will break hotplug.

For ports that do not advertise themselves as external (typically laptops),
we set the LPM policy as requested.

This matches how Microsoft Windows does things.
Thanks to Werner Fischer for suggesting something like this at last year's
ALPSS conference.

There might of course be some platform firmware that e.g. incorrectly marks
its port as internal, even though it is external, but if we find any such
platforms we will need to deal with them using quirks.


Also note that we even if the user requested a certain policy, there is
no guarantee that he will get all the features for that policy, see:
https://github.com/torvalds/linux/blob/master/drivers/ata/libata-sata.c#L403-L414

However, I'd rather we not try to map all the combinations of
partial/slumber/devsleep in to a single policy represented by a single
integer, thus I do not try to "change" the requested policy.
The user will get all the features that are included in the requested
policy AND supported by the HBA.

Another difference (compared to an earlier version of Mario's series)
is that we do not try to change the default CONFIG_SATA_MOBILE_LPM_POLICY
value from 0 to 3, it will continue to be 0.
If you really don't want LPM even if your HBA supports it, and your port
is internal, one option is to leave the Kconfig set to the default value.

Note: in current mainline, there is an issue related to Intel VMD
which causes the link to not come up when VMD is enabled.
(The link does comes up when VMD is disabled in BIOS.)
In order to not get a bunch of bug reports related to LPM, we probably
want to wait with this series until we have fixed the VMD bug.


Kind regards,
Niklas


Mario Limonciello (1):
  ata: ahci: Drop low power policy board type

Niklas Cassel (4):
  ata: ahci: move marking of external port earlier
  ata: ahci: a hotplug capable port is an external port
  ata: ahci: drop hpriv param from ahci_update_initial_lpm_policy()
  ata: ahci: do not enable LPM on external ports

 drivers/ata/Kconfig   |   5 +-
 drivers/ata/ahci.c    | 134 +++++++++++++++++++++++-------------------
 drivers/ata/ahci.h    |   9 +--
 drivers/ata/libahci.c |   7 ---
 4 files changed, 77 insertions(+), 78 deletions(-)

-- 
2.43.0


             reply	other threads:[~2024-02-01 16:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 16:14 Niklas Cassel [this message]
2024-02-01 16:14 ` [PATCH 1/5] ata: ahci: move marking of external port earlier Niklas Cassel
2024-02-02  1:52   ` Damien Le Moal
2024-02-01 16:14 ` [PATCH 2/5] ata: ahci: a hotplug capable port is an external port Niklas Cassel
2024-02-02  1:54   ` Damien Le Moal
2024-02-01 16:15 ` [PATCH 3/5] ata: ahci: drop hpriv param from ahci_update_initial_lpm_policy() Niklas Cassel
2024-02-02  1:57   ` Damien Le Moal
2024-02-01 16:15 ` [PATCH 4/5] ata: ahci: do not enable LPM on external ports Niklas Cassel
2024-02-02  2:09   ` Damien Le Moal
2024-02-01 16:15 ` [PATCH 5/5] ata: ahci: Drop low power policy board type Niklas Cassel
2024-02-02  2:12   ` Damien Le Moal
2024-02-02  2:13 ` [PATCH 0/5] drop " Damien Le Moal
2024-02-02 13:13 ` Werner Fischer
2024-02-02 15:12   ` Mario Limonciello

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=20240201161507.1147521-1-cassel@kernel.org \
    --to=cassel@kernel.org \
    --cc=devlists@wefi.net \
    --cc=dlemoal@kernel.org \
    --cc=dmummenschanz@web.de \
    --cc=drake@endlessos.org \
    --cc=jhp@endlessos.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).