From patchwork Thu Sep 15 02:27:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 114731 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 6A5A9B7150 for ; Thu, 15 Sep 2011 12:28:00 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1R41fi-0003ef-MD; Thu, 15 Sep 2011 02:27:26 +0000 Received: from mail-pz0-f47.google.com ([209.85.210.47]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1R41fg-0003eO-RD for kernel-team@lists.ubuntu.com; Thu, 15 Sep 2011 02:27:25 +0000 Received: by pzk2 with SMTP id 2so348631pzk.20 for ; Wed, 14 Sep 2011 19:27:23 -0700 (PDT) Received: by 10.68.19.6 with SMTP id a6mr138392pbe.165.1316053643203; Wed, 14 Sep 2011 19:27:23 -0700 (PDT) Received: from localhost ([119.136.70.70]) by mx.google.com with ESMTPS id i4sm18582920pbr.4.2011.09.14.19.27.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Sep 2011 19:27:21 -0700 (PDT) From: ming.lei@canonical.com To: kernel-team@lists.ubuntu.com Subject: [PATCH] ata: make DVD drive recognisable on systems with Sandybridge CPT chipset Date: Thu, 15 Sep 2011 10:27:11 +0800 Message-Id: <1316053631-6555-1-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.4.1 Cc: Ming Lei X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Ming Lei This quirk patch fixes one kind of bug inside Intel Sandybridge CPT chipset, see reports from LP794642, LP737388, LP758433, ... Many guys have reported the problem. With help from upstream ata maintainer Tejun[1], the problem is found to be caused by 32bit PIO mode, which is introduced in the commit below: commit 0b67c7439fe2a5d76602de36854c88e2beab00b0 Author: Tejun Heo Date: Mon Jan 11 17:03:11 2010 +0900 ata_piix: enable 32bit PIO on SATA piix Commit 871af1210f13966ab911ed2166e4ab2ce775b99d enabled 32bit PIO for PATA piix but didn't for SATA. There's no reason not to use 32bit PIO on SATA piix. Enable it. Signed-off-by: Tejun Heo Cc: Alan Cox Signed-off-by: Jeff Garzik so introduce the quirk patch to disable 32bit PIO on SATA piix for Sandybridge CPT chipset, Alan Cox has agreed on the patch[2]. SRU Justification: Impact: - without the patch, DVD drive can't be recognized on Dell optiplex 390. Fix: - After applying the patch, DVD drive can be recognized well on Dell optiplex 390. BugLink: http://bugs.launchpad.net/bugs/794642 Upstream: [1]/[2] [1], https://bugzilla.kernel.org/show_bug.cgi?id=40592 [2], http://marc.info/?t=131528297300002&r=1&w=2 Signed-off-by: Ming Lei Signed-off-by: Ming Lei Acked-by: Tim Gardner Signed-off-by: Leann Ogasawara --- drivers/ata/ata_piix.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 43107e9..eb7ea56 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c @@ -341,11 +341,12 @@ static struct ata_port_operations piix_sata_ops = { }; static struct ata_port_operations piix_pata_ops = { - .inherits = &piix_sata_ops, + .inherits = &ata_bmdma32_port_ops, .cable_detect = ata_cable_40wire, .set_piomode = piix_set_piomode, .set_dmamode = piix_set_dmamode, .prereset = piix_pata_prereset, + .sff_irq_check = piix_irq_check, }; static struct ata_port_operations piix_vmw_ops = { @@ -1585,6 +1586,15 @@ static int __devinit piix_init_one(struct pci_dev *pdev, "on poweroff and hibernation\n"); } + /* + * Sandybridge chipset H61/P67/H67 have broken 32 mode up to now + * see https://bugzilla.kernel.org/show_bug.cgi?id=40592 + */ + if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x1c00) + piix_sata_ops.inherits = &ata_bmdma_port_ops; + else + piix_sata_ops.inherits = &ata_bmdma32_port_ops; + port_info[0] = piix_port_info[ent->driver_data]; port_info[1] = piix_port_info[ent->driver_data];