From patchwork Sun Oct 23 05:05:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Schilling X-Patchwork-Id: 121209 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 9DCF0B6F85 for ; Sun, 23 Oct 2011 17:04:52 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752716Ab1JWGEs (ORCPT ); Sun, 23 Oct 2011 02:04:48 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:61130 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751484Ab1JWGEr (ORCPT ); Sun, 23 Oct 2011 02:04:47 -0400 Received: by yxl42 with SMTP id 42so2344445yxl.19 for ; Sat, 22 Oct 2011 23:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=sg1AVLaups1yyL0PGNVk3JpRZWOQhCLnNDUVwD0imqM=; b=YeXf05/92z4lqaWyf3DOTkzlrSSp9nOl3Ak/xnz5fdb1cFcUq40ff5U6Hhkb0ybS/i viigprInYxK4rbncpAn/8w9enQDxW/t8h+8dx0tFPxqCX4tsntW+mvm3tHKV31VsIJck 3InHO1rVtj4kqTk5FmLNykGGADIwZdxJAwqT0= Received: by 10.236.173.165 with SMTP id v25mr29032934yhl.22.1319346314921; Sat, 22 Oct 2011 22:05:14 -0700 (PDT) Received: from localhost.localdomain (71-83-41-0.dhcp.dlth.mn.charter.com. [71.83.41.0]) by mx.google.com with ESMTPS id z28sm26754134yhl.4.2011.10.22.22.05.13 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Oct 2011 22:05:14 -0700 (PDT) From: Paul Schilling To: Jeff Garzik , "David S. Miller" , Jesse Barnes , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Paul Schilling , Paul Schilling Subject: [PATCH 02/15] ATA : vortex86 : fix vortex86dx/sx hardware CRC bug. Date: Sun, 23 Oct 2011 00:05:00 -0500 Message-Id: <1319346300-18151-1-git-send-email-paul.s.schilling@gmail.com> X-Mailer: git-send-email 1.7.6.4 In-Reply-To: References: Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This fixes a DMA issue related to a CRC bug on the RDC pata peripherial found on the vortex86sx and vortex86dx. Signed-off-by: Paul Schilling --- drivers/ata/pata_it821x.c | 22 ++++++++++++++++++---- drivers/ata/pata_rdc.c | 29 ++++++++++++++++++++++++----- drivers/ide/it821x.c | 9 +++++++-- include/linux/pci_ids.h | 2 ++ 4 files changed, 51 insertions(+), 11 deletions(-) diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index c5532b9..5f8a54a 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c @@ -897,7 +897,16 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) static const struct ata_port_info info_rdc_11 = { .flags = ATA_FLAG_SLAVE_POSS, .pio_mask = ATA_PIO4, - .mwdma_mask = ATA_MWDMA2, + .mwdma_mask = 0, + .udma_mask = 0, + /* No UDMA */ + .port_ops = &it821x_rdc_port_ops + }; + static const struct ata_port_info info_rdc_01 = { + .flags = ATA_FLAG_SLAVE_POSS, + .pio_mask = ATA_PIO4, + .mwdma_mask = 0, + .udma_mask = 0, /* No UDMA */ .port_ops = &it821x_rdc_port_ops }; @@ -911,11 +920,16 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) return rc; if (pdev->vendor == PCI_VENDOR_ID_RDC) { - /* Deal with Vortex86SX */ - if (pdev->revision == 0x11) + if (((pdev->revision == 0x11) || (pdev->revision == 0x13)) && + (pdev->device == PCI_DEVICE_ID_RDC_D1010)) { + /* Deal with Vortex86SX */ ppi[0] = &info_rdc_11; - else + printk(KERN_INFO DRV_NAME + ": Detected Vortex86SX/DX Bug.\n"); + printk(KERN_INFO DRV_NAME ": Disabling UDMA.\n"); + } else { ppi[0] = &info_rdc; + } } else { /* Force the card into bypass mode if so requested */ if (it8212_noraid) { diff --git a/drivers/ata/pata_rdc.c b/drivers/ata/pata_rdc.c index 2b38127..441521c 100644 --- a/drivers/ata/pata_rdc.c +++ b/drivers/ata/pata_rdc.c @@ -290,6 +290,16 @@ static struct ata_port_info rdc_port_info = { .port_ops = &rdc_pata_ops, }; +static struct ata_port_info vortex_port_info = { + .flags = ATA_FLAG_SLAVE_POSS, + .pio_mask = ATA_PIO4, + .mwdma_mask = 0, + .udma_mask = 0, + /* No UDMA */ + .port_ops = &rdc_pata_ops, +}; + + static struct scsi_host_template rdc_sht = { ATA_BMDMA_SHT(DRV_NAME), }; @@ -322,16 +332,25 @@ static int __devinit rdc_init_one(struct pci_dev *pdev, ata_print_version_once(&pdev->dev, DRV_VERSION); - port_info[0] = rdc_port_info; - port_info[1] = rdc_port_info; - - port_flags = port_info[0].flags; - /* enable device and prepare host */ rc = pcim_enable_device(pdev); if (rc) return rc; + if ((pdev->revision == 0x01) && + (pdev->device == PCI_DEVICE_ID_RDC_D1011)) { + /* Deal with Vortex86DX */ + port_info[0] = vortex_port_info; + port_info[1] = vortex_port_info; + printk(KERN_INFO DRV_NAME ": Detected Vortex86DX Bug.\n"); + printk(KERN_INFO DRV_NAME ": Disabling UDMA.\n"); + } else { + port_info[0] = rdc_port_info; + port_info[1] = rdc_port_info; + } + + port_flags = port_info[0].flags; + hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL); if (!hpriv) return -ENOMEM; diff --git a/drivers/ide/it821x.c b/drivers/ide/it821x.c index 2e3169f..82c6bc7 100644 --- a/drivers/ide/it821x.c +++ b/drivers/ide/it821x.c @@ -581,10 +581,14 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif) hwif->ultra_mask = ATA_UDMA6; hwif->mwdma_mask = ATA_MWDMA2; - /* Vortex86SX quirk: prevent Ultra-DMA mode to fix BadCRC issue */ + /* Vortex86SX and Vortex86DX quirk: prevent + * Ultra-DMA mode to fix BadCRC issue when + * using DMA mode */ if (idev->quirks & QUIRK_VORTEX86) { - if (dev->revision == 0x11) + if (((dev->revision == 0x11) || (dev->revision == 0x13)) + || (dev->revision == 0x01)) { hwif->ultra_mask = 0; + } } } @@ -680,6 +684,7 @@ static const struct pci_device_id it821x_pci_tbl[] = { { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), 0 }, { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), 0 }, { PCI_VDEVICE(RDC, PCI_DEVICE_ID_RDC_D1010), QUIRK_VORTEX86 }, + { PCI_VDEVICE(RDC, PCI_DEVICE_ID_RDC_D1011), QUIRK_VORTEX86 }, { 0, }, }; diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ae96bbe..237da92 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2259,6 +2259,8 @@ #define PCI_DEVICE_ID_RDC_R6060 0x6060 #define PCI_DEVICE_ID_RDC_R6061 0x6061 #define PCI_DEVICE_ID_RDC_D1010 0x1010 +#define PCI_DEVICE_ID_RDC_D1011 0x1011 +#define PCI_DEVICE_ID_RDC_D1012 0x1012 #define PCI_VENDOR_ID_LENOVO 0x17aa