android_kernel_xiaomi_sm8350/drivers/ide
Bartlomiej Zolnierkiewicz 6f5050a96c ide: don't allow DMA to be enabled if CONFIG_IDEDMA_{ICS,PCI}_AUTO=n
For CONFIG_IDEDMA_{ICS,PCI}_AUTO=n and/or "ide=nodma" option the host/device
are not programmed for DMA and it is also explicitly disabled by ide_set_dma()
(->ide_dma_check returns "-1").  However the code responsible for manually
enabling DMA ("hdparm -d 1") has a bug which results in DMA being erroneously
enabled - ide_set_dma() incorrectly passes "0" return value to set_using_dma().
This may work if BIOS/firmware configured the host/device for DMA and chipset
allows independent configuration of DMA/PIO modes but won't work after suspend
and is generally unsafe on many chipsets (possibly including data corruption
if the same registers are used for DMA/PIO timings).

This patch fixes kernel bugzilla bug #8169 (piix host driver fixes for
setting PIO mode exposed the problem described above).  The side-effect of
the fix is that some rare configuration may be forced to PIO mode when DMA
mode was previously used - this is addressed by the next patch which removes
CONFIG_IDEDMA_{PCI,ICS}_AUTO config option completely.

Thanks goes out to Patrick Horn for reporting the issue, narrowing it down
to the specific commit and testing the fix.  Also thanks to Sergei Shtylyov
for help in debugging the problem.

Cc: Patrick Horn <phrh@yahoo.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-03-17 21:57:39 +01:00
..
arm ide: make ide_hwif_t.ide_dma_host_on void (v2) 2007-02-17 02:40:26 +01:00
cris ide: remove a ton of pointless #undef REALLY_SLOW_IO 2007-03-03 17:48:54 +01:00
h8300 ide: convert ide_hwif_t.mmio into flag (v2) 2007-02-17 02:40:25 +01:00
legacy ide: make legacy IDE VLB modules check for the "probe" kernel params (v2) 2007-03-03 17:48:55 +01:00
mips ide: au1xxx: fix use of mixed declarations and code 2007-03-17 21:57:24 +01:00
pci scc_pata: dependency fix 2007-03-17 21:57:25 +01:00
ppc scc_pata: dependency fix 2007-03-17 21:57:25 +01:00
ide-acpi.c ide-acpi support warning fix 2007-02-07 18:19:42 +01:00
ide-cd.c ide: make ide_hwif_t.ide_dma_{host_off,off_quietly} void (v2) 2007-02-17 02:40:26 +01:00
ide-cd.h
ide-disk.c ide: remove a ton of pointless #undef REALLY_SLOW_IO 2007-03-03 17:48:54 +01:00
ide-dma.c ide: don't allow DMA to be enabled if CONFIG_IDEDMA_{ICS,PCI}_AUTO=n 2007-03-17 21:57:39 +01:00
ide-floppy.c ide: make ide_hwif_t.ide_dma_{host_off,off_quietly} void (v2) 2007-02-17 02:40:26 +01:00
ide-generic.c
ide-io.c ide: make ide_hwif_t.ide_dma_{host_off,off_quietly} void (v2) 2007-02-17 02:40:26 +01:00
ide-iops.c ide: fix drive side 80c cable check, take 2 2007-03-03 17:48:53 +01:00
ide-lib.c ide: ide_get_best_pio_mode() returns incorrect IORDY setting (take 2) 2007-03-03 17:48:53 +01:00
ide-pnp.c
ide-probe.c ide: remove a ton of pointless #undef REALLY_SLOW_IO 2007-03-03 17:48:54 +01:00
ide-proc.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
ide-tape.c ide: make ide_hwif_t.ide_dma_{host_off,off_quietly} void (v2) 2007-02-17 02:40:26 +01:00
ide-taskfile.c
ide-timing.h
ide.c ide: make legacy IDE VLB modules check for the "probe" kernel params (v2) 2007-03-03 17:48:55 +01:00
Kconfig scc_pata: dependency fix 2007-03-17 21:57:25 +01:00
Makefile scc_pata: dependency fix 2007-03-17 21:57:25 +01:00
setup-pci.c PCI: add the sysfs driver name to all modules 2007-02-07 10:37:12 -08:00