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

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 <apw@canonical.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by

Andy Whitcroft and committed by
Jeff Garzik
db63a4c8 d48b97b4

+7
+6
drivers/ata/libata-core.c
··· 1973 1973 if (class == ATA_DEV_ATA) { 1974 1974 if (!ata_id_is_ata(id) && !ata_id_is_cfa(id)) 1975 1975 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 + } 1976 1982 } else { 1977 1983 if (ata_id_is_ata(id)) 1978 1984 goto err_out;
+1
include/linux/libata.h
··· 247 247 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ 248 248 ATA_HOST_STARTED = (1 << 1), /* Host started */ 249 249 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. */ 250 251 251 252 /* bits 24:31 of host->flags are reserved for LLD specific flags */ 252 253