Skip to content

Add 'external' to the libata.force kernel parameter

Niklas Cassel linux-doc linux-ide 1 version Applied

Status from this message: Applied to libata/linux.git (for-6.15), thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/1ata: libata-core: Add 'external' to the libata.force kernel parameterDocumentation/admin-guide/kernel-parameters.txt drivers/ata/libata-core.c+40 -01 reply

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchDamien Le Moal
1/1R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/1] Add 'external' to the libata.force kernel parameter

Hello there,

This patch replaces an earlier patch proposal, which added an 'external_port_map' kernel module parameter to the ahci driver:
https://lore.kernel.org/linux-ide/[email protected]/

This patch instead adds support for 'external' to the existing libata.force kernel parameter.

Normally we do not enable LPM on ports that are marked as external by firmware. However, as always, firmware can have bugs and can have forgotten to mark a port as external.

One workaround for such buggy firmware would be to modify the 'mobile_lpm_policy' kernel module parameter, however, that will affect the LPM policy for all ports.

This patch allows a user to mark one or more ports as hotplug capable (in case firmware has failed to do so). This way, you will still get LPM (power saving) on the ports that are not marked as external.

One example where this can be used, is for buggy devices such as the "HL-DT-ST BD-RE BU40N" Blu-Ray player, which does not reply to a regular COMRESET (the controller sees nothing as connected), instead it will send a hotplug event when, and only when the user presses the tray open button.

Not replying to a COMRESET is not spec compliant. If a port does not detect any device on a port, and LPM is enabled on that port, and the port is not marked as hotplug capable, then there should be no way that a device can be hotplugged later, so libata powers off the port/PHY to save power.

Adding 'external' to libata.force gives users a way to handles such non spec compliant devices in a more fine grained way (rather than using the big 'mobile_lpm_policy' hammer).

There does also exist a per port link_power_management_policy sysfs attribute, however, for many people, using libata.force (which can be either on the kernel command line, or as a kernel module parameter) is more convenient compared to writing udev rules.

Kind regards,
Niklas

Niklas Cassel (1):
ata: libata-core: Add 'external' to the libata.force kernel parameter

 .../admin-guide/kernel-parameters.txt         |  2 +
 drivers/ata/libata-core.c                     | 38 +++++++++++++++++++
 2 files changed, 40 insertions(+)
Signature · 1 line
2.48.1