Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: ahci: don't mark HotPlugCapable Ports as external/removable

The HPCP bit is set by bioses for on-board sata ports either because
they think sata is hotplug capable in general or to allow Windows
to display a "device eject" icon on ports which are routed to an
external connector bracket.

However in Redhat Bugzilla #1310682, users report that with kernel 4.4,
where this bit test first appeared, a lot of partitions on sata drives
are now mounted automatically.

This patch should fix redhat and a lot of other distros which
unconditionally automount all devices which have the "removable"
bit set.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 8a3e33cf92c7 ("ata: ahci: find eSATA ports and flag them as removable" changes userspace behavior)
Link: http://lkml.kernel.org/g/56CF35FA.1070500@redhat.com
Cc: stable@vger.kernel.org #v4.4+

authored by

Manuel Lauss and committed by
Tejun Heo
dc8b4afc d243bed3

+1 -2
+1 -2
drivers/ata/libahci.c
··· 1168 1168 1169 1169 /* mark esata ports */ 1170 1170 tmp = readl(port_mmio + PORT_CMD); 1171 - if ((tmp & PORT_CMD_HPCP) || 1172 - ((tmp & PORT_CMD_ESP) && (hpriv->cap & HOST_CAP_SXS))) 1171 + if ((tmp & PORT_CMD_ESP) && (hpriv->cap & HOST_CAP_SXS)) 1173 1172 ap->pflags |= ATA_PFLAG_EXTERNAL; 1174 1173 } 1175 1174