* [PATCH 0/2] Add runtime PM support to Primecell bus
@ 2011-08-23 10:15 Russell King - ARM Linux
2011-08-23 10:16 ` [PATCH 1/2] PM: add runtime PM support to core Primecell driver Russell King - ARM Linux
2011-08-23 10:16 ` [PATCH 2/2] PM: add runtime PM support to MMCI Russell King - ARM Linux
0 siblings, 2 replies; 12+ messages in thread
From: Russell King - ARM Linux @ 2011-08-23 10:15 UTC (permalink / raw)
To: linux-arm-kernel
These patches add basic runtime PM support to the Primecell bus type, so
that the bus clock can be managed according to the activities of devices
attached to it.
The inspiration of the bus level implementation was taken from PCI,
originally written by Rafael.
Adding the bus level runtime PM support requires removing the runtime PM
setup/teardown from the SPI driver, hence why the SPI driver features in
patch 1.
Patch 2 adds runtime PM support to the MMC interface driver.
Please can I have acks for these two patches. It's likely that they will
depend on other ARM work.
Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] PM: add runtime PM support to core Primecell driver
2011-08-23 10:15 [PATCH 0/2] Add runtime PM support to Primecell bus Russell King - ARM Linux
@ 2011-08-23 10:16 ` Russell King - ARM Linux
2011-08-23 22:24 ` Rafael J. Wysocki
2011-08-28 19:26 ` [PATCH] spi: Fix builderror in spi-pl022.c Peter Huewe
2011-08-23 10:16 ` [PATCH 2/2] PM: add runtime PM support to MMCI Russell King - ARM Linux
1 sibling, 2 replies; 12+ messages in thread
From: Russell King - ARM Linux @ 2011-08-23 10:16 UTC (permalink / raw)
To: linux-arm-kernel
Add runtime PM support to the core Primecell driver, following the PCI
model of how this is done.
Rather than having every driver fiddle about with enabling runtime PM,
that's dealt with in the core and instead, drivers just do a put() in
their probe and a balancing get() in their remove function to activate
runtime PM for the device.
As we're dealing with enabling runtime PM in the core, fix up spi-pl022
as it must not enable and disable runtime PM itself anymore.
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/amba/bus.c | 57 +++++++++++++++++++++++++++++++--
drivers/spi/spi-pl022.c | 80 ++++++++++++++++++++++++++++-------------------
2 files changed, 102 insertions(+), 35 deletions(-)
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index d74926e..84bdaac 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -365,6 +365,40 @@ static int amba_pm_restore_noirq(struct device *dev)
#endif /* !CONFIG_HIBERNATE_CALLBACKS */
+#ifdef CONFIG_PM_RUNTIME
+/*
+ * Hooks to provide runtime PM of the pclk (bus clock). It is safe to
+ * enable/disable the bus clock at runtime PM suspend/resume as this
+ * does not result in loss of context. However, disabling vcore power
+ * would do, so we leave that to the driver.
+ */
+static int amba_pm_runtime_suspend(struct device *dev)
+{
+ struct amba_device *pcdev = to_amba_device(dev);
+ int ret = pm_generic_runtime_suspend(dev);
+
+ if (ret == 0 && dev->driver)
+ clk_disable(pcdev->pclk);
+
+ return ret;
+}
+
+static int amba_pm_runtime_resume(struct device *dev)
+{
+ struct amba_device *pcdev = to_amba_device(dev);
+ int ret;
+
+ if (dev->driver) {
+ ret = clk_enable(pcdev->pclk);
+ /* Failure is probably fatal to the system, but... */
+ if (ret)
+ return ret;
+ }
+
+ return pm_generic_runtime_resume(dev);
+}
+#endif
+
#ifdef CONFIG_PM
static const struct dev_pm_ops amba_pm = {
@@ -383,8 +417,8 @@ static const struct dev_pm_ops amba_pm = {
.poweroff_noirq = amba_pm_poweroff_noirq,
.restore_noirq = amba_pm_restore_noirq,
SET_RUNTIME_PM_OPS(
- pm_generic_runtime_suspend,
- pm_generic_runtime_resume,
+ amba_pm_runtime_suspend,
+ amba_pm_runtime_resume,
pm_generic_runtime_idle
)
};
@@ -494,10 +528,18 @@ static int amba_probe(struct device *dev)
if (ret)
break;
+ pm_runtime_get_noresume(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_enable(dev);
+
ret = pcdrv->probe(pcdev, id);
if (ret == 0)
break;
+ pm_runtime_disable(dev);
+ pm_runtime_set_suspended(dev);
+ pm_runtime_put_noidle(dev);
+
amba_put_disable_pclk(pcdev);
amba_put_disable_vcore(pcdev);
} while (0);
@@ -509,7 +551,16 @@ static int amba_remove(struct device *dev)
{
struct amba_device *pcdev = to_amba_device(dev);
struct amba_driver *drv = to_amba_driver(dev->driver);
- int ret = drv->remove(pcdev);
+ int ret;
+
+ pm_runtime_get_sync(dev);
+ ret = drv->remove(pcdev);
+ pm_runtime_put_noidle(dev);
+
+ /* Undo the runtime PM settings in amba_probe() */
+ pm_runtime_disable(dev);
+ pm_runtime_set_suspended(dev);
+ pm_runtime_put_noidle(dev);
amba_put_disable_pclk(pcdev);
amba_put_disable_vcore(pcdev);
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 730b4a3..078338f 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -515,9 +515,6 @@ static void giveback(struct pl022 *pl022)
if (msg->complete)
msg->complete(msg->context);
/* This message is completed, so let's turn off the clocks & power */
- clk_disable(pl022->clk);
- amba_pclk_disable(pl022->adev);
- amba_vcore_disable(pl022->adev);
pm_runtime_put(&pl022->adev->dev);
}
@@ -1545,9 +1542,6 @@ static void pump_messages(struct work_struct *work)
* (poll/interrupt/DMA)
*/
pm_runtime_get_sync(&pl022->adev->dev);
- amba_vcore_enable(pl022->adev);
- amba_pclk_enable(pl022->adev);
- clk_enable(pl022->clk);
restore_state(pl022);
flush(pl022);
@@ -2186,8 +2180,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
}
printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n",
adev->res.start, pl022->virtbase);
- pm_runtime_enable(dev);
- pm_runtime_resume(dev);
pl022->clk = clk_get(&adev->dev, NULL);
if (IS_ERR(pl022->clk)) {
@@ -2195,7 +2187,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
dev_err(&adev->dev, "could not retrieve SSP/SPI bus clock\n");
goto err_no_clk;
}
-
/* Disable SSP */
writew((readw(SSP_CR1(pl022->virtbase)) & (~SSP_CR1_MASK_SSE)),
SSP_CR1(pl022->virtbase));
@@ -2235,12 +2226,9 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
goto err_spi_register;
}
dev_dbg(dev, "probe succeeded\n");
- /*
- * Disable the silicon block pclk and any voltage domain and just
- * power it up and clock it when it's needed
- */
- amba_pclk_disable(adev);
- amba_vcore_disable(adev);
+
+ /* let runtime pm put suspend */
+ pm_runtime_put(dev);
return 0;
err_spi_register:
@@ -2249,7 +2237,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
destroy_queue(pl022);
pl022_dma_remove(pl022);
free_irq(adev->irq[0], pl022);
- pm_runtime_disable(&adev->dev);
err_no_irq:
clk_put(pl022->clk);
err_no_clk:
@@ -2271,6 +2258,12 @@ pl022_remove(struct amba_device *adev)
if (!pl022)
return 0;
+ /*
+ * undo pm_runtime_put() in probe. I assume that we're not
+ * accessing the primecell here.
+ */
+ pm_runtime_get_noresume(&adev->dev);
+
/* Remove the queue */
if (destroy_queue(pl022) != 0)
dev_err(&adev->dev, "queue remove failed\n");
@@ -2288,10 +2281,10 @@ pl022_remove(struct amba_device *adev)
return 0;
}
-#ifdef CONFIG_PM
-static int pl022_suspend(struct amba_device *adev, pm_message_t state)
+#ifdef CONFIG_SUSPEND
+static int pl011_suspend(struct device *dev)
{
- struct pl022 *pl022 = amba_get_drvdata(adev);
+ struct pl022 *pl022 = dev_get_drvdata(dev);
int status = 0;
status = stop_queue(pl022);
@@ -2300,34 +2293,58 @@ static int pl022_suspend(struct amba_device *adev, pm_message_t state)
return status;
}
- amba_vcore_enable(adev);
- amba_pclk_enable(adev);
+ amba_vcore_enable(pl022->adev);
+ amba_pclk_enable(pl022->adev);
load_ssp_default_config(pl022);
- amba_pclk_disable(adev);
- amba_vcore_disable(adev);
+ amba_pclk_disable(pl022->adev);
+ amba_vcore_disable(pl022->adev);
dev_dbg(&adev->dev, "suspended\n");
return 0;
}
-static int pl022_resume(struct amba_device *adev)
+static int pl022_resume(struct device *dev)
{
- struct pl022 *pl022 = amba_get_drvdata(adev);
+ struct pl022 *pl022 = dev_get_drvdata(dev);
int status = 0;
/* Start the queue running */
status = start_queue(pl022);
if (status)
- dev_err(&adev->dev, "problem starting queue (%d)\n", status);
+ dev_err(dev, "problem starting queue (%d)\n", status);
else
- dev_dbg(&adev->dev, "resumed\n");
+ dev_dbg(dev, "resumed\n");
return status;
}
-#else
-#define pl022_suspend NULL
-#define pl022_resume NULL
#endif /* CONFIG_PM */
+#ifdef CONFIG_PM_RUNTIME
+static int pl022_runtime_suspend(struct device *dev)
+{
+ struct pl022 *pl022 = dev_get_drvdata(dev);
+
+ clk_disable(pl022->clk);
+ amba_vcore_disable(pl022->adev);
+
+ return 0;
+}
+
+static int pl022_runtime_resume(struct device *dev)
+{
+ struct pl022 *pl022 = dev_get_drvdata(dev);
+
+ amba_vcore_enable(pl022->adev);
+ clk_enable(pl022->clk);
+
+ return 0;
+}
+#endif
+
+static const struct dev_pm_ops pl022_dev_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume)
+ SET_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
+};
+
static struct vendor_data vendor_arm = {
.fifodepth = 8,
.max_bpw = 16,
@@ -2407,12 +2424,11 @@ static struct amba_id pl022_ids[] = {
static struct amba_driver pl022_driver = {
.drv = {
.name = "ssp-pl022",
+ .pm = &pl022_dev_pm_ops,
},
.id_table = pl022_ids,
.probe = pl022_probe,
.remove = __devexit_p(pl022_remove),
- .suspend = pl022_suspend,
- .resume = pl022_resume,
};
--
1.7.4.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] PM: add runtime PM support to MMCI
2011-08-23 10:15 [PATCH 0/2] Add runtime PM support to Primecell bus Russell King - ARM Linux
2011-08-23 10:16 ` [PATCH 1/2] PM: add runtime PM support to core Primecell driver Russell King - ARM Linux
@ 2011-08-23 10:16 ` Russell King - ARM Linux
1 sibling, 0 replies; 12+ messages in thread
From: Russell King - ARM Linux @ 2011-08-23 10:16 UTC (permalink / raw)
To: linux-arm-kernel
Add runtime PM support to the MMCI primecell driver, making use of
the core primecell bus runtime PM support.
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/mmc/host/mmci.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 56e9a41..5e142b7 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -29,6 +29,7 @@
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/amba/mmci.h>
+#include <linux/pm_runtime.h>
#include <asm/div64.h>
#include <asm/io.h>
@@ -170,6 +171,7 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
* back into the driver...
*/
spin_unlock(&host->lock);
+ pm_runtime_put(mmc_dev(host->mmc));
mmc_request_done(host->mmc, mrq);
spin_lock(&host->lock);
}
@@ -984,6 +986,8 @@ static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
return;
}
+ pm_runtime_get_sync(mmc_dev(mmc));
+
spin_lock_irqsave(&host->lock, flags);
host->mrq = mrq;
@@ -1327,6 +1331,8 @@ static int __devinit mmci_probe(struct amba_device *dev,
mmci_dma_setup(host);
+ pm_runtime_put(&dev->dev);
+
mmc_add_host(mmc);
return 0;
@@ -1364,6 +1370,12 @@ static int __devexit mmci_remove(struct amba_device *dev)
if (mmc) {
struct mmci_host *host = mmc_priv(mmc);
+ /*
+ * Undo pm_runtime_put() in probe. We use the _sync
+ * version here so that we can access the primecell.
+ */
+ pm_runtime_get_sync(&dev->dev);
+
mmc_remove_host(mmc);
writel(0, host->base + MMCIMASK0);
--
1.7.4.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 1/2] PM: add runtime PM support to core Primecell driver
2011-08-23 10:16 ` [PATCH 1/2] PM: add runtime PM support to core Primecell driver Russell King - ARM Linux
@ 2011-08-23 22:24 ` Rafael J. Wysocki
2011-08-28 19:26 ` [PATCH] spi: Fix builderror in spi-pl022.c Peter Huewe
1 sibling, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2011-08-23 22:24 UTC (permalink / raw)
To: linux-arm-kernel
On Tuesday, August 23, 2011, Russell King - ARM Linux wrote:
> Add runtime PM support to the core Primecell driver, following the PCI
> model of how this is done.
>
> Rather than having every driver fiddle about with enabling runtime PM,
> that's dealt with in the core and instead, drivers just do a put() in
> their probe and a balancing get() in their remove function to activate
> runtime PM for the device.
>
> As we're dealing with enabling runtime PM in the core, fix up spi-pl022
> as it must not enable and disable runtime PM itself anymore.
>
> Tested-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
> drivers/amba/bus.c | 57 +++++++++++++++++++++++++++++++--
> drivers/spi/spi-pl022.c | 80 ++++++++++++++++++++++++++++-------------------
> 2 files changed, 102 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
> index d74926e..84bdaac 100644
> --- a/drivers/amba/bus.c
> +++ b/drivers/amba/bus.c
> @@ -365,6 +365,40 @@ static int amba_pm_restore_noirq(struct device *dev)
>
> #endif /* !CONFIG_HIBERNATE_CALLBACKS */
>
> +#ifdef CONFIG_PM_RUNTIME
> +/*
> + * Hooks to provide runtime PM of the pclk (bus clock). It is safe to
> + * enable/disable the bus clock at runtime PM suspend/resume as this
> + * does not result in loss of context. However, disabling vcore power
> + * would do, so we leave that to the driver.
> + */
> +static int amba_pm_runtime_suspend(struct device *dev)
> +{
> + struct amba_device *pcdev = to_amba_device(dev);
> + int ret = pm_generic_runtime_suspend(dev);
> +
> + if (ret == 0 && dev->driver)
> + clk_disable(pcdev->pclk);
> +
> + return ret;
> +}
> +
> +static int amba_pm_runtime_resume(struct device *dev)
> +{
> + struct amba_device *pcdev = to_amba_device(dev);
> + int ret;
> +
> + if (dev->driver) {
> + ret = clk_enable(pcdev->pclk);
> + /* Failure is probably fatal to the system, but... */
> + if (ret)
> + return ret;
> + }
> +
> + return pm_generic_runtime_resume(dev);
> +}
> +#endif
> +
> #ifdef CONFIG_PM
>
> static const struct dev_pm_ops amba_pm = {
> @@ -383,8 +417,8 @@ static const struct dev_pm_ops amba_pm = {
> .poweroff_noirq = amba_pm_poweroff_noirq,
> .restore_noirq = amba_pm_restore_noirq,
> SET_RUNTIME_PM_OPS(
> - pm_generic_runtime_suspend,
> - pm_generic_runtime_resume,
> + amba_pm_runtime_suspend,
> + amba_pm_runtime_resume,
> pm_generic_runtime_idle
> )
> };
> @@ -494,10 +528,18 @@ static int amba_probe(struct device *dev)
> if (ret)
> break;
>
> + pm_runtime_get_noresume(dev);
> + pm_runtime_set_active(dev);
> + pm_runtime_enable(dev);
> +
> ret = pcdrv->probe(pcdev, id);
> if (ret == 0)
> break;
>
> + pm_runtime_disable(dev);
> + pm_runtime_set_suspended(dev);
> + pm_runtime_put_noidle(dev);
> +
> amba_put_disable_pclk(pcdev);
> amba_put_disable_vcore(pcdev);
> } while (0);
> @@ -509,7 +551,16 @@ static int amba_remove(struct device *dev)
> {
> struct amba_device *pcdev = to_amba_device(dev);
> struct amba_driver *drv = to_amba_driver(dev->driver);
> - int ret = drv->remove(pcdev);
> + int ret;
> +
> + pm_runtime_get_sync(dev);
> + ret = drv->remove(pcdev);
> + pm_runtime_put_noidle(dev);
> +
> + /* Undo the runtime PM settings in amba_probe() */
> + pm_runtime_disable(dev);
> + pm_runtime_set_suspended(dev);
> + pm_runtime_put_noidle(dev);
>
> amba_put_disable_pclk(pcdev);
> amba_put_disable_vcore(pcdev);
> diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
> index 730b4a3..078338f 100644
> --- a/drivers/spi/spi-pl022.c
> +++ b/drivers/spi/spi-pl022.c
> @@ -515,9 +515,6 @@ static void giveback(struct pl022 *pl022)
> if (msg->complete)
> msg->complete(msg->context);
> /* This message is completed, so let's turn off the clocks & power */
> - clk_disable(pl022->clk);
> - amba_pclk_disable(pl022->adev);
> - amba_vcore_disable(pl022->adev);
> pm_runtime_put(&pl022->adev->dev);
> }
>
> @@ -1545,9 +1542,6 @@ static void pump_messages(struct work_struct *work)
> * (poll/interrupt/DMA)
> */
> pm_runtime_get_sync(&pl022->adev->dev);
> - amba_vcore_enable(pl022->adev);
> - amba_pclk_enable(pl022->adev);
> - clk_enable(pl022->clk);
> restore_state(pl022);
> flush(pl022);
>
> @@ -2186,8 +2180,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
> }
> printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n",
> adev->res.start, pl022->virtbase);
> - pm_runtime_enable(dev);
> - pm_runtime_resume(dev);
>
> pl022->clk = clk_get(&adev->dev, NULL);
> if (IS_ERR(pl022->clk)) {
> @@ -2195,7 +2187,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
> dev_err(&adev->dev, "could not retrieve SSP/SPI bus clock\n");
> goto err_no_clk;
> }
> -
> /* Disable SSP */
> writew((readw(SSP_CR1(pl022->virtbase)) & (~SSP_CR1_MASK_SSE)),
> SSP_CR1(pl022->virtbase));
> @@ -2235,12 +2226,9 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
> goto err_spi_register;
> }
> dev_dbg(dev, "probe succeeded\n");
> - /*
> - * Disable the silicon block pclk and any voltage domain and just
> - * power it up and clock it when it's needed
> - */
> - amba_pclk_disable(adev);
> - amba_vcore_disable(adev);
> +
> + /* let runtime pm put suspend */
> + pm_runtime_put(dev);
> return 0;
>
> err_spi_register:
> @@ -2249,7 +2237,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
> destroy_queue(pl022);
> pl022_dma_remove(pl022);
> free_irq(adev->irq[0], pl022);
> - pm_runtime_disable(&adev->dev);
> err_no_irq:
> clk_put(pl022->clk);
> err_no_clk:
> @@ -2271,6 +2258,12 @@ pl022_remove(struct amba_device *adev)
> if (!pl022)
> return 0;
>
> + /*
> + * undo pm_runtime_put() in probe. I assume that we're not
> + * accessing the primecell here.
> + */
> + pm_runtime_get_noresume(&adev->dev);
> +
> /* Remove the queue */
> if (destroy_queue(pl022) != 0)
> dev_err(&adev->dev, "queue remove failed\n");
> @@ -2288,10 +2281,10 @@ pl022_remove(struct amba_device *adev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> -static int pl022_suspend(struct amba_device *adev, pm_message_t state)
> +#ifdef CONFIG_SUSPEND
> +static int pl011_suspend(struct device *dev)
> {
> - struct pl022 *pl022 = amba_get_drvdata(adev);
> + struct pl022 *pl022 = dev_get_drvdata(dev);
> int status = 0;
>
> status = stop_queue(pl022);
> @@ -2300,34 +2293,58 @@ static int pl022_suspend(struct amba_device *adev, pm_message_t state)
> return status;
> }
>
> - amba_vcore_enable(adev);
> - amba_pclk_enable(adev);
> + amba_vcore_enable(pl022->adev);
> + amba_pclk_enable(pl022->adev);
> load_ssp_default_config(pl022);
> - amba_pclk_disable(adev);
> - amba_vcore_disable(adev);
> + amba_pclk_disable(pl022->adev);
> + amba_vcore_disable(pl022->adev);
> dev_dbg(&adev->dev, "suspended\n");
> return 0;
> }
>
> -static int pl022_resume(struct amba_device *adev)
> +static int pl022_resume(struct device *dev)
> {
> - struct pl022 *pl022 = amba_get_drvdata(adev);
> + struct pl022 *pl022 = dev_get_drvdata(dev);
> int status = 0;
>
> /* Start the queue running */
> status = start_queue(pl022);
> if (status)
> - dev_err(&adev->dev, "problem starting queue (%d)\n", status);
> + dev_err(dev, "problem starting queue (%d)\n", status);
> else
> - dev_dbg(&adev->dev, "resumed\n");
> + dev_dbg(dev, "resumed\n");
>
> return status;
> }
> -#else
> -#define pl022_suspend NULL
> -#define pl022_resume NULL
> #endif /* CONFIG_PM */
>
> +#ifdef CONFIG_PM_RUNTIME
> +static int pl022_runtime_suspend(struct device *dev)
> +{
> + struct pl022 *pl022 = dev_get_drvdata(dev);
> +
> + clk_disable(pl022->clk);
> + amba_vcore_disable(pl022->adev);
> +
> + return 0;
> +}
> +
> +static int pl022_runtime_resume(struct device *dev)
> +{
> + struct pl022 *pl022 = dev_get_drvdata(dev);
> +
> + amba_vcore_enable(pl022->adev);
> + clk_enable(pl022->clk);
> +
> + return 0;
> +}
> +#endif
> +
> +static const struct dev_pm_ops pl022_dev_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume)
> + SET_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
> +};
> +
> static struct vendor_data vendor_arm = {
> .fifodepth = 8,
> .max_bpw = 16,
> @@ -2407,12 +2424,11 @@ static struct amba_id pl022_ids[] = {
> static struct amba_driver pl022_driver = {
> .drv = {
> .name = "ssp-pl022",
> + .pm = &pl022_dev_pm_ops,
> },
> .id_table = pl022_ids,
> .probe = pl022_probe,
> .remove = __devexit_p(pl022_remove),
> - .suspend = pl022_suspend,
> - .resume = pl022_resume,
> };
>
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] spi: Fix builderror in spi-pl022.c
2011-08-23 10:16 ` [PATCH 1/2] PM: add runtime PM support to core Primecell driver Russell King - ARM Linux
2011-08-23 22:24 ` Rafael J. Wysocki
@ 2011-08-28 19:26 ` Peter Huewe
2011-08-28 20:06 ` Russell King - ARM Linux
` (2 more replies)
1 sibling, 3 replies; 12+ messages in thread
From: Peter Huewe @ 2011-08-28 19:26 UTC (permalink / raw)
To: linux-arm-kernel
This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add
runtime PM support to core Primecell driver") which unfortunately was a little
bit incomplete and did contain a typo (11 instead of 22).
I'm not sure how this patch could have been tested back then, if it
doesn't even compile ;)
The build failure was:
drivers/spi/spi-pl022.c:2292: error: 'adev' undeclared (first use in
this function)
drivers/spi/spi-pl022.c:2344: error: 'pl022_suspend' undeclared here
(not in a function)
The build failure appears e.g. for the u8500 and realview defconfig.
LinuxVersion: linux next-20110826
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
drivers/spi/spi-pl022.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 078338f..3520cf9 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2282,14 +2282,14 @@ pl022_remove(struct amba_device *adev)
}
#ifdef CONFIG_SUSPEND
-static int pl011_suspend(struct device *dev)
+static int pl022_suspend(struct device *dev)
{
struct pl022 *pl022 = dev_get_drvdata(dev);
int status = 0;
status = stop_queue(pl022);
if (status) {
- dev_warn(&adev->dev, "suspend cannot stop queue\n");
+ dev_warn(dev, "suspend cannot stop queue\n");
return status;
}
@@ -2298,7 +2298,7 @@ static int pl011_suspend(struct device *dev)
load_ssp_default_config(pl022);
amba_pclk_disable(pl022->adev);
amba_vcore_disable(pl022->adev);
- dev_dbg(&adev->dev, "suspended\n");
+ dev_dbg(dev, "suspended\n");
return 0;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] spi: Fix builderror in spi-pl022.c
2011-08-28 19:26 ` [PATCH] spi: Fix builderror in spi-pl022.c Peter Huewe
@ 2011-08-28 20:06 ` Russell King - ARM Linux
2011-08-29 8:41 ` Linus Walleij
2011-09-05 12:45 ` Linus Walleij
2 siblings, 0 replies; 12+ messages in thread
From: Russell King - ARM Linux @ 2011-08-28 20:06 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Aug 28, 2011 at 09:26:59PM +0200, Peter Huewe wrote:
> This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add
> runtime PM support to core Primecell driver") which unfortunately was a little
> bit incomplete and did contain a typo (11 instead of 22).
> I'm not sure how this patch could have been tested back then, if it
> doesn't even compile ;)
Maybe it was tested on configs without CONFIG_SUSPEND enabled - which
is highly likely since my ARM development boards don't support S2RAM.
That's the problem with ifdef'ing code. It makes it impossible to
ensure that it's properly tested.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] spi: Fix builderror in spi-pl022.c
2011-08-28 19:26 ` [PATCH] spi: Fix builderror in spi-pl022.c Peter Huewe
2011-08-28 20:06 ` Russell King - ARM Linux
@ 2011-08-29 8:41 ` Linus Walleij
2011-09-05 12:45 ` Linus Walleij
2 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2011-08-29 8:41 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Aug 28, 2011 at 9:26 PM, Peter Huewe <peterhuewe@gmx.de> wrote:
> This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add
> runtime PM support to core Primecell driver") which unfortunately was a little
> bit incomplete and did contain a typo (11 instead of 22).
> I'm not sure how this patch could have been tested back then, if it
> doesn't even compile ;)
>
> The build failure was:
> drivers/spi/spi-pl022.c:2292: error: 'adev' undeclared (first use in
> this function)
> drivers/spi/spi-pl022.c:2344: error: 'pl022_suspend' undeclared here
> (not in a function)
>
> The build failure appears e.g. for the u8500 and realview defconfig.
>
> LinuxVersion: linux next-20110826
>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Thanks!
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] spi: Fix builderror in spi-pl022.c
2011-08-28 19:26 ` [PATCH] spi: Fix builderror in spi-pl022.c Peter Huewe
2011-08-28 20:06 ` Russell King - ARM Linux
2011-08-29 8:41 ` Linus Walleij
@ 2011-09-05 12:45 ` Linus Walleij
2011-09-20 20:45 ` Linus Walleij
2 siblings, 1 reply; 12+ messages in thread
From: Linus Walleij @ 2011-09-05 12:45 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Aug 28, 2011 at 9:26 PM, Peter Huewe <peterhuewe@gmx.de> wrote:
> This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add
> runtime PM support to core Primecell driver") which unfortunately was a little
> bit incomplete and did contain a typo (11 instead of 22).
> I'm not sure how this patch could have been tested back then, if it
> doesn't even compile ;)
Grant can you please apply this patch? Right now linux-next is
breaking because of this missing patch...
Thanks,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] spi: Fix builderror in spi-pl022.c
2011-09-05 12:45 ` Linus Walleij
@ 2011-09-20 20:45 ` Linus Walleij
2011-09-20 21:52 ` Grant Likely
2011-09-21 13:10 ` Russell King - ARM Linux
0 siblings, 2 replies; 12+ messages in thread
From: Linus Walleij @ 2011-09-20 20:45 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 5, 2011 at 2:45 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Sun, Aug 28, 2011 at 9:26 PM, Peter Huewe <peterhuewe@gmx.de> wrote:
>
>> This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add
>> runtime PM support to core Primecell driver") which unfortunately was a little
>> bit incomplete and did contain a typo (11 instead of 22).
>> I'm not sure how this patch could have been tested back then, if it
>> doesn't even compile ;)
>
> Grant can you please apply this patch? Right now linux-next is
> breaking because of this missing patch...
Ping on this... ignore if it's been picked already.
Thanks,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] spi: Fix builderror in spi-pl022.c
2011-09-20 20:45 ` Linus Walleij
@ 2011-09-20 21:52 ` Grant Likely
2011-09-21 13:10 ` Russell King - ARM Linux
1 sibling, 0 replies; 12+ messages in thread
From: Grant Likely @ 2011-09-20 21:52 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 20, 2011 at 10:45:41PM +0200, Linus Walleij wrote:
> On Mon, Sep 5, 2011 at 2:45 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Sun, Aug 28, 2011 at 9:26 PM, Peter Huewe <peterhuewe@gmx.de> wrote:
> >
> >> This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add
> >> runtime PM support to core Primecell driver") which unfortunately was a little
> >> bit incomplete and did contain a typo (11 instead of 22).
> >> I'm not sure how this patch could have been tested back then, if it
> >> doesn't even compile ;)
> >
> > Grant can you please apply this patch? Right now linux-next is
> > breaking because of this missing patch...
>
> Ping on this... ignore if it's been picked already.
It's not a patch that went through my tree, so I cannot pick it up.
g.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] spi: Fix builderror in spi-pl022.c
2011-09-20 20:45 ` Linus Walleij
2011-09-20 21:52 ` Grant Likely
@ 2011-09-21 13:10 ` Russell King - ARM Linux
2011-09-21 15:54 ` Linus Walleij
1 sibling, 1 reply; 12+ messages in thread
From: Russell King - ARM Linux @ 2011-09-21 13:10 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 20, 2011 at 10:45:41PM +0200, Linus Walleij wrote:
> On Mon, Sep 5, 2011 at 2:45 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Sun, Aug 28, 2011 at 9:26 PM, Peter Huewe <peterhuewe@gmx.de> wrote:
> >
> >> This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add
> >> runtime PM support to core Primecell driver") which unfortunately was a little
> >> bit incomplete and did contain a typo (11 instead of 22).
> >> I'm not sure how this patch could have been tested back then, if it
> >> doesn't even compile ;)
> >
> > Grant can you please apply this patch? Right now linux-next is
> > breaking because of this missing patch...
>
> Ping on this... ignore if it's been picked already.
Isn't it already fixed? I've had this in my tree for quite some time
(since 5th September) which should also be in linux-next.
b21c57c ARM: 7079/1: spi: Fix builderror in spi-pl022.c
612f2eb PM: add runtime PM support to MMCI
67fc8b9 PM: add runtime PM support to core Primecell driver
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] spi: Fix builderror in spi-pl022.c
2011-09-21 13:10 ` Russell King - ARM Linux
@ 2011-09-21 15:54 ` Linus Walleij
0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2011-09-21 15:54 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 21, 2011 at 3:10 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Sep 20, 2011 at 10:45:41PM +0200, Linus Walleij wrote:
>> > Grant can you please apply this patch? Right now linux-next is
>> > breaking because of this missing patch...
>>
>> Ping on this... ignore if it's been picked already.
>
> Isn't it already fixed? ?I've had this in my tree for quite some time
> (since 5th September) which should also be in linux-next.
It is, just wasn't getting my linux-next right after all the kernelorg
downtime.
Thanks Russell, and sorry for the fuzz.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-09-21 15:54 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-23 10:15 [PATCH 0/2] Add runtime PM support to Primecell bus Russell King - ARM Linux
2011-08-23 10:16 ` [PATCH 1/2] PM: add runtime PM support to core Primecell driver Russell King - ARM Linux
2011-08-23 22:24 ` Rafael J. Wysocki
2011-08-28 19:26 ` [PATCH] spi: Fix builderror in spi-pl022.c Peter Huewe
2011-08-28 20:06 ` Russell King - ARM Linux
2011-08-29 8:41 ` Linus Walleij
2011-09-05 12:45 ` Linus Walleij
2011-09-20 20:45 ` Linus Walleij
2011-09-20 21:52 ` Grant Likely
2011-09-21 13:10 ` Russell King - ARM Linux
2011-09-21 15:54 ` Linus Walleij
2011-08-23 10:16 ` [PATCH 2/2] PM: add runtime PM support to MMCI Russell King - ARM Linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).