Skip to contentSkip to conversation

Make suspend/resume work with ich chipset in force AHCI mode

PATCH In review Joerg Dorchain 2 participants 2 messages Feb 16, 2011 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make suspend/resume work with ich chipset in force AHCI mode

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

drivers/ata/ahci.c renamed from drivers/ata/ahci.c.orig +5 -0
@@ -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;
#1 lore raw

Hello.

Quoted 4 lines · Joerg Dorchain

Hello all,

this patch in needed in addition to the previous one make suspend/resume work in the forced ahci mode.

This remark should probably follow --- tear line (after the signoff).

Quoted 12 lines

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.

Quoted 3 lines

Bye,

Joerg

"Hello" and "bye" shouldn't be the part of the patch description.

Quoted 1 line

Need space before the email address.

WBR, Sergei