Skip to contentSkip to conversation

ricoh_mmc: Use suspend_late/resume_early

PATCH In review [email protected] 3 participants 5 messages Jan 18, 2009 – Jan 25, 2009 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ricoh_mmc: Use suspend_late/resume_early

If ricoh_mmc suspends before sdhci_pci, it will pull the card out from under the controller, which could leave the system in a very confused state.

Using suspend_late/resume_early ensures that sdhci_pci suspends first and resumes second.

---

 ricoh_mmc.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mmc/host/ricoh_mmc.c +4 -4
index be9e7b3..f627905 100644
@@ -196,7 +196,7 @@ static void __devexit ricoh_mmc_remove(struct pci_dev *pdev)
 	pci_set_drvdata(pdev, NULL);
 }
 
-static int ricoh_mmc_suspend(struct pci_dev *pdev, pm_message_t state)
+static int ricoh_mmc_suspend_late(struct pci_dev *pdev, pm_message_t state)
 {
 	struct pci_dev *fw_dev = NULL;
 
@@ -210,7 +210,7 @@ static int ricoh_mmc_suspend(struct pci_dev *pdev, pm_message_t state)
 	return 0;
 }
 
-static int ricoh_mmc_resume(struct pci_dev *pdev)
+static int ricoh_mmc_resume_early(struct pci_dev *pdev)
 {
 	struct pci_dev *fw_dev = NULL;
 
@@ -229,8 +229,8 @@ static struct pci_driver ricoh_mmc_driver = {
 	.id_table =	pci_ids,
 	.probe = 	ricoh_mmc_probe,
 	.remove =	__devexit_p(ricoh_mmc_remove),
-	.suspend =	ricoh_mmc_suspend,
-	.resume =	ricoh_mmc_resume,
+	.suspend_late =	ricoh_mmc_suspend_late,
+	.resume_early =	ricoh_mmc_resume_early,
 };
 
 /*****************************************************************************\

Based on comments from Rafael, I'm resending this patch using suspend_late and resume_early instead.

#1 lore raw
Quoted 9 lines · On Sun, 18 Jan 2009 14:11:20 -0500 (EST) [email protected] wrote:

If ricoh_mmc suspends before sdhci_pci, it will pull the card out from under the controller, which could leave the system in a very confused state.

Using suspend_late/resume_early ensures that sdhci_pci suspends first and resumes second.

---

What's the plan here? Apply for .29?

Rgds

Signature · 6 lines
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.
#2 lore raw
Quoted 7 lines · Pierre Ossman
Quoted 4 lines · On Sun, 18 Jan 2009 14:11:20 -0500 (EST) [email protected] wrote:

If ricoh_mmc suspends before sdhci_pci, it will pull the card out from under the controller, which could leave the system in a very confused state.

Quoted 7 lines
Quoted 5 lines

Using suspend_late/resume_early ensures that sdhci_pci suspends first and resumes second.

---

What's the plan here? Apply for .29?

That's what I'd recommend - we are seeing reports of problems that would be fixed by this.

eg: http://lkml.org/lkml/2009/1/21/241

--phil

#3 lore raw
Quoted 14 lines · Philip Langdale
Quoted 13 lines · Pierre Ossman
Quoted 9 lines · On Sun, 18 Jan 2009 14:11:20 -0500 (EST) [email protected] wrote:

If ricoh_mmc suspends before sdhci_pci, it will pull the card out from under the controller, which could leave the system in a very confused state.

Using suspend_late/resume_early ensures that sdhci_pci suspends first and resumes second.

---

Quoted 6 lines
Quoted 1 line

What's the plan here? Apply for .29?

That's what I'd recommend - we are seeing reports of problems that would be fixed by this.

eg: http://lkml.org/lkml/2009/1/21/241

Agreed.

Thanks,
Rafael

#4 lore raw
Quoted 12 lines · On Sat, 24 Jan 2009 21:55:01 +0100 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 8 lines · Philip Langdale
Quoted 2 lines · Pierre Ossman

What's the plan here? Apply for .29?

That's what I'd recommend - we are seeing reports of problems that would be fixed by this.

eg: http://lkml.org/lkml/2009/1/21/241

Agreed.

Queueing it up then.

Rgds

Signature · 6 lines
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.