diff options
author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2009-01-14 00:29:08 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2009-01-14 00:29:08 -0500 |
commit | c088f4e9da74b901f7ed1749ad697d77622ed0f9 (patch) | |
tree | 84cddf20369f82f10c1c3712e6cce20dd1b9d863 /drivers/ata/libata-core.c | |
parent | ce79735c12d62c3cda38eb31762cf98e87c7b087 (diff) | |
parent | a6525042bfdfcab128bd91fad264de10fd24a55e (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index f178a450ec08..71218d76d75e 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1007,6 +1007,7 @@ static const char *sata_spd_string(unsigned int spd) | |||
1007 | static const char * const spd_str[] = { | 1007 | static const char * const spd_str[] = { |
1008 | "1.5 Gbps", | 1008 | "1.5 Gbps", |
1009 | "3.0 Gbps", | 1009 | "3.0 Gbps", |
1010 | "6.0 Gbps", | ||
1010 | }; | 1011 | }; |
1011 | 1012 | ||
1012 | if (spd == 0 || (spd - 1) >= ARRAY_SIZE(spd_str)) | 1013 | if (spd == 0 || (spd - 1) >= ARRAY_SIZE(spd_str)) |
@@ -2000,6 +2001,10 @@ unsigned int ata_pio_need_iordy(const struct ata_device *adev) | |||
2000 | as the caller should know this */ | 2001 | as the caller should know this */ |
2001 | if (adev->link->ap->flags & ATA_FLAG_NO_IORDY) | 2002 | if (adev->link->ap->flags & ATA_FLAG_NO_IORDY) |
2002 | return 0; | 2003 | return 0; |
2004 | /* CF spec. r4.1 Table 22 says no iordy on PIO5 and PIO6. */ | ||
2005 | if (ata_id_is_cfa(adev->id) | ||
2006 | && (adev->pio_mode == XFER_PIO_5 || adev->pio_mode == XFER_PIO_6)) | ||
2007 | return 0; | ||
2003 | /* PIO3 and higher it is mandatory */ | 2008 | /* PIO3 and higher it is mandatory */ |
2004 | if (adev->pio_mode > XFER_PIO_2) | 2009 | if (adev->pio_mode > XFER_PIO_2) |
2005 | return 1; | 2010 | return 1; |
@@ -4551,7 +4556,7 @@ void ata_sg_clean(struct ata_queued_cmd *qc) | |||
4551 | struct scatterlist *sg = qc->sg; | 4556 | struct scatterlist *sg = qc->sg; |
4552 | int dir = qc->dma_dir; | 4557 | int dir = qc->dma_dir; |
4553 | 4558 | ||
4554 | WARN_ON(sg == NULL); | 4559 | WARN_ON_ONCE(sg == NULL); |
4555 | 4560 | ||
4556 | VPRINTK("unmapping %u sg elements\n", qc->n_elem); | 4561 | VPRINTK("unmapping %u sg elements\n", qc->n_elem); |
4557 | 4562 | ||
@@ -4771,7 +4776,7 @@ void ata_qc_free(struct ata_queued_cmd *qc) | |||
4771 | struct ata_port *ap = qc->ap; | 4776 | struct ata_port *ap = qc->ap; |
4772 | unsigned int tag; | 4777 | unsigned int tag; |
4773 | 4778 | ||
4774 | WARN_ON(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ | 4779 | WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ |
4775 | 4780 | ||
4776 | qc->flags = 0; | 4781 | qc->flags = 0; |
4777 | tag = qc->tag; | 4782 | tag = qc->tag; |
@@ -4786,8 +4791,8 @@ void __ata_qc_complete(struct ata_queued_cmd *qc) | |||
4786 | struct ata_port *ap = qc->ap; | 4791 | struct ata_port *ap = qc->ap; |
4787 | struct ata_link *link = qc->dev->link; | 4792 | struct ata_link *link = qc->dev->link; |
4788 | 4793 | ||
4789 | WARN_ON(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ | 4794 | WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ |
4790 | WARN_ON(!(qc->flags & ATA_QCFLAG_ACTIVE)); | 4795 | WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE)); |
4791 | 4796 | ||
4792 | if (likely(qc->flags & ATA_QCFLAG_DMAMAP)) | 4797 | if (likely(qc->flags & ATA_QCFLAG_DMAMAP)) |
4793 | ata_sg_clean(qc); | 4798 | ata_sg_clean(qc); |
@@ -4873,7 +4878,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc) | |||
4873 | struct ata_device *dev = qc->dev; | 4878 | struct ata_device *dev = qc->dev; |
4874 | struct ata_eh_info *ehi = &dev->link->eh_info; | 4879 | struct ata_eh_info *ehi = &dev->link->eh_info; |
4875 | 4880 | ||
4876 | WARN_ON(ap->pflags & ATA_PFLAG_FROZEN); | 4881 | WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN); |
4877 | 4882 | ||
4878 | if (unlikely(qc->err_mask)) | 4883 | if (unlikely(qc->err_mask)) |
4879 | qc->flags |= ATA_QCFLAG_FAILED; | 4884 | qc->flags |= ATA_QCFLAG_FAILED; |
@@ -4995,16 +5000,16 @@ void ata_qc_issue(struct ata_queued_cmd *qc) | |||
4995 | * check is skipped for old EH because it reuses active qc to | 5000 | * check is skipped for old EH because it reuses active qc to |
4996 | * request ATAPI sense. | 5001 | * request ATAPI sense. |
4997 | */ | 5002 | */ |
4998 | WARN_ON(ap->ops->error_handler && ata_tag_valid(link->active_tag)); | 5003 | WARN_ON_ONCE(ap->ops->error_handler && ata_tag_valid(link->active_tag)); |
4999 | 5004 | ||
5000 | if (ata_is_ncq(prot)) { | 5005 | if (ata_is_ncq(prot)) { |
5001 | WARN_ON(link->sactive & (1 << qc->tag)); | 5006 | WARN_ON_ONCE(link->sactive & (1 << qc->tag)); |
5002 | 5007 | ||
5003 | if (!link->sactive) | 5008 | if (!link->sactive) |
5004 | ap->nr_active_links++; | 5009 | ap->nr_active_links++; |
5005 | link->sactive |= 1 << qc->tag; | 5010 | link->sactive |= 1 << qc->tag; |
5006 | } else { | 5011 | } else { |
5007 | WARN_ON(link->sactive); | 5012 | WARN_ON_ONCE(link->sactive); |
5008 | 5013 | ||
5009 | ap->nr_active_links++; | 5014 | ap->nr_active_links++; |
5010 | link->active_tag = qc->tag; | 5015 | link->active_tag = qc->tag; |
@@ -5915,6 +5920,17 @@ static void async_port_probe(void *data, async_cookie_t cookie) | |||
5915 | { | 5920 | { |
5916 | int rc; | 5921 | int rc; |
5917 | struct ata_port *ap = data; | 5922 | struct ata_port *ap = data; |
5923 | |||
5924 | /* | ||
5925 | * If we're not allowed to scan this host in parallel, | ||
5926 | * we need to wait until all previous scans have completed | ||
5927 | * before going further. | ||
5928 | * Jeff Garzik says this is only within a controller, so we | ||
5929 | * don't need to wait for port 0, only for later ports. | ||
5930 | */ | ||
5931 | if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0) | ||
5932 | async_synchronize_cookie(cookie); | ||
5933 | |||
5918 | /* probe */ | 5934 | /* probe */ |
5919 | if (ap->ops->error_handler) { | 5935 | if (ap->ops->error_handler) { |
5920 | struct ata_eh_info *ehi = &ap->link.eh_info; | 5936 | struct ata_eh_info *ehi = &ap->link.eh_info; |