* MMC: s3cmci: ensure host stopped on machine shutdown
@ 2008-07-17 14:32 Ben Dooks
2008-07-17 15:29 ` Pierre Ossman
0 siblings, 1 reply; 5+ messages in thread
From: Ben Dooks @ 2008-07-17 14:32 UTC (permalink / raw)
To: drzeus-mmc, linux-kernel; +Cc: Ben Dooks
[-- Attachment #1: simtec/simtec-mmc-shutdown.patch --]
[-- Type: text/plain, Size: 2251 bytes --]
Ensure that the s3cmci host controller is turned off
when the machine is shutdown, otherwise we end up
leaving the card powered and processing insertion and
removal events after the system prints "System halted."
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.26-quilt3/drivers/mmc/host/s3cmci.c
===================================================================
--- linux-2.6.26-quilt3.orig/drivers/mmc/host/s3cmci.c 2008-07-17 15:15:35.000000000 +0100
+++ linux-2.6.26-quilt3/drivers/mmc/host/s3cmci.c 2008-07-17 15:29:23.000000000 +0100
@@ -1331,21 +1331,30 @@ static int __devinit s3cmci_probe(struct
return ret;
}
+static void s3cmci_shutdown(struct platform_device *pdev)
+{
+ struct mmc_host *mmc = platform_get_drvdata(pdev);
+ struct s3cmci_host *host = mmc_priv(mmc);
+
+ if (host->irq_cd >= 0)
+ free_irq(host->irq_cd, host);
+
+ mmc_remove_host(mmc);
+ clk_disable(host->clk);
+}
+
static int __devexit s3cmci_remove(struct platform_device *pdev)
{
struct mmc_host *mmc = platform_get_drvdata(pdev);
struct s3cmci_host *host = mmc_priv(mmc);
- mmc_remove_host(mmc);
+ s3cmci_shutdown(pdev);
- clk_disable(host->clk);
clk_put(host->clk);
tasklet_disable(&host->pio_tasklet);
s3c2410_dma_free(S3CMCI_DMA, &s3cmci_dma_client);
- if (host->irq_cd >= 0)
- free_irq(host->irq_cd, host);
free_irq(host->irq, host);
iounmap(host->base);
@@ -1397,6 +1406,7 @@ static struct platform_driver s3cmci_241
.driver.owner = THIS_MODULE,
.probe = s3cmci_2410_probe,
.remove = __devexit_p(s3cmci_remove),
+ .shutdown = s3cmci_shutdown,
.suspend = s3cmci_suspend,
.resume = s3cmci_resume,
};
@@ -1406,6 +1416,7 @@ static struct platform_driver s3cmci_241
.driver.owner = THIS_MODULE,
.probe = s3cmci_2412_probe,
.remove = __devexit_p(s3cmci_remove),
+ .shutdown = s3cmci_shutdown,
.suspend = s3cmci_suspend,
.resume = s3cmci_resume,
};
@@ -1415,6 +1426,7 @@ static struct platform_driver s3cmci_244
.driver.owner = THIS_MODULE,
.probe = s3cmci_2440_probe,
.remove = __devexit_p(s3cmci_remove),
+ .shutdown = s3cmci_shutdown,
.suspend = s3cmci_suspend,
.resume = s3cmci_resume,
};
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: MMC: s3cmci: ensure host stopped on machine shutdown
2008-07-17 14:32 MMC: s3cmci: ensure host stopped on machine shutdown Ben Dooks
@ 2008-07-17 15:29 ` Pierre Ossman
2008-07-17 15:50 ` Ben Dooks
0 siblings, 1 reply; 5+ messages in thread
From: Pierre Ossman @ 2008-07-17 15:29 UTC (permalink / raw)
To: Ben Dooks; +Cc: linux-kernel, Ben Dooks
On Thu, 17 Jul 2008 15:32:54 +0100
Ben Dooks <ben-linux@fluff.org> wrote:
> Ensure that the s3cmci host controller is turned off
> when the machine is shutdown, otherwise we end up
> leaving the card powered and processing insertion and
> removal events after the system prints "System halted."
>
> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
>
> Index: linux-2.6.26-quilt3/drivers/mmc/host/s3cmci.c
> ===================================================================
> --- linux-2.6.26-quilt3.orig/drivers/mmc/host/s3cmci.c 2008-07-17 15:15:35.000000000 +0100
> +++ linux-2.6.26-quilt3/drivers/mmc/host/s3cmci.c 2008-07-17 15:29:23.000000000 +0100
> @@ -1331,21 +1331,30 @@ static int __devinit s3cmci_probe(struct
> return ret;
> }
>
> +static void s3cmci_shutdown(struct platform_device *pdev)
> +{
> + struct mmc_host *mmc = platform_get_drvdata(pdev);
> + struct s3cmci_host *host = mmc_priv(mmc);
> +
> + if (host->irq_cd >= 0)
> + free_irq(host->irq_cd, host);
> +
> + mmc_remove_host(mmc);
> + clk_disable(host->clk);
> +}
> +
The core can send requests your way until mmc_remove_host() returns so
you can't remove the interrupt before then.
Rgds
--
-- Pierre Ossman
Linux kernel, MMC maintainer http://www.kernel.org
rdesktop, core developer http://www.rdesktop.org
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.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: MMC: s3cmci: ensure host stopped on machine shutdown
2008-07-17 15:29 ` Pierre Ossman
@ 2008-07-17 15:50 ` Ben Dooks
2008-07-17 16:22 ` Pierre Ossman
0 siblings, 1 reply; 5+ messages in thread
From: Ben Dooks @ 2008-07-17 15:50 UTC (permalink / raw)
To: Pierre Ossman; +Cc: Ben Dooks, linux-kernel
On Thu, Jul 17, 2008 at 05:29:45PM +0200, Pierre Ossman wrote:
> On Thu, 17 Jul 2008 15:32:54 +0100
> Ben Dooks <ben-linux@fluff.org> wrote:
>
> > Ensure that the s3cmci host controller is turned off
> > when the machine is shutdown, otherwise we end up
> > leaving the card powered and processing insertion and
> > removal events after the system prints "System halted."
> >
> > Signed-off-by: Ben Dooks <ben-linux@fluff.org>
> >
> > Index: linux-2.6.26-quilt3/drivers/mmc/host/s3cmci.c
> > ===================================================================
> > --- linux-2.6.26-quilt3.orig/drivers/mmc/host/s3cmci.c 2008-07-17 15:15:35.000000000 +0100
> > +++ linux-2.6.26-quilt3/drivers/mmc/host/s3cmci.c 2008-07-17 15:29:23.000000000 +0100
> > @@ -1331,21 +1331,30 @@ static int __devinit s3cmci_probe(struct
> > return ret;
> > }
> >
> > +static void s3cmci_shutdown(struct platform_device *pdev)
> > +{
> > + struct mmc_host *mmc = platform_get_drvdata(pdev);
> > + struct s3cmci_host *host = mmc_priv(mmc);
> > +
> > + if (host->irq_cd >= 0)
> > + free_irq(host->irq_cd, host);
> > +
> > + mmc_remove_host(mmc);
> > + clk_disable(host->clk);
> > +}
> > +
>
> The core can send requests your way until mmc_remove_host() returns so
> you can't remove the interrupt before then.
I'm only removing the card-detect interrupt, the main host one
is not being disabled here.
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: MMC: s3cmci: ensure host stopped on machine shutdown
2008-07-17 15:50 ` Ben Dooks
@ 2008-07-17 16:22 ` Pierre Ossman
2008-07-17 18:27 ` Ben Dooks
0 siblings, 1 reply; 5+ messages in thread
From: Pierre Ossman @ 2008-07-17 16:22 UTC (permalink / raw)
To: Ben Dooks; +Cc: Ben Dooks, linux-kernel
On Thu, 17 Jul 2008 16:50:37 +0100
Ben Dooks <ben-linux@fluff.org> wrote:
> On Thu, Jul 17, 2008 at 05:29:45PM +0200, Pierre Ossman wrote:
> >
> > The core can send requests your way until mmc_remove_host() returns so
> > you can't remove the interrupt before then.
>
> I'm only removing the card-detect interrupt, the main host one
> is not being disabled here.
>
Ah, I see. Then it should be just fine. I'll have it queued up.
Rgds
--
-- Pierre Ossman
Linux kernel, MMC maintainer http://www.kernel.org
rdesktop, core developer http://www.rdesktop.org
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.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: MMC: s3cmci: ensure host stopped on machine shutdown
2008-07-17 16:22 ` Pierre Ossman
@ 2008-07-17 18:27 ` Ben Dooks
0 siblings, 0 replies; 5+ messages in thread
From: Ben Dooks @ 2008-07-17 18:27 UTC (permalink / raw)
To: Pierre Ossman; +Cc: Ben Dooks, linux-kernel
On Thu, Jul 17, 2008 at 06:22:42PM +0200, Pierre Ossman wrote:
> On Thu, 17 Jul 2008 16:50:37 +0100
> Ben Dooks <ben-linux@fluff.org> wrote:
>
> > On Thu, Jul 17, 2008 at 05:29:45PM +0200, Pierre Ossman wrote:
> > >
> > > The core can send requests your way until mmc_remove_host() returns so
> > > you can't remove the interrupt before then.
> >
> > I'm only removing the card-detect interrupt, the main host one
> > is not being disabled here.
> >
>
> Ah, I see. Then it should be just fine. I'll have it queued up.
It does depend on the previous patch to fix the section
mismatch reports.
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-07-17 18:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-17 14:32 MMC: s3cmci: ensure host stopped on machine shutdown Ben Dooks
2008-07-17 15:29 ` Pierre Ossman
2008-07-17 15:50 ` Ben Dooks
2008-07-17 16:22 ` Pierre Ossman
2008-07-17 18:27 ` Ben Dooks
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox