]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
libata: add a host flag to ignore detected ATA devices
authorAndy Whitcroft <apw@canonical.com>
Fri, 4 May 2012 21:15:10 +0000 (22:15 +0100)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 7 May 2012 19:32:23 +0000 (15:32 -0400)
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>
drivers/ata/libata-core.c
include/linux/libata.h

index 23763a1ec570aa08149e23f65de1a7fb0087c860..d31ee557b395f59d072c828513ceb0a9c670b7fe 100644 (file)
@@ -1973,6 +1973,12 @@ retry:
        if (class == ATA_DEV_ATA) {
                if (!ata_id_is_ata(id) && !ata_id_is_cfa(id))
                        goto err_out;
+               if (ap->host->flags & ATA_HOST_IGNORE_ATA &&
+                                                       ata_id_is_ata(id)) {
+                       ata_dev_dbg(dev,
+                               "host indicates ignore ATA devices, ignored\n");
+                       return -ENOENT;
+               }
        } else {
                if (ata_id_is_ata(id))
                        goto err_out;
index e926df7b54c963745d043e1041d8876a5a7c65e6..6e887c742a278944dce4671bc0d1b8a9041bafed 100644 (file)
@@ -247,6 +247,7 @@ enum {
        ATA_HOST_SIMPLEX        = (1 << 0),     /* Host is simplex, one DMA channel per host only */
        ATA_HOST_STARTED        = (1 << 1),     /* Host started */
        ATA_HOST_PARALLEL_SCAN  = (1 << 2),     /* Ports on this host can be scanned in parallel */
+       ATA_HOST_IGNORE_ATA     = (1 << 3),     /* Ignore ATA devices on this host. */
 
        /* bits 24:31 of host->flags are reserved for LLD specific flags */