diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-25 18:20:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-25 18:20:22 -0400 |
commit | fc42dabe465d478311423039448d9dc9051e5f6b (patch) | |
tree | e00cd6fa67cc49c2793879cbc61d4c3a16ff5ec1 /drivers | |
parent | 2304c3ac3634d2de59f71f7b2c58aab05959124b (diff) | |
parent | e2e031eb09760c36099ac127eeb175e06d257aef (diff) |
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
[libata] sata_nv: SWNCQ should not apply to MCP61
libata-core: Be a bit more relaxed about early DMA zero devices
ahci: ahci: implement workaround for ASUS P5W-DH Deluxe ahci_broken_hardreset(), take #2
Fix pata_icside build for recent libata API changes
libata: cosmetic clean up in ata_eh_reset()
libata-core.c: make 2 functions static
[libata] Create internal helper ata_dev_set_feature()
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/ahci.c | 144 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 40 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 12 | ||||
-rw-r--r-- | drivers/ata/pata_icside.c | 42 | ||||
-rw-r--r-- | drivers/ata/sata_nv.c | 6 |
5 files changed, 195 insertions, 49 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 95229e77bffe..49cf4cf1a5a2 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/interrupt.h> | 41 | #include <linux/interrupt.h> |
42 | #include <linux/dma-mapping.h> | 42 | #include <linux/dma-mapping.h> |
43 | #include <linux/device.h> | 43 | #include <linux/device.h> |
44 | #include <linux/dmi.h> | ||
44 | #include <scsi/scsi_host.h> | 45 | #include <scsi/scsi_host.h> |
45 | #include <scsi/scsi_cmnd.h> | 46 | #include <scsi/scsi_cmnd.h> |
46 | #include <linux/libata.h> | 47 | #include <linux/libata.h> |
@@ -241,6 +242,7 @@ static void ahci_pmp_attach(struct ata_port *ap); | |||
241 | static void ahci_pmp_detach(struct ata_port *ap); | 242 | static void ahci_pmp_detach(struct ata_port *ap); |
242 | static void ahci_error_handler(struct ata_port *ap); | 243 | static void ahci_error_handler(struct ata_port *ap); |
243 | static void ahci_vt8251_error_handler(struct ata_port *ap); | 244 | static void ahci_vt8251_error_handler(struct ata_port *ap); |
245 | static void ahci_p5wdh_error_handler(struct ata_port *ap); | ||
244 | static void ahci_post_internal_cmd(struct ata_queued_cmd *qc); | 246 | static void ahci_post_internal_cmd(struct ata_queued_cmd *qc); |
245 | static int ahci_port_resume(struct ata_port *ap); | 247 | static int ahci_port_resume(struct ata_port *ap); |
246 | static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl); | 248 | static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl); |
@@ -339,6 +341,40 @@ static const struct ata_port_operations ahci_vt8251_ops = { | |||
339 | .port_stop = ahci_port_stop, | 341 | .port_stop = ahci_port_stop, |
340 | }; | 342 | }; |
341 | 343 | ||
344 | static const struct ata_port_operations ahci_p5wdh_ops = { | ||
345 | .check_status = ahci_check_status, | ||
346 | .check_altstatus = ahci_check_status, | ||
347 | .dev_select = ata_noop_dev_select, | ||
348 | |||
349 | .tf_read = ahci_tf_read, | ||
350 | |||
351 | .qc_defer = sata_pmp_qc_defer_cmd_switch, | ||
352 | .qc_prep = ahci_qc_prep, | ||
353 | .qc_issue = ahci_qc_issue, | ||
354 | |||
355 | .irq_clear = ahci_irq_clear, | ||
356 | |||
357 | .scr_read = ahci_scr_read, | ||
358 | .scr_write = ahci_scr_write, | ||
359 | |||
360 | .freeze = ahci_freeze, | ||
361 | .thaw = ahci_thaw, | ||
362 | |||
363 | .error_handler = ahci_p5wdh_error_handler, | ||
364 | .post_internal_cmd = ahci_post_internal_cmd, | ||
365 | |||
366 | .pmp_attach = ahci_pmp_attach, | ||
367 | .pmp_detach = ahci_pmp_detach, | ||
368 | |||
369 | #ifdef CONFIG_PM | ||
370 | .port_suspend = ahci_port_suspend, | ||
371 | .port_resume = ahci_port_resume, | ||
372 | #endif | ||
373 | |||
374 | .port_start = ahci_port_start, | ||
375 | .port_stop = ahci_port_stop, | ||
376 | }; | ||
377 | |||
342 | #define AHCI_HFLAGS(flags) .private_data = (void *)(flags) | 378 | #define AHCI_HFLAGS(flags) .private_data = (void *)(flags) |
343 | 379 | ||
344 | static const struct ata_port_info ahci_port_info[] = { | 380 | static const struct ata_port_info ahci_port_info[] = { |
@@ -1213,6 +1249,53 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, | |||
1213 | return rc ?: -EAGAIN; | 1249 | return rc ?: -EAGAIN; |
1214 | } | 1250 | } |
1215 | 1251 | ||
1252 | static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class, | ||
1253 | unsigned long deadline) | ||
1254 | { | ||
1255 | struct ata_port *ap = link->ap; | ||
1256 | struct ahci_port_priv *pp = ap->private_data; | ||
1257 | u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; | ||
1258 | struct ata_taskfile tf; | ||
1259 | int rc; | ||
1260 | |||
1261 | ahci_stop_engine(ap); | ||
1262 | |||
1263 | /* clear D2H reception area to properly wait for D2H FIS */ | ||
1264 | ata_tf_init(link->device, &tf); | ||
1265 | tf.command = 0x80; | ||
1266 | ata_tf_to_fis(&tf, 0, 0, d2h_fis); | ||
1267 | |||
1268 | rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context), | ||
1269 | deadline); | ||
1270 | |||
1271 | ahci_start_engine(ap); | ||
1272 | |||
1273 | if (rc || ata_link_offline(link)) | ||
1274 | return rc; | ||
1275 | |||
1276 | /* spec mandates ">= 2ms" before checking status */ | ||
1277 | msleep(150); | ||
1278 | |||
1279 | /* The pseudo configuration device on SIMG4726 attached to | ||
1280 | * ASUS P5W-DH Deluxe doesn't send signature FIS after | ||
1281 | * hardreset if no device is attached to the first downstream | ||
1282 | * port && the pseudo device locks up on SRST w/ PMP==0. To | ||
1283 | * work around this, wait for !BSY only briefly. If BSY isn't | ||
1284 | * cleared, perform CLO and proceed to IDENTIFY (achieved by | ||
1285 | * ATA_LFLAG_NO_SRST and ATA_LFLAG_ASSUME_ATA). | ||
1286 | * | ||
1287 | * Wait for two seconds. Devices attached to downstream port | ||
1288 | * which can't process the following IDENTIFY after this will | ||
1289 | * have to be reset again. For most cases, this should | ||
1290 | * suffice while making probing snappish enough. | ||
1291 | */ | ||
1292 | rc = ata_wait_ready(ap, jiffies + 2 * HZ); | ||
1293 | if (rc) | ||
1294 | ahci_kick_engine(ap, 0); | ||
1295 | |||
1296 | return 0; | ||
1297 | } | ||
1298 | |||
1216 | static void ahci_postreset(struct ata_link *link, unsigned int *class) | 1299 | static void ahci_postreset(struct ata_link *link, unsigned int *class) |
1217 | { | 1300 | { |
1218 | struct ata_port *ap = link->ap; | 1301 | struct ata_port *ap = link->ap; |
@@ -1670,6 +1753,19 @@ static void ahci_vt8251_error_handler(struct ata_port *ap) | |||
1670 | ahci_postreset); | 1753 | ahci_postreset); |
1671 | } | 1754 | } |
1672 | 1755 | ||
1756 | static void ahci_p5wdh_error_handler(struct ata_port *ap) | ||
1757 | { | ||
1758 | if (!(ap->pflags & ATA_PFLAG_FROZEN)) { | ||
1759 | /* restart engine */ | ||
1760 | ahci_stop_engine(ap); | ||
1761 | ahci_start_engine(ap); | ||
1762 | } | ||
1763 | |||
1764 | /* perform recovery */ | ||
1765 | ata_do_eh(ap, ata_std_prereset, ahci_softreset, ahci_p5wdh_hardreset, | ||
1766 | ahci_postreset); | ||
1767 | } | ||
1768 | |||
1673 | static void ahci_post_internal_cmd(struct ata_queued_cmd *qc) | 1769 | static void ahci_post_internal_cmd(struct ata_queued_cmd *qc) |
1674 | { | 1770 | { |
1675 | struct ata_port *ap = qc->ap; | 1771 | struct ata_port *ap = qc->ap; |
@@ -1955,6 +2051,51 @@ static void ahci_print_info(struct ata_host *host) | |||
1955 | ); | 2051 | ); |
1956 | } | 2052 | } |
1957 | 2053 | ||
2054 | /* On ASUS P5W DH Deluxe, the second port of PCI device 00:1f.2 is | ||
2055 | * hardwired to on-board SIMG 4726. The chipset is ICH8 and doesn't | ||
2056 | * support PMP and the 4726 either directly exports the device | ||
2057 | * attached to the first downstream port or acts as a hardware storage | ||
2058 | * controller and emulate a single ATA device (can be RAID 0/1 or some | ||
2059 | * other configuration). | ||
2060 | * | ||
2061 | * When there's no device attached to the first downstream port of the | ||
2062 | * 4726, "Config Disk" appears, which is a pseudo ATA device to | ||
2063 | * configure the 4726. However, ATA emulation of the device is very | ||
2064 | * lame. It doesn't send signature D2H Reg FIS after the initial | ||
2065 | * hardreset, pukes on SRST w/ PMP==0 and has bunch of other issues. | ||
2066 | * | ||
2067 | * The following function works around the problem by always using | ||
2068 | * hardreset on the port and not depending on receiving signature FIS | ||
2069 | * afterward. If signature FIS isn't received soon, ATA class is | ||
2070 | * assumed without follow-up softreset. | ||
2071 | */ | ||
2072 | static void ahci_p5wdh_workaround(struct ata_host *host) | ||
2073 | { | ||
2074 | static struct dmi_system_id sysids[] = { | ||
2075 | { | ||
2076 | .ident = "P5W DH Deluxe", | ||
2077 | .matches = { | ||
2078 | DMI_MATCH(DMI_SYS_VENDOR, | ||
2079 | "ASUSTEK COMPUTER INC"), | ||
2080 | DMI_MATCH(DMI_PRODUCT_NAME, "P5W DH Deluxe"), | ||
2081 | }, | ||
2082 | }, | ||
2083 | { } | ||
2084 | }; | ||
2085 | struct pci_dev *pdev = to_pci_dev(host->dev); | ||
2086 | |||
2087 | if (pdev->bus->number == 0 && pdev->devfn == PCI_DEVFN(0x1f, 2) && | ||
2088 | dmi_check_system(sysids)) { | ||
2089 | struct ata_port *ap = host->ports[1]; | ||
2090 | |||
2091 | dev_printk(KERN_INFO, &pdev->dev, "enabling ASUS P5W DH " | ||
2092 | "Deluxe on-board SIMG4726 workaround\n"); | ||
2093 | |||
2094 | ap->ops = &ahci_p5wdh_ops; | ||
2095 | ap->link.flags |= ATA_LFLAG_NO_SRST | ATA_LFLAG_ASSUME_ATA; | ||
2096 | } | ||
2097 | } | ||
2098 | |||
1958 | static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | 2099 | static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
1959 | { | 2100 | { |
1960 | static int printed_version; | 2101 | static int printed_version; |
@@ -2024,6 +2165,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2024 | ap->ops = &ata_dummy_port_ops; | 2165 | ap->ops = &ata_dummy_port_ops; |
2025 | } | 2166 | } |
2026 | 2167 | ||
2168 | /* apply workaround for ASUS P5W DH Deluxe mainboard */ | ||
2169 | ahci_p5wdh_workaround(host); | ||
2170 | |||
2027 | /* initialize adapter */ | 2171 | /* initialize adapter */ |
2028 | rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64); | 2172 | rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64); |
2029 | if (rc) | 2173 | if (rc) |
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 }; | |||
68 | static unsigned int ata_dev_init_params(struct ata_device *dev, | 68 | static unsigned int ata_dev_init_params(struct ata_device *dev, |
69 | u16 heads, u16 sectors); | 69 | u16 heads, u16 sectors); |
70 | static unsigned int ata_dev_set_xfermode(struct ata_device *dev); | 70 | static unsigned int ata_dev_set_xfermode(struct ata_device *dev); |
71 | static unsigned int ata_dev_set_AN(struct ata_device *dev, u8 enable); | 71 | static unsigned int ata_dev_set_feature(struct ata_device *dev, |
72 | u8 enable, u8 feature); | ||
72 | static void ata_dev_xfermask(struct ata_device *dev); | 73 | static void ata_dev_xfermask(struct ata_device *dev); |
73 | static unsigned long ata_dev_blacklisted(const struct ata_device *dev); | 74 | static 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 | ||
4010 | int strn_pattern_cmp(const char *patt, const char *name, int wildchar) | 4010 | static 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 | */ |
4200 | static unsigned int ata_dev_set_AN(struct ata_device *dev, u8 enable) | 4199 | static 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 | */ |
6924 | void ata_port_detach(struct ata_port *ap) | 6924 | static 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; |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 93e2b545b439..8cb35bb87605 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -2071,7 +2071,7 @@ int ata_eh_reset(struct ata_link *link, int classify, | |||
2071 | int try = 0; | 2071 | int try = 0; |
2072 | struct ata_device *dev; | 2072 | struct ata_device *dev; |
2073 | unsigned long deadline; | 2073 | unsigned long deadline; |
2074 | unsigned int action; | 2074 | unsigned int tmp_action; |
2075 | ata_reset_fn_t reset; | 2075 | ata_reset_fn_t reset; |
2076 | unsigned long flags; | 2076 | unsigned long flags; |
2077 | int rc; | 2077 | int rc; |
@@ -2086,14 +2086,14 @@ int ata_eh_reset(struct ata_link *link, int classify, | |||
2086 | /* Determine which reset to use and record in ehc->i.action. | 2086 | /* Determine which reset to use and record in ehc->i.action. |
2087 | * prereset() may examine and modify it. | 2087 | * prereset() may examine and modify it. |
2088 | */ | 2088 | */ |
2089 | action = ehc->i.action; | ||
2090 | ehc->i.action &= ~ATA_EH_RESET_MASK; | ||
2091 | if (softreset && (!hardreset || (!(link->flags & ATA_LFLAG_NO_SRST) && | 2089 | if (softreset && (!hardreset || (!(link->flags & ATA_LFLAG_NO_SRST) && |
2092 | !sata_set_spd_needed(link) && | 2090 | !sata_set_spd_needed(link) && |
2093 | !(action & ATA_EH_HARDRESET)))) | 2091 | !(ehc->i.action & ATA_EH_HARDRESET)))) |
2094 | ehc->i.action |= ATA_EH_SOFTRESET; | 2092 | tmp_action = ATA_EH_SOFTRESET; |
2095 | else | 2093 | else |
2096 | ehc->i.action |= ATA_EH_HARDRESET; | 2094 | tmp_action = ATA_EH_HARDRESET; |
2095 | |||
2096 | ehc->i.action = (ehc->i.action & ~ATA_EH_RESET_MASK) | tmp_action; | ||
2097 | 2097 | ||
2098 | if (prereset) { | 2098 | if (prereset) { |
2099 | rc = prereset(link, jiffies + ATA_EH_PRERESET_TIMEOUT); | 2099 | rc = prereset(link, jiffies + ATA_EH_PRERESET_TIMEOUT); |
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c index be30923566c5..842fe08a3c13 100644 --- a/drivers/ata/pata_icside.c +++ b/drivers/ata/pata_icside.c | |||
@@ -332,12 +332,13 @@ static void ata_dummy_noret(struct ata_port *port) | |||
332 | { | 332 | { |
333 | } | 333 | } |
334 | 334 | ||
335 | static void pata_icside_postreset(struct ata_port *ap, unsigned int *classes) | 335 | static void pata_icside_postreset(struct ata_link *link, unsigned int *classes) |
336 | { | 336 | { |
337 | struct ata_port *ap = link->ap; | ||
337 | struct pata_icside_state *state = ap->host->private_data; | 338 | struct pata_icside_state *state = ap->host->private_data; |
338 | 339 | ||
339 | if (classes[0] != ATA_DEV_NONE || classes[1] != ATA_DEV_NONE) | 340 | if (classes[0] != ATA_DEV_NONE || classes[1] != ATA_DEV_NONE) |
340 | return ata_std_postreset(ap, classes); | 341 | return ata_std_postreset(link, classes); |
341 | 342 | ||
342 | state->port[ap->port_no].disabled = 1; | 343 | state->port[ap->port_no].disabled = 1; |
343 | 344 | ||
@@ -395,29 +396,30 @@ static struct ata_port_operations pata_icside_port_ops = { | |||
395 | 396 | ||
396 | static void __devinit | 397 | static void __devinit |
397 | pata_icside_setup_ioaddr(struct ata_port *ap, void __iomem *base, | 398 | pata_icside_setup_ioaddr(struct ata_port *ap, void __iomem *base, |
398 | const struct portinfo *info) | 399 | struct pata_icside_info *info, |
400 | const struct portinfo *port) | ||
399 | { | 401 | { |
400 | struct ata_ioports *ioaddr = &ap->ioaddr; | 402 | struct ata_ioports *ioaddr = &ap->ioaddr; |
401 | void __iomem *cmd = base + info->dataoffset; | 403 | void __iomem *cmd = base + port->dataoffset; |
402 | 404 | ||
403 | ioaddr->cmd_addr = cmd; | 405 | ioaddr->cmd_addr = cmd; |
404 | ioaddr->data_addr = cmd + (ATA_REG_DATA << info->stepping); | 406 | ioaddr->data_addr = cmd + (ATA_REG_DATA << port->stepping); |
405 | ioaddr->error_addr = cmd + (ATA_REG_ERR << info->stepping); | 407 | ioaddr->error_addr = cmd + (ATA_REG_ERR << port->stepping); |
406 | ioaddr->feature_addr = cmd + (ATA_REG_FEATURE << info->stepping); | 408 | ioaddr->feature_addr = cmd + (ATA_REG_FEATURE << port->stepping); |
407 | ioaddr->nsect_addr = cmd + (ATA_REG_NSECT << info->stepping); | 409 | ioaddr->nsect_addr = cmd + (ATA_REG_NSECT << port->stepping); |
408 | ioaddr->lbal_addr = cmd + (ATA_REG_LBAL << info->stepping); | 410 | ioaddr->lbal_addr = cmd + (ATA_REG_LBAL << port->stepping); |
409 | ioaddr->lbam_addr = cmd + (ATA_REG_LBAM << info->stepping); | 411 | ioaddr->lbam_addr = cmd + (ATA_REG_LBAM << port->stepping); |
410 | ioaddr->lbah_addr = cmd + (ATA_REG_LBAH << info->stepping); | 412 | ioaddr->lbah_addr = cmd + (ATA_REG_LBAH << port->stepping); |
411 | ioaddr->device_addr = cmd + (ATA_REG_DEVICE << info->stepping); | 413 | ioaddr->device_addr = cmd + (ATA_REG_DEVICE << port->stepping); |
412 | ioaddr->status_addr = cmd + (ATA_REG_STATUS << info->stepping); | 414 | ioaddr->status_addr = cmd + (ATA_REG_STATUS << port->stepping); |
413 | ioaddr->command_addr = cmd + (ATA_REG_CMD << info->stepping); | 415 | ioaddr->command_addr = cmd + (ATA_REG_CMD << port->stepping); |
414 | 416 | ||
415 | ioaddr->ctl_addr = base + info->ctrloffset; | 417 | ioaddr->ctl_addr = base + port->ctrloffset; |
416 | ioaddr->altstatus_addr = ioaddr->ctl_addr; | 418 | ioaddr->altstatus_addr = ioaddr->ctl_addr; |
417 | 419 | ||
418 | ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", | 420 | ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", |
419 | info->raw_base + info->dataoffset, | 421 | info->raw_base + port->dataoffset, |
420 | info->raw_base + info->ctrloffset); | 422 | info->raw_base + port->ctrloffset); |
421 | 423 | ||
422 | if (info->raw_ioc_base) | 424 | if (info->raw_ioc_base) |
423 | ata_port_desc(ap, "iocbase 0x%lx", info->raw_ioc_base); | 425 | ata_port_desc(ap, "iocbase 0x%lx", info->raw_ioc_base); |
@@ -441,7 +443,7 @@ static int __devinit pata_icside_register_v5(struct pata_icside_info *info) | |||
441 | info->nr_ports = 1; | 443 | info->nr_ports = 1; |
442 | info->port[0] = &pata_icside_portinfo_v5; | 444 | info->port[0] = &pata_icside_portinfo_v5; |
443 | 445 | ||
444 | info->raw_base = ecard_resource_start(ec, ECARD_RES_MEMC); | 446 | info->raw_base = ecard_resource_start(info->ec, ECARD_RES_MEMC); |
445 | 447 | ||
446 | return 0; | 448 | return 0; |
447 | } | 449 | } |
@@ -522,7 +524,7 @@ static int __devinit pata_icside_add_ports(struct pata_icside_info *info) | |||
522 | ap->flags |= ATA_FLAG_SLAVE_POSS; | 524 | ap->flags |= ATA_FLAG_SLAVE_POSS; |
523 | ap->ops = &pata_icside_port_ops; | 525 | ap->ops = &pata_icside_port_ops; |
524 | 526 | ||
525 | pata_icside_setup_ioaddr(ap, info->base, info->port[i]); | 527 | pata_icside_setup_ioaddr(ap, info->base, info, info->port[i]); |
526 | } | 528 | } |
527 | 529 | ||
528 | return ata_host_activate(host, ec->irq, ata_interrupt, 0, | 530 | return ata_host_activate(host, ec->irq, ata_interrupt, 0, |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 2e0279fdd7aa..f1b422f7c749 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -365,9 +365,9 @@ static const struct pci_device_id nv_pci_tbl[] = { | |||
365 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2), SWNCQ }, | 365 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2), SWNCQ }, |
366 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA), SWNCQ }, | 366 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA), SWNCQ }, |
367 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2), SWNCQ }, | 367 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2), SWNCQ }, |
368 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), SWNCQ }, | 368 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC }, |
369 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), SWNCQ }, | 369 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC }, |
370 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), SWNCQ }, | 370 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC }, |
371 | 371 | ||
372 | { } /* terminate list */ | 372 | { } /* terminate list */ |
373 | }; | 373 | }; |