~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/ata/libata-core.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
3619
3619
                scontrol |= (0x2 << 8);
3620
3620
                break;
3621
3621
        case ATA_LPM_MIN_POWER:
3622
 
                /* no restrictions on LPM transitions */
3623
 
                scontrol &= ~(0x3 << 8);
 
3622
                if (ata_link_nr_enabled(link) > 0)
 
3623
                        /* no restrictions on LPM transitions */
 
3624
                        scontrol &= ~(0x3 << 8);
 
3625
                else {
 
3626
                        /* empty port, power off */
 
3627
                        scontrol &= ~0xf;
 
3628
                        scontrol |= (0x1 << 2);
 
3629
                }
3624
3630
                break;
3625
3631
        default:
3626
3632
                WARN_ON(1);
4137
4143
         * Devices which choke on SETXFER.  Applies only if both the
4138
4144
         * device and controller are SATA.
4139
4145
         */
4140
 
        { "PIONEER DVD-RW  DVRTD08",    "1.00", ATA_HORKAGE_NOSETXFER },
4141
 
        { "PIONEER DVD-RW  DVR-212D",   "1.28", ATA_HORKAGE_NOSETXFER },
 
4146
        { "PIONEER DVD-RW  DVRTD08",    NULL,   ATA_HORKAGE_NOSETXFER },
 
4147
        { "PIONEER DVD-RW  DVR-212D",   NULL,   ATA_HORKAGE_NOSETXFER },
 
4148
        { "PIONEER DVD-RW  DVR-216D",   NULL,   ATA_HORKAGE_NOSETXFER },
4142
4149
 
4143
4150
        /* End Marker */
4144
4151
        { }
4210
4217
                return 0;  /* End of both strings: match */
4211
4218
        return 1;  /* No match */
4212
4219
}
4213
 
 
 
4220
 
4214
4221
static unsigned long ata_dev_blacklisted(const struct ata_device *dev)
4215
4222
{
4216
4223
        unsigned char model_num[ATA_ID_PROD_LEN + 1];
5340
5347
 *
5341
5348
 *      Resume @host.  Actual operation is performed by EH.  This
5342
5349
 *      function requests EH to perform PM operations and returns.
5343
 
 *      Note that all resume operations are performed parallely.
 
5350
 *      Note that all resume operations are performed parallelly.
5344
5351
 *
5345
5352
 *      LOCKING:
5346
5353
 *      Kernel thread context (may sleep).
5479
5486
        ap = kzalloc(sizeof(*ap), GFP_KERNEL);
5480
5487
        if (!ap)
5481
5488
                return NULL;
5482
 
        
5483
 
        ap->pflags |= ATA_PFLAG_INITIALIZING;
 
5489
 
 
5490
        ap->pflags |= ATA_PFLAG_INITIALIZING | ATA_PFLAG_FROZEN;
5484
5491
        ap->lock = &host->lock;
5485
5492
        ap->print_id = -1;
5486
5493
        ap->host = host;
5887
5894
        host->ops = ops;
5888
5895
}
5889
5896
 
5890
 
 
5891
 
static void async_port_probe(void *data, async_cookie_t cookie)
 
5897
int ata_port_probe(struct ata_port *ap)
5892
5898
{
5893
 
        int rc;
5894
 
        struct ata_port *ap = data;
5895
 
 
5896
 
        /*
5897
 
         * If we're not allowed to scan this host in parallel,
5898
 
         * we need to wait until all previous scans have completed
5899
 
         * before going further.
5900
 
         * Jeff Garzik says this is only within a controller, so we
5901
 
         * don't need to wait for port 0, only for later ports.
5902
 
         */
5903
 
        if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0)
5904
 
                async_synchronize_cookie(cookie);
 
5899
        int rc = 0;
5905
5900
 
5906
5901
        /* probe */
5907
5902
        if (ap->ops->error_handler) {
5927
5922
                DPRINTK("ata%u: bus probe begin\n", ap->print_id);
5928
5923
                rc = ata_bus_probe(ap);
5929
5924
                DPRINTK("ata%u: bus probe end\n", ap->print_id);
5930
 
 
5931
 
                if (rc) {
5932
 
                        /* FIXME: do something useful here?
5933
 
                         * Current libata behavior will
5934
 
                         * tear down everything when
5935
 
                         * the module is removed
5936
 
                         * or the h/w is unplugged.
5937
 
                         */
5938
 
                }
5939
5925
        }
 
5926
        return rc;
 
5927
}
 
5928
 
 
5929
 
 
5930
static void async_port_probe(void *data, async_cookie_t cookie)
 
5931
{
 
5932
        struct ata_port *ap = data;
 
5933
 
 
5934
        /*
 
5935
         * If we're not allowed to scan this host in parallel,
 
5936
         * we need to wait until all previous scans have completed
 
5937
         * before going further.
 
5938
         * Jeff Garzik says this is only within a controller, so we
 
5939
         * don't need to wait for port 0, only for later ports.
 
5940
         */
 
5941
        if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0)
 
5942
                async_synchronize_cookie(cookie);
 
5943
 
 
5944
        (void)ata_port_probe(ap);
5940
5945
 
5941
5946
        /* in order to keep device order, we need to synchronize at this point */
5942
5947
        async_synchronize_cookie(cookie);
5943
5948
 
5944
5949
        ata_scsi_scan_host(ap, 1);
 
5950
}
5945
5951
 
5946
 
}
5947
5952
/**
5948
5953
 *      ata_host_register - register initialized ATA host
5949
5954
 *      @host: ATA host to register
5983
5988
        for (i = 0; i < host->n_ports; i++)
5984
5989
                host->ports[i]->print_id = ata_print_id++;
5985
5990
 
5986
 
        
 
5991
 
5987
5992
        /* Create associated sysfs transport objects  */
5988
5993
        for (i = 0; i < host->n_ports; i++) {
5989
5994
                rc = ata_tport_add(host->dev,host->ports[i]);
6471
6476
                ata_sff_exit();
6472
6477
                rc = -ENOMEM;
6473
6478
                goto err_out;
6474
 
        }               
 
6479
        }
6475
6480
 
6476
6481
        printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n");
6477
6482
        return 0;