From patchwork Wed Nov 25 17:09:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 39363 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.176.167]) by ozlabs.org (Postfix) with ESMTP id B6C91B7067 for ; Thu, 26 Nov 2009 04:22:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759366AbZKYRK0 (ORCPT ); Wed, 25 Nov 2009 12:10:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759360AbZKYRKX (ORCPT ); Wed, 25 Nov 2009 12:10:23 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:39574 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758890AbZKYRKU (ORCPT ); Wed, 25 Nov 2009 12:10:20 -0500 Received: by ewy19 with SMTP id 19so601003ewy.21 for ; Wed, 25 Nov 2009 09:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=pFZc0dIEAcFBapMb9807inECIm3vaz2ntJGXz+m7AuE=; b=vVm6HK1wTwaR/Jdw+4bbffze+k29clP1EbesbdOZcE503gFGyEpYpJLhr+oN4LK4p1 8gF77tGTGgAEfI2ZVs3I/jZZ5qRo7A/jHqU9qqXmWojFaAgThanjmsgi5r/TXUK054cN J3WQCz9B5JDpxS9AceY9q2PAhILwp0hSVfOW8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=NcK+c6j1mi5pjKJht5N3yvjthUPOtsaBPfNG/glrc31SeSdpF807V23xy/ck1tP0zz np7MPf5q+jThHNVUVsLD3Fj7L25lIZyijyXTdiP7iEY9+B6AACGopzinRSD/gyrjxZyR 8EzFzbXsUB3xY5mVy8eUGCfikC8GRDiGvm88o= Received: by 10.216.87.133 with SMTP id y5mr2542561wee.139.1259169025199; Wed, 25 Nov 2009 09:10:25 -0800 (PST) Received: from ?127.0.0.1? (chello089079027028.chello.pl [89.79.27.28]) by mx.google.com with ESMTPS id q9sm14667090gve.15.2009.11.25.09.10.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 25 Nov 2009 09:10:24 -0800 (PST) From: Bartlomiej Zolnierkiewicz To: linux-ide@vger.kernel.org Cc: Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org Date: Wed, 25 Nov 2009 18:09:40 +0100 Message-Id: <20091125170940.5446.67928.sendpatchset@localhost> In-Reply-To: <20091125170218.5446.13513.sendpatchset@localhost> References: <20091125170218.5446.13513.sendpatchset@localhost> Subject: [PATCH 61/86] pata_sis: Power Management fix Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Bartlomiej Zolnierkiewicz Subject: [PATCH] pata_pdc202xx_old: Power Management fix Enable burst mode on resume for PDC2026x controllers. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ata/pata_pdc202xx_old.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) -- 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 Index: b/drivers/ata/pata_pdc202xx_old.c =================================================================== --- a/drivers/ata/pata_pdc202xx_old.c +++ b/drivers/ata/pata_pdc202xx_old.c @@ -232,14 +232,21 @@ static void pdc2026x_dev_config(struct a adev->max_sectors = 256; } -static int pdc2026x_port_start(struct ata_port *ap) +static void pdc2026x_bmdma_enable_burst(struct ata_port *ap) { void __iomem *bmdma = ap->ioaddr.bmdma_addr; + if (bmdma) { /* Enable burst mode */ u8 burst = ioread8(bmdma + 0x1f); iowrite8(burst | 0x01, bmdma + 0x1f); } +} + +static int pdc2026x_port_start(struct ata_port *ap) +{ + pdc2026x_bmdma_enable_burst(ap); + return ata_sff_port_start32(ap); } @@ -327,6 +334,28 @@ static int pdc202xx_init_one(struct pci_ return ata_pci_sff_init_one(dev, ppi, &pdc202xx_sht, NULL); } +#ifdef CONFIG_PM +static int pdc202xx_reinit_one(struct pci_dev *pdev) +{ + struct ata_host *host = dev_get_drvdata(&pdev->dev); + int rc, i; + + rc = ata_pci_device_do_resume(pdev); + if (rc) + return rc; + + for (i = 0; i < host->n_ports; i++) { + struct ata_port *ap = host->ports[i]; + + if (ap->udma_mask > ATA_UDMA2) + pdc2026x_bmdma_enable_burst(ap); + } + + ata_host_resume(host); + return 0; +} +#endif + static const struct pci_device_id pdc202xx[] = { { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20246), 0 }, { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20262), 1 }, @@ -344,7 +373,7 @@ static struct pci_driver pdc202xx_pci_dr .remove = ata_pci_remove_one, #ifdef CONFIG_PM .suspend = ata_pci_device_suspend, - .resume = ata_pci_device_resume, + .resume = pdc202xx_reinit_one, #endif };