aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-29 11:03:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-29 11:03:30 -0400
commit302f5bc54448bd2b37d5a8be9b6abc29397827ef (patch)
tree3486f92b13f6b53dd28388c1f2e5f33dc9866f20
parent18cb657ca1bafe635f368346a1676fb04c512edf (diff)
parentdd8717da6da9b0e745df49762be4573010f1013c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6: ide: clean up timed out request handling hpt366: fix clock turnaround hpt366: add debounce delay to cable_detect() method
-rw-r--r--drivers/ide/hpt366.c14
-rw-r--r--drivers/ide/ide-dma.c11
2 files changed, 11 insertions, 14 deletions
diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c
index 97d98fbf5849..58c51cddc100 100644
--- a/drivers/ide/hpt366.c
+++ b/drivers/ide/hpt366.c
@@ -838,7 +838,7 @@ static void hpt3xxn_set_clock(ide_hwif_t *hwif, u8 mode)
838 838
839static void hpt3xxn_rw_disk(ide_drive_t *drive, struct request *rq) 839static void hpt3xxn_rw_disk(ide_drive_t *drive, struct request *rq)
840{ 840{
841 hpt3xxn_set_clock(drive->hwif, rq_data_dir(rq) ? 0x23 : 0x21); 841 hpt3xxn_set_clock(drive->hwif, rq_data_dir(rq) ? 0x21 : 0x23);
842} 842}
843 843
844/** 844/**
@@ -1173,8 +1173,9 @@ static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
1173 u16 mcr; 1173 u16 mcr;
1174 1174
1175 pci_read_config_word(dev, mcr_addr, &mcr); 1175 pci_read_config_word(dev, mcr_addr, &mcr);
1176 pci_write_config_word(dev, mcr_addr, (mcr | 0x8000)); 1176 pci_write_config_word(dev, mcr_addr, mcr | 0x8000);
1177 /* now read cable id register */ 1177 /* Debounce, then read cable ID register */
1178 udelay(10);
1178 pci_read_config_byte(dev, 0x5a, &scr1); 1179 pci_read_config_byte(dev, 0x5a, &scr1);
1179 pci_write_config_word(dev, mcr_addr, mcr); 1180 pci_write_config_word(dev, mcr_addr, mcr);
1180 } else if (chip_type >= HPT370) { 1181 } else if (chip_type >= HPT370) {
@@ -1185,10 +1186,11 @@ static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
1185 u8 scr2 = 0; 1186 u8 scr2 = 0;
1186 1187
1187 pci_read_config_byte(dev, 0x5b, &scr2); 1188 pci_read_config_byte(dev, 0x5b, &scr2);
1188 pci_write_config_byte(dev, 0x5b, (scr2 & ~1)); 1189 pci_write_config_byte(dev, 0x5b, scr2 & ~1);
1189 /* now read cable id register */ 1190 /* Debounce, then read cable ID register */
1191 udelay(10);
1190 pci_read_config_byte(dev, 0x5a, &scr1); 1192 pci_read_config_byte(dev, 0x5a, &scr1);
1191 pci_write_config_byte(dev, 0x5b, scr2); 1193 pci_write_config_byte(dev, 0x5b, scr2);
1192 } else 1194 } else
1193 pci_read_config_byte(dev, 0x5a, &scr1); 1195 pci_read_config_byte(dev, 0x5a, &scr1);
1194 1196
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 06b14bc9a1d4..d4136908f916 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -449,7 +449,6 @@ ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error)
449 ide_hwif_t *hwif = drive->hwif; 449 ide_hwif_t *hwif = drive->hwif;
450 const struct ide_dma_ops *dma_ops = hwif->dma_ops; 450 const struct ide_dma_ops *dma_ops = hwif->dma_ops;
451 struct ide_cmd *cmd = &hwif->cmd; 451 struct ide_cmd *cmd = &hwif->cmd;
452 struct request *rq;
453 ide_startstop_t ret = ide_stopped; 452 ide_startstop_t ret = ide_stopped;
454 453
455 /* 454 /*
@@ -487,14 +486,10 @@ ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error)
487 ide_dma_off_quietly(drive); 486 ide_dma_off_quietly(drive);
488 487
489 /* 488 /*
490 * un-busy drive etc and make sure request is sane 489 * make sure request is sane
491 */ 490 */
492 rq = hwif->rq; 491 if (hwif->rq)
493 if (rq) { 492 hwif->rq->errors = 0;
494 hwif->rq = NULL;
495 rq->errors = 0;
496 ide_requeue_and_plug(drive, rq);
497 }
498 return ret; 493 return ret;
499} 494}
500 495