Skip to content

Commit

Permalink
ata: ahci: a hotplug capable port is an external port
Browse files Browse the repository at this point in the history
A hotplug capable port is an external port, so mark it as such.

We even say this ourselves in libata-scsi.c:
/* set scsi removable (RMB) bit per ata bit, or if the
 * AHCI port says it's external (Hotplug-capable, eSATA).
 */

This also matches the terminology used in AHCI 1.3.1
(the keyword to search for is "externally accessible").

Tested-by: Damien Le Moal <dlemoal@kernel.org>
Tested-by: Jian-Hong Pan <jhp@endlessos.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
  • Loading branch information
Niklas Cassel committed Feb 9, 2024
1 parent f713193 commit 45b96d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,9 +1648,10 @@ static void ahci_mark_external_port(struct ata_port *ap)
void __iomem *port_mmio = ahci_port_base(ap);
u32 tmp;

/* mark esata ports */
/* mark external ports (hotplug-capable, eSATA) */
tmp = readl(port_mmio + PORT_CMD);
if ((tmp & PORT_CMD_ESP) && (hpriv->cap & HOST_CAP_SXS))
if (((tmp & PORT_CMD_ESP) && (hpriv->cap & HOST_CAP_SXS)) ||
(tmp & PORT_CMD_HPCP))
ap->pflags |= ATA_PFLAG_EXTERNAL;
}

Expand Down

0 comments on commit 45b96d6

Please sign in to comment.