From patchwork Thu Aug 4 09:15:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 108387 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 68BF7B6F75 for ; Thu, 4 Aug 2011 19:15:14 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752817Ab1HDJPM (ORCPT ); Thu, 4 Aug 2011 05:15:12 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:42912 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751675Ab1HDJPM (ORCPT ); Thu, 4 Aug 2011 05:15:12 -0400 Received: by fxh19 with SMTP id 19so1547726fxh.19 for ; Thu, 04 Aug 2011 02:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=jCPEK4+xZTz2C4yvYjH0KpKksucR2bBmUqRVSaVE1+8=; b=pSuJ+LhctpiBiFA6NYEhWo8o/R+6lSlljWJzwzWZQaheTv9Kw9d74XDcefwIV2N1qC cX1oKvgK8CNtd3ruCJpprIU6G1ygLOMCIookOio1rx82/aOQJ6o5CxxPDEIQ1+Uao7Cn RFfiwBnoU1FccFw61uSUWQouVty9W9CowN4kk= Received: by 10.204.136.17 with SMTP id p17mr186720bkt.3.1312449310561; Thu, 04 Aug 2011 02:15:10 -0700 (PDT) Received: from htj.dyndns.org ([130.75.117.88]) by mx.google.com with ESMTPS id l12sm43102bkk.63.2011.08.04.02.15.09 (version=SSLv3 cipher=OTHER); Thu, 04 Aug 2011 02:15:09 -0700 (PDT) Date: Thu, 4 Aug 2011 11:15:07 +0200 From: Tejun Heo To: Jeff Garzik , Jim Bray Cc: linux-ide@vger.kernel.org, Alan Cox Subject: [PATCH #upstream-fixes] pata_via: disable ATAPI DMA on AVERATEC 3200 Message-ID: <20110804091507.GB25100@htj.dyndns.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org 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 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=11426 Reported-and-tested-by: Jim Bray Cc: Alan Cox Cc: stable@kernel.org --- drivers/ata/pata_via.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 65e4be6..8e9f504 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c @@ -124,6 +124,17 @@ static const struct via_isa_bridge { { NULL } }; +static const struct dmi_system_id no_atapi_dma_dmi_table[] = { + { + .ident = "AVERATEC 3200", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "AVERATEC"), + DMI_MATCH(DMI_BOARD_NAME, "3200"), + }, + }, + { } +}; + struct via_port { u8 cached_device; }; @@ -355,6 +366,13 @@ static unsigned long via_mode_filter(struct ata_device *dev, unsigned long mask) mask &= ~ ATA_MASK_UDMA; } } + + if (dev->class == ATA_DEV_ATAPI && + dmi_check_system(no_atapi_dma_dmi_table)) { + ata_dev_warn(dev, "controller locks up on ATAPI DMA, forcing PIO\n"); + mask &= ATA_MASK_PIO; + } + return mask; }