From: Niklas Cassel Date: Tue, 6 Feb 2024 21:13:43 +0000 (+0100) Subject: ata: ahci: a hotplug capable port is an external port X-Git-Tag: v6.9-rc1~151^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=45b96d65ec68;p=thirdparty%2Flinux.git ata: ahci: a hotplug capable port is an external port 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 Tested-by: Jian-Hong Pan Reviewed-by: Damien Le Moal Reviewed-by: Mario Limonciello Reviewed-by: Mika Westerberg Signed-off-by: Niklas Cassel --- diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index aa58ce615e794..4d3ec6d15ad1f 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -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; }