: Save MSI state before suspend.
Subsystems (2)
PATCH 1/8 : Save MSI state before suspend.
[TG3]: Save MSI state before suspend.
This fixes the following problem:
http://bugzilla.kernel.org/show_bug.cgi?id=7969
The MSI state needs to be saved during suspend. PCI state saved during tg3_init_one() does not contain valid MSI state because MSI hasn't been enabled.
drivers/net/tg3.c +3 -0
@@ -12016,6 +12016,9 @@ static int tg3_suspend(struct pci_dev *p tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE ;tg3_full_unlock (tp); +/* Save MSI address and data for resume. */ +pci_save_state (pdev); + err =tg3_set_power_state (tp,pci_choose_state (pdev, state));if (err) {tg3_full_lock (tp,0 );
Quoted 11 lines · Michael Chan
[TG3]: Save MSI state before suspend.
This fixes the following problem:
http://bugzilla.kernel.org/show_bug.cgi?id=7969
The MSI state needs to be saved during suspend. PCI state saved during
tg3_init_one()does not contain valid MSI state because MSI hasn't been enabled.Signed-off-by Michael Chan <[email protected]>
I'm curious if, after this patch is applied, all the pci_save_state() calls are truly necessary?
Jeff
Quoted 4 lines · Jeff Garzik
I'm curious if, after this patch is applied, all the
pci_save_state()calls are truly necessary?
The others are necessary to save/restore the memory enable bit in the PCI command register. This bit gets reset after chip reset.
Quoted 4 lines · On Tue, 13 Feb 2007 12:13:32 -0800 "Michael Chan" <[email protected]> wrote:
[TG3]: Save MSI state before suspend.
This fixes the following problem:
Quoted 8 lines
http://bugzilla.kernel.org/show_bug.cgi?id=7969
The MSI state needs to be saved during suspend. PCI state saved during
tg3_init_one()does not contain valid MSI state because MSI hasn't been enabled.Signed-off-by Michael Chan <[email protected]>
I think you have to move the original pci_save_state call, otherwise you will call pci_save_state twice and leak memory. pci_save_state allocates memory to store MSI and other information. Look at pci_save_pcie_state etc.
Signature · 1 line
Stephen Hemminger <[email protected]>
Quoted 4 lines · Stephen Hemminger
I think you have to move the original
pci_save_statecall, otherwise you will callpci_save_statetwice and leak memory.pci_save_stateallocates memory to store MSI and other information. Look atpci_save_pcie_stateetc.
That's a bug in the PCI layer. Patches welcome...
Jeff
Quoted 6 lines · Stephen Hemminger
I think you have to move the original
pci_save_statecall, otherwise you will callpci_save_statetwice and leak memory.pci_save_stateallocates memory to store MSI and other information. Look atpci_save_pcie_stateetc.
I think it is ok the way it is. We call pci_restore_state() at least once during tg3_chip_reset(). This will free any memory allocated during tg3_init_one()'s call to pci_save_state(), before we even get to tg3_suspend().
The memory allocated in tg3_suspend()'s call to pci_save_state() will be freed when tg3_resume() calls pci_restore_state().
From: "Michael Chan" <[email protected]>
Date: Tue, 13 Feb 2007 12:13:32 -0800
Quoted 11 lines
[TG3]: Save MSI state before suspend.
This fixes the following problem:
http://bugzilla.kernel.org/show_bug.cgi?id=7969
The MSI state needs to be saved during suspend. PCI state saved during
tg3_init_one()does not contain valid MSI state because MSI hasn't been enabled.Signed-off-by Michael Chan <[email protected]>
Applied.