diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-06-08 09:14:29 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-06-08 09:14:29 -0400 |
commit | 0380dad45e4f5a606025cc4df2a2cd26af08796b (patch) | |
tree | c135a4a5527ce98bb3473342061f3990feef7d42 /drivers/ide/ide-probe.c | |
parent | 1abb8a8b841354e7a09ba2009376f0a6368b5cec (diff) |
it821x: RAID mode fixes
The DMA support for RAID mode broke after:
commit 71ef51cc1756d1c56b57c70e7cc27a3559c81ee6
Author: Jens Axboe <axboe@suse.de>
Date: Â Fri Jul 28 09:02:17 2006 +0200
  [PATCH] it821x: fix ide dma setup bug
  Only enable dma for a valid speed setting.
  Signed-off-by: Jens Axboe <axboe@suse.de>
commit 0a8348d08677ad77ee353f96eb8745c693a05a13
Author: Jens Axboe <axboe@suse.de>
Date: Â Fri Jul 28 08:58:26 2006 +0200
  [PATCH] ide: if the id fields looks screwy, disable DMA
  It's the safer choice. Originally due to a bug in itx821x, but a
  generally sound thing to do.
  Signed-off-by: Jens Axboe <axboe@suse.de>
However it worked by pure luck before Jens' fixes: bogus ide_dma_enable()
usage in it821x driver combined with loosy check in ide_dma_verbose() allowed
the hardware to operate in DMA mode. When these problems were fixed the DMA
support broke...
The source root for the regression turned out to be that the it821x.c code
was clearing too much of id->field_valid. The IDE core code was using the
original value of id->field_valid to do the tuning but later DMA got disabled
in ide_dma_verbose() because of the incorrect id->field_valid fixup. Fix it.
While at it:
* Do fixup() after probing the drives but before tuning them (which is also
OK w.r.t. ide_undecoded_slave() fixup). This change fixes device IDENTIFY
data to be consistent before/after the tuning and allows us to remove extra
re-tuning of drives from it821x_fixups().
* Fake MWDMA0 enabled/supported bits in IDENTIFY data if the device has
DMA capable bit set (this is just to tell the IDE core that DMA is
supported since it821x firmware takes care of DMA mode programming).
* Don't touch timing registers and don't program transfer modes on devices
et all when in RAID mode - depend solely on firmware to do the tuning
(as suggested by Alan Cox and done in libata pata_it821x driver).
Thanks for testing the patch goes out to Thomas Kuther.
Cc: Thomas Kuther <gimpel@sonnenkinder.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jens Axboe <axboe@suse.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 3cebed77f55..41bfa4d21ab 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -717,7 +717,7 @@ EXPORT_SYMBOL_GPL(ide_undecoded_slave); | |||
717 | * This routine only knows how to look for drive units 0 and 1 | 717 | * This routine only knows how to look for drive units 0 and 1 |
718 | * on an interface, so any setting of MAX_DRIVES > 2 won't work here. | 718 | * on an interface, so any setting of MAX_DRIVES > 2 won't work here. |
719 | */ | 719 | */ |
720 | static void probe_hwif(ide_hwif_t *hwif) | 720 | static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)) |
721 | { | 721 | { |
722 | unsigned int unit; | 722 | unsigned int unit; |
723 | unsigned long flags; | 723 | unsigned long flags; |
@@ -820,6 +820,9 @@ static void probe_hwif(ide_hwif_t *hwif) | |||
820 | return; | 820 | return; |
821 | } | 821 | } |
822 | 822 | ||
823 | if (fixup) | ||
824 | fixup(hwif); | ||
825 | |||
823 | for (unit = 0; unit < MAX_DRIVES; ++unit) { | 826 | for (unit = 0; unit < MAX_DRIVES; ++unit) { |
824 | ide_drive_t *drive = &hwif->drives[unit]; | 827 | ide_drive_t *drive = &hwif->drives[unit]; |
825 | 828 | ||
@@ -874,10 +877,7 @@ static int hwif_init(ide_hwif_t *hwif); | |||
874 | 877 | ||
875 | int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)) | 878 | int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)) |
876 | { | 879 | { |
877 | probe_hwif(hwif); | 880 | probe_hwif(hwif, fixup); |
878 | |||
879 | if (fixup) | ||
880 | fixup(hwif); | ||
881 | 881 | ||
882 | if (!hwif_init(hwif)) { | 882 | if (!hwif_init(hwif)) { |
883 | printk(KERN_INFO "%s: failed to initialize IDE interface\n", | 883 | printk(KERN_INFO "%s: failed to initialize IDE interface\n", |
@@ -1404,7 +1404,7 @@ int ideprobe_init (void) | |||
1404 | 1404 | ||
1405 | for (index = 0; index < MAX_HWIFS; ++index) | 1405 | for (index = 0; index < MAX_HWIFS; ++index) |
1406 | if (probe[index]) | 1406 | if (probe[index]) |
1407 | probe_hwif(&ide_hwifs[index]); | 1407 | probe_hwif(&ide_hwifs[index], NULL); |
1408 | for (index = 0; index < MAX_HWIFS; ++index) | 1408 | for (index = 0; index < MAX_HWIFS; ++index) |
1409 | if (probe[index]) | 1409 | if (probe[index]) |
1410 | hwif_init(&ide_hwifs[index]); | 1410 | hwif_init(&ide_hwifs[index]); |