Patch "ata: pata_legacy: fix pdc20230_set_piomode()" has been added to the 4.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ata: pata_legacy: fix pdc20230_set_piomode()

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ata-pata_legacy-fix-pdc20230_set_piomode.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit dcc0d6654ee44226765d50f1ac13fe79f4ef39a7
Author: Sergey Shtylyov <s.shtylyov@xxxxxx>
Date:   Sat Oct 29 00:07:06 2022 +0300

    ata: pata_legacy: fix pdc20230_set_piomode()
    
    [ Upstream commit 171a93182eccd6e6835d2c86b40787f9f832efaa ]
    
    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: 669a5db411d8 ("[libata] Add a bunch of PATA drivers.")
    Reported-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sergey Shtylyov <s.shtylyov@xxxxxx>
    Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 55fcdb798002..e4071768333d 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -292,9 +292,10 @@ static void pdc20230_set_piomode(struct ata_port *ap, struct ata_device *adev)
 	outb(inb(0x1F4) & 0x07, 0x1F4);
 
 	rt = inb(0x1F3);
-	rt &= 0x07 << (3 * adev->devno);
+	rt &= ~(0x07 << (3 * !adev->devno));
 	if (pio)
-		rt |= (1 + 3 * pio) << (3 * adev->devno);
+		rt |= (1 + 3 * pio) << (3 * !adev->devno);
+	outb(rt, 0x1F3);
 
 	udelay(100);
 	outb(inb(0x1F2) | 0x01, 0x1F2);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux