aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 2d147b51c978..9d10e2feb8b1 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -68,7 +68,8 @@ const unsigned long sata_deb_timing_long[] = { 100, 2000, 5000 };
68static unsigned int ata_dev_init_params(struct ata_device *dev, 68static unsigned int ata_dev_init_params(struct ata_device *dev,
69 u16 heads, u16 sectors); 69 u16 heads, u16 sectors);
70static unsigned int ata_dev_set_xfermode(struct ata_device *dev); 70static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
71static unsigned int ata_dev_set_AN(struct ata_device *dev, u8 enable); 71static unsigned int ata_dev_set_feature(struct ata_device *dev,
72 u8 enable, u8 feature);
72static void ata_dev_xfermask(struct ata_device *dev); 73static void ata_dev_xfermask(struct ata_device *dev);
73static unsigned long ata_dev_blacklisted(const struct ata_device *dev); 74static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
74 75
@@ -1799,13 +1800,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
1799 * SET_FEATURES spin-up subcommand before it will accept 1800 * SET_FEATURES spin-up subcommand before it will accept
1800 * anything other than the original IDENTIFY command. 1801 * anything other than the original IDENTIFY command.
1801 */ 1802 */
1802 ata_tf_init(dev, &tf); 1803 err_mask = ata_dev_set_feature(dev, SETFEATURES_SPINUP, 0);
1803 tf.command = ATA_CMD_SET_FEATURES;
1804 tf.feature = SETFEATURES_SPINUP;
1805 tf.protocol = ATA_PROT_NODATA;
1806 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
1807 err_mask = ata_exec_internal(dev, &tf, NULL,
1808 DMA_NONE, NULL, 0, 0);
1809 if (err_mask && id[2] != 0x738c) { 1804 if (err_mask && id[2] != 0x738c) {
1810 rc = -EIO; 1805 rc = -EIO;
1811 reason = "SPINUP failed"; 1806 reason = "SPINUP failed";
@@ -2075,7 +2070,8 @@ int ata_dev_configure(struct ata_device *dev)
2075 unsigned int err_mask; 2070 unsigned int err_mask;
2076 2071
2077 /* issue SET feature command to turn this on */ 2072 /* issue SET feature command to turn this on */
2078 err_mask = ata_dev_set_AN(dev, SETFEATURES_SATA_ENABLE); 2073 err_mask = ata_dev_set_feature(dev,
2074 SETFEATURES_SATA_ENABLE, SATA_AN);
2079 if (err_mask) 2075 if (err_mask)
2080 ata_dev_printk(dev, KERN_ERR, 2076 ata_dev_printk(dev, KERN_ERR,
2081 "failed to enable ATAPI AN " 2077 "failed to enable ATAPI AN "
@@ -2886,6 +2882,13 @@ static int ata_dev_set_mode(struct ata_device *dev)
2886 dev->pio_mode <= XFER_PIO_2) 2882 dev->pio_mode <= XFER_PIO_2)
2887 err_mask &= ~AC_ERR_DEV; 2883 err_mask &= ~AC_ERR_DEV;
2888 2884
2885 /* Early MWDMA devices do DMA but don't allow DMA mode setting.
2886 Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */
2887 if (dev->xfer_shift == ATA_SHIFT_MWDMA &&
2888 dev->dma_mode == XFER_MW_DMA_0 &&
2889 (dev->id[63] >> 8) & 1)
2890 err_mask &= ~AC_ERR_DEV;
2891
2889 if (err_mask) { 2892 if (err_mask) {
2890 ata_dev_printk(dev, KERN_ERR, "failed to set xfermode " 2893 ata_dev_printk(dev, KERN_ERR, "failed to set xfermode "
2891 "(err_mask=0x%x)\n", err_mask); 2894 "(err_mask=0x%x)\n", err_mask);
@@ -3947,9 +3950,6 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
3947 { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA }, 3950 { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA },
3948 { "SAMSUNG CD-ROM SN-124", "N001", ATA_HORKAGE_NODMA }, 3951 { "SAMSUNG CD-ROM SN-124", "N001", ATA_HORKAGE_NODMA },
3949 { "Seagate STT20000A", NULL, ATA_HORKAGE_NODMA }, 3952 { "Seagate STT20000A", NULL, ATA_HORKAGE_NODMA },
3950 { "IOMEGA ZIP 250 ATAPI", NULL, ATA_HORKAGE_NODMA }, /* temporary fix */
3951 { "IOMEGA ZIP 250 ATAPI Floppy",
3952 NULL, ATA_HORKAGE_NODMA },
3953 /* Odd clown on sil3726/4726 PMPs */ 3953 /* Odd clown on sil3726/4726 PMPs */
3954 { "Config Disk", NULL, ATA_HORKAGE_NODMA | 3954 { "Config Disk", NULL, ATA_HORKAGE_NODMA |
3955 ATA_HORKAGE_SKIP_PM }, 3955 ATA_HORKAGE_SKIP_PM },
@@ -4007,7 +4007,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4007 { } 4007 { }
4008}; 4008};
4009 4009
4010int strn_pattern_cmp(const char *patt, const char *name, int wildchar) 4010static int strn_pattern_cmp(const char *patt, const char *name, int wildchar)
4011{ 4011{
4012 const char *p; 4012 const char *p;
4013 int len; 4013 int len;
@@ -4181,15 +4181,14 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev)
4181 DPRINTK("EXIT, err_mask=%x\n", err_mask); 4181 DPRINTK("EXIT, err_mask=%x\n", err_mask);
4182 return err_mask; 4182 return err_mask;
4183} 4183}
4184
4185/** 4184/**
4186 * ata_dev_set_AN - Issue SET FEATURES - SATA FEATURES 4185 * ata_dev_set_feature - Issue SET FEATURES - SATA FEATURES
4187 * @dev: Device to which command will be sent 4186 * @dev: Device to which command will be sent
4188 * @enable: Whether to enable or disable the feature 4187 * @enable: Whether to enable or disable the feature
4188 * @feature: The sector count represents the feature to set
4189 * 4189 *
4190 * Issue SET FEATURES - SATA FEATURES command to device @dev 4190 * Issue SET FEATURES - SATA FEATURES command to device @dev
4191 * on port @ap with sector count set to indicate Asynchronous 4191 * on port @ap with sector count
4192 * Notification feature
4193 * 4192 *
4194 * LOCKING: 4193 * LOCKING:
4195 * PCI/etc. bus probe sem. 4194 * PCI/etc. bus probe sem.
@@ -4197,7 +4196,8 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev)
4197 * RETURNS: 4196 * RETURNS:
4198 * 0 on success, AC_ERR_* mask otherwise. 4197 * 0 on success, AC_ERR_* mask otherwise.
4199 */ 4198 */
4200static unsigned int ata_dev_set_AN(struct ata_device *dev, u8 enable) 4199static unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable,
4200 u8 feature)
4201{ 4201{
4202 struct ata_taskfile tf; 4202 struct ata_taskfile tf;
4203 unsigned int err_mask; 4203 unsigned int err_mask;
@@ -4210,7 +4210,7 @@ static unsigned int ata_dev_set_AN(struct ata_device *dev, u8 enable)
4210 tf.feature = enable; 4210 tf.feature = enable;
4211 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; 4211 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
4212 tf.protocol = ATA_PROT_NODATA; 4212 tf.protocol = ATA_PROT_NODATA;
4213 tf.nsect = SATA_AN; 4213 tf.nsect = feature;
4214 4214
4215 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); 4215 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
4216 4216
@@ -6921,7 +6921,7 @@ int ata_host_activate(struct ata_host *host, int irq,
6921 * LOCKING: 6921 * LOCKING:
6922 * Kernel thread context (may sleep). 6922 * Kernel thread context (may sleep).
6923 */ 6923 */
6924void ata_port_detach(struct ata_port *ap) 6924static void ata_port_detach(struct ata_port *ap)
6925{ 6925{
6926 unsigned long flags; 6926 unsigned long flags;
6927 struct ata_link *link; 6927 struct ata_link *link;