aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-07-05 00:31:27 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-10 21:30:33 -0400
commit75683fe7153c3817bb4fd4491e2a5913af6c463e (patch)
tree5c7bb12e577a328b41df16d036c7060309493f44 /drivers/ata/libata-core.c
parent39ce7128066f2ac5954bcda9f07f429f28166da3 (diff)
libata: clean up horkage handling
Horkage handling had the following problems. * dev->horkage was positioned after ATA_DEVICE_CLEAR_OFFSET, so it was cleared before the device is configured. This broke HORKAGE_DIAGNOSTIC. * Some used dev->horkage while others called ata_device_blacklisted() directly. This was at best confusing. This patch moves dev->horkage right after dev->flags and set the field according to the blacklist during device configuration. All users test against dev->horkage. ata_device_blacklisted() now has only one user, make it static. While at it, rename it to ata_dev_blacklisted() for consistency. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a00e4ee58b73..66c8c8c377ab 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -71,6 +71,7 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,
71 u16 heads, u16 sectors); 71 u16 heads, u16 sectors);
72static unsigned int ata_dev_set_xfermode(struct ata_device *dev); 72static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
73static void ata_dev_xfermask(struct ata_device *dev); 73static void ata_dev_xfermask(struct ata_device *dev);
74static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
74 75
75unsigned int ata_print_id = 1; 76unsigned int ata_print_id = 1;
76static struct workqueue_struct *ata_wq; 77static struct workqueue_struct *ata_wq;
@@ -1784,7 +1785,7 @@ static void ata_dev_config_ncq(struct ata_device *dev,
1784 desc[0] = '\0'; 1785 desc[0] = '\0';
1785 return; 1786 return;
1786 } 1787 }
1787 if (ata_device_blacklisted(dev) & ATA_HORKAGE_NONCQ) { 1788 if (dev->horkage & ATA_HORKAGE_NONCQ) {
1788 snprintf(desc, desc_sz, "NCQ (not used)"); 1789 snprintf(desc, desc_sz, "NCQ (not used)");
1789 return; 1790 return;
1790 } 1791 }
@@ -1833,6 +1834,9 @@ int ata_dev_configure(struct ata_device *dev)
1833 if (ata_msg_probe(ap)) 1834 if (ata_msg_probe(ap))
1834 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __FUNCTION__); 1835 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __FUNCTION__);
1835 1836
1837 /* set horkage */
1838 dev->horkage |= ata_dev_blacklisted(dev);
1839
1836 /* let ACPI work its magic */ 1840 /* let ACPI work its magic */
1837 rc = ata_acpi_on_devcfg(dev); 1841 rc = ata_acpi_on_devcfg(dev);
1838 if (rc) 1842 if (rc)
@@ -2008,7 +2012,7 @@ int ata_dev_configure(struct ata_device *dev)
2008 dev->max_sectors = ATA_MAX_SECTORS; 2012 dev->max_sectors = ATA_MAX_SECTORS;
2009 } 2013 }
2010 2014
2011 if (ata_device_blacklisted(dev) & ATA_HORKAGE_MAX_SEC_128) 2015 if (dev->horkage & ATA_HORKAGE_MAX_SEC_128)
2012 dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, 2016 dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128,
2013 dev->max_sectors); 2017 dev->max_sectors);
2014 2018
@@ -3775,7 +3779,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
3775 { } 3779 { }
3776}; 3780};
3777 3781
3778unsigned long ata_device_blacklisted(const struct ata_device *dev) 3782static unsigned long ata_dev_blacklisted(const struct ata_device *dev)
3779{ 3783{
3780 unsigned char model_num[ATA_ID_PROD_LEN + 1]; 3784 unsigned char model_num[ATA_ID_PROD_LEN + 1];
3781 unsigned char model_rev[ATA_ID_FW_REV_LEN + 1]; 3785 unsigned char model_rev[ATA_ID_FW_REV_LEN + 1];
@@ -3805,7 +3809,7 @@ static int ata_dma_blacklisted(const struct ata_device *dev)
3805 if ((dev->ap->flags & ATA_FLAG_PIO_POLLING) && 3809 if ((dev->ap->flags & ATA_FLAG_PIO_POLLING) &&
3806 (dev->flags & ATA_DFLAG_CDB_INTR)) 3810 (dev->flags & ATA_DFLAG_CDB_INTR))
3807 return 1; 3811 return 1;
3808 return (ata_device_blacklisted(dev) & ATA_HORKAGE_NODMA) ? 1 : 0; 3812 return (dev->horkage & ATA_HORKAGE_NODMA) ? 1 : 0;
3809} 3813}
3810 3814
3811/** 3815/**
@@ -6918,7 +6922,6 @@ EXPORT_SYMBOL_GPL(ata_host_resume);
6918EXPORT_SYMBOL_GPL(ata_id_string); 6922EXPORT_SYMBOL_GPL(ata_id_string);
6919EXPORT_SYMBOL_GPL(ata_id_c_string); 6923EXPORT_SYMBOL_GPL(ata_id_c_string);
6920EXPORT_SYMBOL_GPL(ata_id_to_dma_mode); 6924EXPORT_SYMBOL_GPL(ata_id_to_dma_mode);
6921EXPORT_SYMBOL_GPL(ata_device_blacklisted);
6922EXPORT_SYMBOL_GPL(ata_scsi_simulate); 6925EXPORT_SYMBOL_GPL(ata_scsi_simulate);
6923 6926
6924EXPORT_SYMBOL_GPL(ata_pio_need_iordy); 6927EXPORT_SYMBOL_GPL(ata_pio_need_iordy);