From patchwork Sun May 15 20:33:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 95664 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 25577B6EEE for ; Mon, 16 May 2011 06:40:20 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753498Ab1EOUkS (ORCPT ); Sun, 15 May 2011 16:40:18 -0400 Received: from artax.karlin.mff.cuni.cz ([195.113.26.195]:54196 "EHLO artax.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753195Ab1EOUkS (ORCPT ); Sun, 15 May 2011 16:40:18 -0400 X-Greylist: delayed 467 seconds by postgrey-1.27 at vger.kernel.org; Sun, 15 May 2011 16:40:18 EDT Received: by artax.karlin.mff.cuni.cz (Postfix, from userid 17421) id E35849806F; Sun, 15 May 2011 22:33:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by artax.karlin.mff.cuni.cz (Postfix) with ESMTP id E2DEA98058; Sun, 15 May 2011 22:33:19 +0200 (CEST) Date: Sun, 15 May 2011 22:33:19 +0200 (CEST) From: Mikulas Patocka To: "David S. Miller" , Jeff Garzik cc: linux-ide@vger.kernel.org Subject: [PATCH] ATA: Don't powerdown Compaq Triflex IDE device on suspend In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-Personality-Disorder: Schizoid MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Don't powerdown Compaq Triflex IDE device on suspend This fixes APM suspend on Compaq Armada 7400. APM BIOS doesn't suspend if IDE is powered down when suspending. The Triflex controller is found only on old Compaq boards, so this patch will hopefully have no side effects. Signed-off-by: Mikulas Patocka --- drivers/ata/pata_triflex.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) -- 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: linux-2.6.39-rc7-libata/drivers/ata/pata_triflex.c =================================================================== --- linux-2.6.39-rc7-libata.orig/drivers/ata/pata_triflex.c 2011-05-09 21:04:22.000000000 +0200 +++ linux-2.6.39-rc7-libata/drivers/ata/pata_triflex.c 2011-05-15 16:13:31.000000000 +0200 @@ -210,13 +210,34 @@ static const struct pci_device_id trifle { }, }; +#ifdef CONFIG_PM +static int triflex_ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) +{ + struct ata_host *host = dev_get_drvdata(&pdev->dev); + int rc = 0; + + rc = ata_host_suspend(host, mesg); + if (rc) + return rc; + + /* + * We must not disable or powerdown the device. + * APM bios refuses to suspend if IDE is not accessible. + */ + pci_save_state(pdev); + + return 0; +} + +#endif + static struct pci_driver triflex_pci_driver = { .name = DRV_NAME, .id_table = triflex, .probe = triflex_init_one, .remove = ata_pci_remove_one, #ifdef CONFIG_PM - .suspend = ata_pci_device_suspend, + .suspend = triflex_ata_pci_device_suspend, .resume = ata_pci_device_resume, #endif };