Skip to content

Commit db63a4c

Browse files
Andy WhitcroftJeff Garzik
Andy Whitcroft
authored and
Jeff Garzik
committed
libata: add a host flag to ignore detected ATA devices
Where devices are visible via more than one host we sometimes wish to indicate that cirtain devices should be ignored on a specific host. Add a host flag indicating that this host wishes to ignore ATA specific devices. Signed-off-by: Andy Whitcroft <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
1 parent d48b97b commit db63a4c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

drivers/ata/libata-core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,6 +1973,12 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
19731973
if (class == ATA_DEV_ATA) {
19741974
if (!ata_id_is_ata(id) && !ata_id_is_cfa(id))
19751975
goto err_out;
1976+
if (ap->host->flags & ATA_HOST_IGNORE_ATA &&
1977+
ata_id_is_ata(id)) {
1978+
ata_dev_dbg(dev,
1979+
"host indicates ignore ATA devices, ignored\n");
1980+
return -ENOENT;
1981+
}
19761982
} else {
19771983
if (ata_id_is_ata(id))
19781984
goto err_out;

include/linux/libata.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ enum {
247247
ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */
248248
ATA_HOST_STARTED = (1 << 1), /* Host started */
249249
ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */
250+
ATA_HOST_IGNORE_ATA = (1 << 3), /* Ignore ATA devices on this host. */
250251

251252
/* bits 24:31 of host->flags are reserved for LLD specific flags */
252253

0 commit comments

Comments
 (0)