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> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/ata/libata-scsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1828,11 +1828,11 @@ static unsigned int ata_scsiop_inq_std(s 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) { Patches currently in stable-queue which might be from dlemoal@xxxxxxxxxx are queue-6.9/ata-libata-scsi-set-the-rmb-bit-only-for-removable-media-devices.patch queue-6.9/scsi-core-disable-cdl-by-default.patch queue-6.9/scsi-mpi3mr-fix-ata-ncq-priority-support.patch