Skip to content

Commit 0eb0969

Browse files
author
Linus Torvalds
committed
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: libata clear horkage on ata_dev_init() [libata, IDE] add new VIA bridge to VIA PATA drivers pata_it821x: fix lost interrupt with atapi devices Fix broken pata_via cable detection
2 parents 980abe2 + 3dcc323 commit 0eb0969

5 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎drivers/ata/libata-core.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6035,6 +6035,7 @@ void ata_dev_init(struct ata_device *dev)
60356035
*/
60366036
spin_lock_irqsave(ap->lock, flags);
60376037
dev->flags &= ~ATA_DFLAG_INIT_MASK;
6038+
dev->horkage = 0;
60386039
spin_unlock_irqrestore(ap->lock, flags);
60396040

60406041
memset((void *)dev + ATA_DEVICE_CLEAR_OFFSET, 0,

‎drivers/ata/pata_it821x.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,10 @@ static int it821x_check_atapi_dma(struct ata_queued_cmd *qc)
533533
struct ata_port *ap = qc->ap;
534534
struct it821x_dev *itdev = ap->private_data;
535535

536+
/* Only use dma for transfers to/from the media. */
537+
if (qc->nbytes < 2048)
538+
return -EOPNOTSUPP;
539+
536540
/* No ATAPI DMA in smart mode */
537541
if (itdev->smart)
538542
return -EOPNOTSUPP;

‎drivers/ata/pata_via.c‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ static const struct via_isa_bridge {
9797
u8 rev_max;
9898
u16 flags;
9999
} via_isa_bridges[] = {
100+
{ "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
100101
{ "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
101102
{ "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
102103
{ "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
@@ -243,7 +244,6 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
243244
int ut;
244245
int offset = 3 - (2*ap->port_no) - adev->devno;
245246

246-
247247
/* Calculate the timing values we require */
248248
ata_timing_compute(adev, mode, &t, T, UT);
249249

@@ -290,9 +290,17 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
290290
ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07;
291291
break;
292292
}
293+
293294
/* Set UDMA unless device is not UDMA capable */
294-
if (udma_type)
295-
pci_write_config_byte(pdev, 0x50 + offset, ut);
295+
if (udma_type) {
296+
u8 cable80_status;
297+
298+
/* Get 80-wire cable detection bit */
299+
pci_read_config_byte(pdev, 0x50 + offset, &cable80_status);
300+
cable80_status &= 0x10;
301+
302+
pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
303+
}
296304
}
297305

298306
static void via_set_piomode(struct ata_port *ap, struct ata_device *adev)

‎drivers/ide/pci/via82cxxx.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ static struct via_isa_bridge {
7474
u8 udma_mask;
7575
u8 flags;
7676
} via_isa_bridges[] = {
77+
{ "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
7778
{ "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
7879
{ "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
7980
{ "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },

‎include/linux/pci_ids.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,7 @@
13431343
#define PCI_DEVICE_ID_VIA_8231_4 0x8235
13441344
#define PCI_DEVICE_ID_VIA_8365_1 0x8305
13451345
#define PCI_DEVICE_ID_VIA_CX700 0x8324
1346+
#define PCI_DEVICE_ID_VIA_VX800 0x8353
13461347
#define PCI_DEVICE_ID_VIA_8371_1 0x8391
13471348
#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
13481349
#define PCI_DEVICE_ID_VIA_838X_1 0xB188

0 commit comments

Comments
 (0)