So a hot-plug capable port is an external port, just like commit 45b96d65ec68 ("ata: ahci: a hotplug capable port is an external port") claims. In order to not violate the SPC specification, modify the SCSI INQUIRY data to only set the RMB bit if the ATA device can have its media removed. This fixes a reported problem where GNOME/udisks was automounting devices connected to hot-plug capable ports. Fixes: 45b96d65ec68 ("ata: ahci: a hotplug capable port is an external port") Cc: stable@xxxxxxxxxxxxxxx Reviewed-by: Mario Limonciello <mario.limonciello@xxxxxxx> Reviewed-by: Thomas WeiÃ?schuh <linux@xxxxxxxxxxxxxx> Tested-by: Thomas WeiÃ?schuh <linux@xxxxxxxxxxxxxx> Reported-by: Thomas WeiÃ?schuh <linux@xxxxxxxxxxxxxx> Closes: https://lore.kernel.org/linux-ide/c0de8262-dc4b-4c22-9fac-33432e5bddd3@xxxxxxxx/ Signed-off-by: Damien Le Moal <dlemoal@xxxxxxxxxx> [cassel: wrote commit message] Signed-off-by: Niklas Cassel <cassel@xxxxxxxxxx> --- Changes since v1: -Added Cc: stable. -Updated comment and commit message to correctly state that the ATA removable media device bit is obsoleted since ATA-8 ACS. drivers/ata/libata-scsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index cdf29b178ddc..bb4d30d377ae 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1831,11 +1831,11 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) 2 }; - /* set scsi removable (RMB) bit per ata bit, or if the - * AHCI port says it's external (Hotplug-capable, eSATA). + /* + * Set the SCSI Removable Media Bit (RMB) if the ATA removable media + * device bit (obsolete since ATA-8 ACS) is set. */ - if (ata_id_removable(args->id) || - (args->dev->link->ap->pflags & ATA_PFLAG_EXTERNAL)) + if (ata_id_removable(args->id)) hdr[1] |= (1 << 7); if (args->dev->class == ATA_DEV_ZAC) { -- 2.45.2