android_kernel_xiaomi_sm8350/drivers/ide/pci
Alan Cox 5ac2469769 [PATCH] ide: backport piix fixes from libata into the legacy driver
There are three flags being set by default by the PIIX driver for speeds >
PIO 1, and one not being cleared properly on fallback to PIO0.  The most
important one is the prefetch/post write control which only works for ATA
and can do bad things with ATAPI.

The patch does its best to set the flags correctly for drivers/ide.  Its
not 100% perfect but its closer than the original.  100% perfect requires
proper IORDY handling but this isn't critical (and its not right in libata
either ..  yet)

Sergei Shtylyov <sshtylyov@ru.mvista.com> said:

> +					{ 0, 0 },
> +					{ 0, 0 },
> +					{ 1, 0 },
> +					{ 2, 1 },
> +					{ 2, 3 }, };
>
>  	pio = ide_get_best_pio_mode(drive, pio, 5, NULL);

    BTW, there's quite obvious error here which leads to access outside of
timings[] if somebody passes PIO mode 5 (or autotuning code finds out that
drive supports PIO mode 5). Could have been fixed while at it... Those drives
should be rare, though...

> +		}
>  		master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8);
>  	}
>  	pci_write_config_word(dev, master_port, master_data);

    Actually, there's one more serious issue with piix_tune_drive() -- it
doesn't actually set the drive's own transfer mode.

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-03 08:04:08 -07:00
..
aec62xx.c [PATCH] Fix 2.6.18-rc6 IDE breakage, add missing ident needed for current VIA boards 2006-09-11 07:53:44 -07:00
alim15x3.c [PATCH] alim15x3.c: M5229 (rev c8) support for DMA cd-writer 2006-09-13 07:32:14 -07:00
amd74xx.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
atiixp.c [PATCH] atiixp: ATI SB600 IDE support for various modes 2006-09-29 09:18:12 -07:00
cmd64x.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cmd640.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cs5520.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cs5530.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cs5535.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cy82c693.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
generic.c [PATCH] PATCH: 2.6.18 oops on boot fix for IDE 2006-08-09 15:43:27 -07:00
hpt34x.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
hpt366.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
it821x.c [PATCH] it821x: fix ide dma setup bug 2006-07-28 09:02:17 +02:00
it8172.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
jmicron.c [PATCH] non-libata driver for Jmicron devices 2006-10-03 08:04:07 -07:00
Makefile [PATCH] non-libata driver for Jmicron devices 2006-10-03 08:04:07 -07:00
ns87415.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
opti621.c
pdc202xx_new.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
pdc202xx_old.c [PATCH] Enable cdrom dma access with pdc20265_old 2006-10-03 08:04:07 -07:00
piix.c [PATCH] ide: backport piix fixes from libata into the legacy driver 2006-10-03 08:04:08 -07:00
rz1000.c
sc1200.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
serverworks.c [PATCH] serverworks: Switch to pci refcounted interfaces 2006-10-01 00:39:20 -07:00
sgiioc4.c [PATCH] sgiioc4: fixup use of mmio ops 2006-09-01 11:39:10 -07:00
siimage.c [PATCH] Fix 2.6.18-rc6 IDE breakage, add missing ident needed for current VIA boards 2006-09-11 07:53:44 -07:00
sis5513.c [PATCH] sis5513: Switch to pci refcounting 2006-10-01 00:39:20 -07:00
sl82c105.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
slc90e66.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
triflex.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
trm290.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
via82cxxx.c [PATCH] Missing PCI id update for VIA IDE 2006-08-30 16:05:16 -07:00