diff options
author | Manuel Lauss <manuel.lauss@gmail.com> | 2015-09-30 22:10:25 +0300 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-10-01 00:37:55 +0300 |
commit | 8a3e33cf92c7b7ae25c589eccd1a69ab11cc4353 (patch) | |
tree | 5dd0856ad1213f3100101f7be901f682ca3ebf98 /drivers/ata/libata-scsi.c | |
parent | a73f22f9811da0f69d5f04eadcfc87b4d6280814 (diff) | |
download | linux-8a3e33cf92c7b7ae25c589eccd1a69ab11cc4353.tar.xz |
ata: ahci: find eSATA ports and flag them as removable
If the AHCI ports' HPCP or ESP bits are set, the port
should be considered external (e.g. eSATA) and is marked
as removable. Userspace tools like udisks then treat it
like an usb drive.
With this patch applied, when I plug a drive into the esata port,
KDE pops up a window asking what to do with the drives(s), just
like it does for any random USB stick.
Removability is indicated to the upper layers by way of the
SCSI RMB bit, as I haven't found another way to signal
userspace to treat a sata disk like any usb stick.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 0d7f0da3a269..183a57bff935 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -2015,8 +2015,11 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) VPRINTK("ENTER\n"); - /* set scsi removable (RMB) bit per ata bit */ - if (ata_id_removable(args->id)) + /* set scsi removable (RMB) bit per ata bit, or if the + * AHCI port says it's external (Hotplug-capable, eSATA). + */ + if (ata_id_removable(args->id) || + (args->dev->link->ap->pflags & ATA_PFLAG_EXTERNAL)) hdr[1] |= (1 << 7); if (args->dev->class == ATA_DEV_ZAC) { |