From patchwork Wed Feb 16 09:07:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Dorchain X-Patchwork-Id: 83347 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 05E5DB70EA for ; Wed, 16 Feb 2011 20:07:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758724Ab1BPJHO (ORCPT ); Wed, 16 Feb 2011 04:07:14 -0500 Received: from RedStar.dorchain.net ([212.88.133.153]:50395 "EHLO Redstar.dorchain.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758737Ab1BPJHL (ORCPT ); Wed, 16 Feb 2011 04:07:11 -0500 Received: from Redstar.dorchain.net (localhost [127.0.0.1]) by Redstar.dorchain.net (8.14.4/8.14.3) with ESMTP id p1G9796X019809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 16 Feb 2011 10:07:09 +0100 X-DKIM: OpenDKIM Filter v2.1.3 Redstar.dorchain.net p1G9796X019809 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dorchain.net; s=redstar; t=1297847229; bh=SODsiv4elJ/3H44Lpta6FsXRsDULN8ZRy58E71noXKk=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=lc3znVC1pxKaa9PFVl34+OcqB+CF9Uzdj1hx0Wj3Y19obk8iSMsrheUqgI7UYJm1o Zot3mLqgRV5u8TYFBF3x8v/6Mg+5KSU72RtPlaA26gRfHNnEOelXf1TUiQ682hCV+Y spuE2fPKbkYr653uZd7ReFUaJARJynO0F7/dsKlc= Received: (from joerg@localhost) by Redstar.dorchain.net (8.14.4/8.13.8/Submit) id p1G979TK019808 for linux-ide@vger.kernel.org; Wed, 16 Feb 2011 10:07:09 +0100 Date: Wed, 16 Feb 2011 10:07:09 +0100 From: Joerg Dorchain To: linux-ide@vger.kernel.org Subject: [Patch] Make suspend/resume work with ich chipset in force AHCI mode Message-ID: <20110216090709.GR5778@Redstar.dorchain.net> MIME-Version: 1.0 Content-Disposition: inline X-message-flag: Please send messages in plain text only. Thanks! X-Bindford: 6200 (more Power!) X-Ray: beware User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.96.5 at Redstar X-Virus-Status: Clean Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Hello all, this patch in needed in addition to the previous one make suspend/resume work in the forced ahci mode. During resume from suspend to ram, the kernel pci layer restores the registers for the SATA controller once, then says okay, and sets dev->state_saved = false. However, since the restore goes from highest address (the BARs [base address registers]) to lowest register, some of the higher registers are set as RO because according to the lower registers controller is in PIIX mode. This patch introduces a workaround for this problem, hacking around the PCI API by setting pdev->state_saved = true before we do the restore, basically leaving the pci config space untouched. Bye, Joerg Signed-off-by: joerg Dorchain --- linux/drivers/ata/ahci.c.orig 2011-02-04 18:13:33.000000000 +0100 +++ linux/drivers/ata/ahci.c 2011-02-11 13:45:22.000000000 +0100 @@ -640,6 +640,11 @@ struct ata_host *host = dev_get_drvdata(&pdev->dev); int rc; + /* + * override check to see if PCI config space is already + * restored in pci_restore_state + */ + pdev->state_saved = true; rc = ata_pci_device_do_resume(pdev); if (rc) return rc;