Skip to content

Commit 6d0e194

Browse files
htejunjgarzik
authored andcommitted
pata_via: disable ATAPI DMA on AVERATEC 3200
On AVERATEC 3200, pata_via causes memory corruption with ATAPI DMA, which often leads to random kernel oops. The cause of the problem is not well understood yet and only small subset of machines using the controller seem affected. Blacklist ATAPI DMA on the machine. Signed-off-by: Tejun Heo <tj@kernel.org> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=11426 Reported-and-tested-by: Jim Bray <jimsantelmo@gmail.com> Cc: Alan Cox <alan@linux.intel.com> Cc: stable@kernel.org Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
1 parent ebd1699 commit 6d0e194

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎drivers/ata/pata_via.c‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,17 @@ static const struct via_isa_bridge {
124124
{ NULL }
125125
};
126126

127+
static const struct dmi_system_id no_atapi_dma_dmi_table[] = {
128+
{
129+
.ident = "AVERATEC 3200",
130+
.matches = {
131+
DMI_MATCH(DMI_BOARD_VENDOR, "AVERATEC"),
132+
DMI_MATCH(DMI_BOARD_NAME, "3200"),
133+
},
134+
},
135+
{ }
136+
};
137+
127138
struct via_port {
128139
u8 cached_device;
129140
};
@@ -355,6 +366,13 @@ static unsigned long via_mode_filter(struct ata_device *dev, unsigned long mask)
355366
mask &= ~ ATA_MASK_UDMA;
356367
}
357368
}
369+
370+
if (dev->class == ATA_DEV_ATAPI &&
371+
dmi_check_system(no_atapi_dma_dmi_table)) {
372+
ata_dev_warn(dev, "controller locks up on ATAPI DMA, forcing PIO\n");
373+
mask &= ATA_MASK_PIO;
374+
}
375+
358376
return mask;
359377
}
360378

0 commit comments

Comments
 (0)