Commit 171a9318 authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Damien Le Moal

ata: pata_legacy: fix pdc20230_set_piomode()

Clang gives a warning when compiling pata_legacy.c with 'make W=1' about
the 'rt' local variable in pdc20230_set_piomode() being set but unused.
Quite obviously, there is an outb() call missing to write back the updated
variable. Moreover, checking the docs by Petr Soucek revealed that bitwise
AND should have been done with a negated timing mask and the master/slave
timing masks were swapped while updating...

Fixes: 669a5db4 ("[libata] Add a bunch of PATA drivers.")
Reported-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent 2ce3a0bf
...@@ -315,9 +315,10 @@ static void pdc20230_set_piomode(struct ata_port *ap, struct ata_device *adev) ...@@ -315,9 +315,10 @@ static void pdc20230_set_piomode(struct ata_port *ap, struct ata_device *adev)
outb(inb(0x1F4) & 0x07, 0x1F4); outb(inb(0x1F4) & 0x07, 0x1F4);
rt = inb(0x1F3); rt = inb(0x1F3);
rt &= 0x07 << (3 * adev->devno); rt &= ~(0x07 << (3 * !adev->devno));
if (pio) if (pio)
rt |= (1 + 3 * pio) << (3 * adev->devno); rt |= (1 + 3 * pio) << (3 * !adev->devno);
outb(rt, 0x1F3);
udelay(100); udelay(100);
outb(inb(0x1F2) | 0x01, 0x1F2); outb(inb(0x1F2) | 0x01, 0x1F2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment