Skip to content

Commit e13ee54

Browse files
bzolnierdavem330
authored andcommitted
sis5513: fix PIO setup for ATAPI devices
Clear prefetch setting before potentially (re-)enabling it in config_drive_art_rwp() so the transition of the device type on the port from ATA to ATAPI (i.e. during warm-plug operation) is handled correctly. This is a really old bug (it probably goes back to very early days of the driver) but it was only affecting warm-plug operation until the recent "ide: try to use PIO Mode 0 during probe if possible" change (commit 6029336). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Tested-by: David Fries <david@fries.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 24df31a commit e13ee54

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎drivers/ide/sis5513.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org>
33
* Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer
44
* Copyright (C) 2003 Vojtech Pavlik <vojtech@suse.cz>
5-
* Copyright (C) 2007 Bartlomiej Zolnierkiewicz
5+
* Copyright (C) 2007-2009 Bartlomiej Zolnierkiewicz
66
*
77
* May be copied or modified under the terms of the GNU General Public License
88
*
@@ -281,11 +281,13 @@ static void config_drive_art_rwp(ide_drive_t *drive)
281281

282282
pci_read_config_byte(dev, 0x4b, &reg4bh);
283283

284+
rw_prefetch = reg4bh & ~(0x11 << drive->dn);
285+
284286
if (drive->media == ide_disk)
285-
rw_prefetch = 0x11 << drive->dn;
287+
rw_prefetch |= 0x11 << drive->dn;
286288

287-
if ((reg4bh & (0x11 << drive->dn)) != rw_prefetch)
288-
pci_write_config_byte(dev, 0x4b, reg4bh|rw_prefetch);
289+
if (reg4bh != rw_prefetch)
290+
pci_write_config_byte(dev, 0x4b, rw_prefetch);
289291
}
290292

291293
static void sis_set_pio_mode(ide_drive_t *drive, const u8 pio)

0 commit comments

Comments
 (0)