mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ricoh_mmc: Use suspend/resume_noirq (v2)
@ 2008-12-03 16:59 philipl
  2008-12-04  6:47 ` Pierre Ossman
  0 siblings, 1 reply; 3+ messages in thread
From: philipl @ 2008-12-03 16:59 UTC (permalink / raw)
  To: linux kernel, sdhci-devel, Pierre Ossman; +Cc: Matthew Garrett, Frans Pop

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/resume_noirq ensures that sdhci_pci suspends first
and resumes second.

Signed-off-by: Philip Langdale <philipl@overt.org>
---

  ricoh_mmc.c |   20 ++++++++++++++++----
  1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/ricoh_mmc.c b/drivers/mmc/host/ricoh_mmc.c
index 1837719..b4958a7 100644
--- a/drivers/mmc/host/ricoh_mmc.c
+++ b/drivers/mmc/host/ricoh_mmc.c
@@ -194,10 +194,14 @@ 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_noirq(struct device *dev)
 {
+	struct pci_dev *pdev = NULL;
 	struct pci_dev *fw_dev = NULL;

+	pdev = to_pci_dev(dev);
+	BUG_ON(pdev == NULL);
+
 	fw_dev = pci_get_drvdata(pdev);
 	BUG_ON(fw_dev == NULL);

@@ -208,10 +212,14 @@ 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_noirq(struct device *dev)
 {
+	struct pci_dev *pdev = NULL;
 	struct pci_dev *fw_dev = NULL;

+	pdev = to_pci_dev(dev);
+	BUG_ON(pdev == NULL);
+
 	fw_dev = pci_get_drvdata(pdev);
 	BUG_ON(fw_dev == NULL);

@@ -222,13 +230,17 @@ static int ricoh_mmc_resume(struct pci_dev *pdev)
 	return 0;
 }

+static struct dev_pm_ops ricoh_mmc_pm_opts = {
+	.suspend_noirq =	ricoh_mmc_suspend_noirq,
+	.resume_noirq =		ricoh_mmc_resume_noirq,
+};
+
 static struct pci_driver ricoh_mmc_driver = {
 	.name = 	DRIVER_NAME,
 	.id_table =	pci_ids,
 	.probe = 	ricoh_mmc_probe,
 	.remove =	__devexit_p(ricoh_mmc_remove),
-	.suspend =	ricoh_mmc_suspend,
-	.resume =	ricoh_mmc_resume,
+	.driver.pm =	&ricoh_mmc_pm_opts,
 };

 /*****************************************************************************\


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ricoh_mmc: Use suspend/resume_noirq (v2)
  2008-12-03 16:59 [PATCH] ricoh_mmc: Use suspend/resume_noirq (v2) philipl
@ 2008-12-04  6:47 ` Pierre Ossman
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Ossman @ 2008-12-04  6:47 UTC (permalink / raw)
  To: philipl; +Cc: linux kernel, sdhci-devel, Matthew Garrett, Frans Pop

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

On Wed, 3 Dec 2008 11:59:33 -0500 (EST)
philipl@overt.org 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/resume_noirq ensures that sdhci_pci suspends first
> and resumes second.
> 
> Signed-off-by: Philip Langdale <philipl@overt.org>
> ---

It's probably easier if this is carried in rafael's tree, where the PM
change is. Add a

Acked-by: Pierre Ossman <drzeus@drzeus.cx>

Rgds
-- 
     -- 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] ricoh_mmc: Use suspend/resume_noirq (v2)
@ 2008-12-06 22:40 philipl
  0 siblings, 0 replies; 3+ messages in thread
From: philipl @ 2008-12-06 22:40 UTC (permalink / raw)
  To: linux kernel, sdhci-devel, sfr, rjw; +Cc: Pierre Ossman

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/resume_noirq ensures that sdhci_pci suspends first
and resumes second.

Signed-off-by: Philip Langdale <philipl@overt.org>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
---

  ricoh_mmc.c |   20 ++++++++++++++++----
  1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/ricoh_mmc.c b/drivers/mmc/host/ricoh_mmc.c
index 1837719..b4958a7 100644
--- a/drivers/mmc/host/ricoh_mmc.c
+++ b/drivers/mmc/host/ricoh_mmc.c
@@ -194,10 +194,14 @@ 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_noirq(struct device *dev)
 {
+	struct pci_dev *pdev = NULL;
 	struct pci_dev *fw_dev = NULL;

+	pdev = to_pci_dev(dev);
+	BUG_ON(pdev == NULL);
+
 	fw_dev = pci_get_drvdata(pdev);
 	BUG_ON(fw_dev == NULL);

@@ -208,10 +212,14 @@ 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_noirq(struct device *dev)
 {
+	struct pci_dev *pdev = NULL;
 	struct pci_dev *fw_dev = NULL;

+	pdev = to_pci_dev(dev);
+	BUG_ON(pdev == NULL);
+
 	fw_dev = pci_get_drvdata(pdev);
 	BUG_ON(fw_dev == NULL);

@@ -222,13 +230,17 @@ static int ricoh_mmc_resume(struct pci_dev *pdev)
 	return 0;
 }

+static struct dev_pm_ops ricoh_mmc_pm_opts = {
+	.suspend_noirq =	ricoh_mmc_suspend_noirq,
+	.resume_noirq =		ricoh_mmc_resume_noirq,
+};
+
 static struct pci_driver ricoh_mmc_driver = {
 	.name = 	DRIVER_NAME,
 	.id_table =	pci_ids,
 	.probe = 	ricoh_mmc_probe,
 	.remove =	__devexit_p(ricoh_mmc_remove),
-	.suspend =	ricoh_mmc_suspend,
-	.resume =	ricoh_mmc_resume,
+	.driver.pm =	&ricoh_mmc_pm_opts,
 };

 /*****************************************************************************\


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-06 22:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-03 16:59 [PATCH] ricoh_mmc: Use suspend/resume_noirq (v2) philipl
2008-12-04  6:47 ` Pierre Ossman
2008-12-06 22:40 philipl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®