All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] ARM: at91: prepare transition to common clk framework
@ 2013-07-18  7:32 ` Boris BREZILLON
  0 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:32 UTC (permalink / raw)
  To: Nicolas Ferre, Ludovic Desroches, Jean-Christophe Plagniol-Villard
  Cc: linux-arm-kernel, linux-kernel

Hello,

This patch series prepares the transition to common clk framework by
replacing all the clk_enable and clk_disable calls by clk_prepare_unable and
clk_disable_unprepare to avoid common clock framework warnings.

Best Regards,
Boris

Changes since v3:
 - move usb clock config patches out of this series
 - move clk_prepare/unprepare calls out of critical sections (ssc and
   mci drivers)
 - remove already applied spi clk_prepare patch 

Changes since v2:
 - add configuraton of usb clock in ohci and udc drivers
 - add clk_prepare patch for usba udc driver
 - add clk_prepare patch for spi driver
 - remove already applied udc clk_prepare patch

Changes since v1:
 - remove unneeded clk_unprepare in mci driver
 - remove already applied patches (ehci, ohci, dma and serial)

Changes since common clk patch series:
 - add clk_prepare_enable return check
 - fix a deadlock in atmel-mci (missing spin_unlock)
 - remove already applied patches (atmel-ssc and pwm-atmel-tcb)

Boris BREZILLON (5):
  ARM: at91/tc/clocksource: replace clk_enable/disable with
    clk_prepare_enable/disable_unprepare.
  mmc: atmel-mci: prepare clk before calling enable
  at91/avr32/atmel_lcdfb: prepare clk before calling enable
  USB: gadget: atmel_usba: prepare clk before calling enable
  ASoC: atmel-ssc: remove clk_disable_unprepare call from critical
    section

 drivers/clocksource/tcb_clksrc.c    |   10 +++++-----
 drivers/misc/atmel-ssc.c            |   11 ++++++++---
 drivers/mmc/host/atmel-mci.c        |   34 +++++++++++++++++++++++++++-------
 drivers/usb/gadget/atmel_usba_udc.c |   28 +++++++++++++++++++++-------
 drivers/video/atmel_lcdfb.c         |    8 ++++----
 5 files changed, 65 insertions(+), 26 deletions(-)

-- 
1.7.9.5


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

* [PATCH v4 0/5] ARM: at91: prepare transition to common clk framework
@ 2013-07-18  7:32 ` Boris BREZILLON
  0 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

This patch series prepares the transition to common clk framework by
replacing all the clk_enable and clk_disable calls by clk_prepare_unable and
clk_disable_unprepare to avoid common clock framework warnings.

Best Regards,
Boris

Changes since v3:
 - move usb clock config patches out of this series
 - move clk_prepare/unprepare calls out of critical sections (ssc and
   mci drivers)
 - remove already applied spi clk_prepare patch 

Changes since v2:
 - add configuraton of usb clock in ohci and udc drivers
 - add clk_prepare patch for usba udc driver
 - add clk_prepare patch for spi driver
 - remove already applied udc clk_prepare patch

Changes since v1:
 - remove unneeded clk_unprepare in mci driver
 - remove already applied patches (ehci, ohci, dma and serial)

Changes since common clk patch series:
 - add clk_prepare_enable return check
 - fix a deadlock in atmel-mci (missing spin_unlock)
 - remove already applied patches (atmel-ssc and pwm-atmel-tcb)

Boris BREZILLON (5):
  ARM: at91/tc/clocksource: replace clk_enable/disable with
    clk_prepare_enable/disable_unprepare.
  mmc: atmel-mci: prepare clk before calling enable
  at91/avr32/atmel_lcdfb: prepare clk before calling enable
  USB: gadget: atmel_usba: prepare clk before calling enable
  ASoC: atmel-ssc: remove clk_disable_unprepare call from critical
    section

 drivers/clocksource/tcb_clksrc.c    |   10 +++++-----
 drivers/misc/atmel-ssc.c            |   11 ++++++++---
 drivers/mmc/host/atmel-mci.c        |   34 +++++++++++++++++++++++++++-------
 drivers/usb/gadget/atmel_usba_udc.c |   28 +++++++++++++++++++++-------
 drivers/video/atmel_lcdfb.c         |    8 ++++----
 5 files changed, 65 insertions(+), 26 deletions(-)

-- 
1.7.9.5

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

* [PATCH v4 1/5] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare.
  2013-07-18  7:32 ` Boris BREZILLON
@ 2013-07-18  7:34   ` Boris BREZILLON
  -1 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:34 UTC (permalink / raw)
  To: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, John Stultz, Thomas Gleixner
  Cc: linux-arm-kernel, linux-kernel

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 drivers/clocksource/tcb_clksrc.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
index 8a61872..229c019 100644
--- a/drivers/clocksource/tcb_clksrc.c
+++ b/drivers/clocksource/tcb_clksrc.c
@@ -100,7 +100,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 			|| tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) {
 		__raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR));
 		__raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR));
-		clk_disable(tcd->clk);
+		clk_disable_unprepare(tcd->clk);
 	}
 
 	switch (m) {
@@ -109,7 +109,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 	 * of oneshot, we get lower overhead and improved accuracy.
 	 */
 	case CLOCK_EVT_MODE_PERIODIC:
-		clk_enable(tcd->clk);
+		clk_prepare_enable(tcd->clk);
 
 		/* slow clock, count up to RC, then irq and restart */
 		__raw_writel(timer_clock
@@ -126,7 +126,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 		break;
 
 	case CLOCK_EVT_MODE_ONESHOT:
-		clk_enable(tcd->clk);
+		clk_prepare_enable(tcd->clk);
 
 		/* slow clock, count up to RC, then irq and stop */
 		__raw_writel(timer_clock | ATMEL_TC_CPCSTOP
@@ -275,7 +275,7 @@ static int __init tcb_clksrc_init(void)
 	pdev = tc->pdev;
 
 	t0_clk = tc->clk[0];
-	clk_enable(t0_clk);
+	clk_prepare_enable(t0_clk);
 
 	/* How fast will we be counting?  Pick something over 5 MHz.  */
 	rate = (u32) clk_get_rate(t0_clk);
@@ -313,7 +313,7 @@ static int __init tcb_clksrc_init(void)
 		/* tclib will give us three clocks no matter what the
 		 * underlying platform supports.
 		 */
-		clk_enable(tc->clk[1]);
+		clk_prepare_enable(tc->clk[1]);
 		/* setup both channel 0 & 1 */
 		tcb_setup_dual_chan(tc, best_divisor_idx);
 	}
-- 
1.7.9.5


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

* [PATCH v4 1/5] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare.
@ 2013-07-18  7:34   ` Boris BREZILLON
  0 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:34 UTC (permalink / raw)
  To: linux-arm-kernel

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 drivers/clocksource/tcb_clksrc.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
index 8a61872..229c019 100644
--- a/drivers/clocksource/tcb_clksrc.c
+++ b/drivers/clocksource/tcb_clksrc.c
@@ -100,7 +100,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 			|| tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) {
 		__raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR));
 		__raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR));
-		clk_disable(tcd->clk);
+		clk_disable_unprepare(tcd->clk);
 	}
 
 	switch (m) {
@@ -109,7 +109,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 	 * of oneshot, we get lower overhead and improved accuracy.
 	 */
 	case CLOCK_EVT_MODE_PERIODIC:
-		clk_enable(tcd->clk);
+		clk_prepare_enable(tcd->clk);
 
 		/* slow clock, count up to RC, then irq and restart */
 		__raw_writel(timer_clock
@@ -126,7 +126,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 		break;
 
 	case CLOCK_EVT_MODE_ONESHOT:
-		clk_enable(tcd->clk);
+		clk_prepare_enable(tcd->clk);
 
 		/* slow clock, count up to RC, then irq and stop */
 		__raw_writel(timer_clock | ATMEL_TC_CPCSTOP
@@ -275,7 +275,7 @@ static int __init tcb_clksrc_init(void)
 	pdev = tc->pdev;
 
 	t0_clk = tc->clk[0];
-	clk_enable(t0_clk);
+	clk_prepare_enable(t0_clk);
 
 	/* How fast will we be counting?  Pick something over 5 MHz.  */
 	rate = (u32) clk_get_rate(t0_clk);
@@ -313,7 +313,7 @@ static int __init tcb_clksrc_init(void)
 		/* tclib will give us three clocks no matter what the
 		 * underlying platform supports.
 		 */
-		clk_enable(tc->clk[1]);
+		clk_prepare_enable(tc->clk[1]);
 		/* setup both channel 0 & 1 */
 		tcb_setup_dual_chan(tc, best_divisor_idx);
 	}
-- 
1.7.9.5

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

* [PATCH v4 2/5] mmc: atmel-mci: prepare clk before calling enable
  2013-07-18  7:32 ` Boris BREZILLON
@ 2013-07-18  7:38   ` Boris BREZILLON
  -1 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:38 UTC (permalink / raw)
  To: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Chris Ball
  Cc: linux-arm-kernel, linux-kernel, linux-mmc, Boris BREZILLON

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 drivers/mmc/host/atmel-mci.c |   34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index bdb84da..69e438e 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -378,6 +378,8 @@ static int atmci_regs_show(struct seq_file *s, void *v)
 {
 	struct atmel_mci	*host = s->private;
 	u32			*buf;
+	int			ret = 0;
+
 
 	buf = kmalloc(ATMCI_REGS_SIZE, GFP_KERNEL);
 	if (!buf)
@@ -388,12 +390,16 @@ static int atmci_regs_show(struct seq_file *s, void *v)
 	 * not disabling interrupts, so IMR and SR may not be
 	 * consistent.
 	 */
+	ret = clk_prepare_enable(host->mck);
+	if (ret)
+		goto out;
+
 	spin_lock_bh(&host->lock);
-	clk_enable(host->mck);
 	memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
-	clk_disable(host->mck);
 	spin_unlock_bh(&host->lock);
 
+	clk_disable_unprepare(host->mck);
+
 	seq_printf(s, "MR:\t0x%08x%s%s ",
 			buf[ATMCI_MR / 4],
 			buf[ATMCI_MR / 4] & ATMCI_MR_RDPROOF ? " RDPROOF" : "",
@@ -442,9 +448,10 @@ static int atmci_regs_show(struct seq_file *s, void *v)
 				val & ATMCI_CFG_LSYNC ? " LSYNC" : "");
 	}
 
+out:
 	kfree(buf);
 
-	return 0;
+	return ret;
 }
 
 static int atmci_regs_open(struct inode *inode, struct file *file)
@@ -1262,6 +1269,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	struct atmel_mci_slot	*slot = mmc_priv(mmc);
 	struct atmel_mci	*host = slot->host;
 	unsigned int		i;
+	bool			unprepare_clk;
 
 	slot->sdc_reg &= ~ATMCI_SDCBUS_MASK;
 	switch (ios->bus_width) {
@@ -1277,9 +1285,13 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		unsigned int clock_min = ~0U;
 		u32 clkdiv;
 
+		clk_prepare(host->mck);
+		unprepare_clk = true;
+
 		spin_lock_bh(&host->lock);
 		if (!host->mode_reg) {
 			clk_enable(host->mck);
+			unprepare_clk = false;
 			atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
 			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
 			if (host->caps.has_cfg_reg)
@@ -1347,6 +1359,8 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	} else {
 		bool any_slot_active = false;
 
+		unprepare_clk = false;
+
 		spin_lock_bh(&host->lock);
 		slot->clock = 0;
 		for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
@@ -1360,12 +1374,16 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 			if (host->mode_reg) {
 				atmci_readl(host, ATMCI_MR);
 				clk_disable(host->mck);
+				unprepare_clk = true;
 			}
 			host->mode_reg = 0;
 		}
 		spin_unlock_bh(&host->lock);
 	}
 
+	if (unprepare_clk)
+		clk_unprepare(host->mck);
+
 	switch (ios->power_mode) {
 	case MMC_POWER_UP:
 		set_bit(ATMCI_CARD_NEED_INIT, &slot->flags);
@@ -2376,10 +2394,12 @@ static int __init atmci_probe(struct platform_device *pdev)
 	if (!host->regs)
 		goto err_ioremap;
 
-	clk_enable(host->mck);
+	ret = clk_prepare_enable(host->mck);
+	if (ret)
+		goto err_request_irq;
 	atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
 	host->bus_hz = clk_get_rate(host->mck);
-	clk_disable(host->mck);
+	clk_disable_unprepare(host->mck);
 
 	host->mapbase = regs->start;
 
@@ -2482,11 +2502,11 @@ static int __exit atmci_remove(struct platform_device *pdev)
 			atmci_cleanup_slot(host->slot[i], i);
 	}
 
-	clk_enable(host->mck);
+	clk_prepare_enable(host->mck);
 	atmci_writel(host, ATMCI_IDR, ~0UL);
 	atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
 	atmci_readl(host, ATMCI_SR);
-	clk_disable(host->mck);
+	clk_disable_unprepare(host->mck);
 
 	if (host->dma.chan)
 		dma_release_channel(host->dma.chan);
-- 
1.7.9.5


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

* [PATCH v4 2/5] mmc: atmel-mci: prepare clk before calling enable
@ 2013-07-18  7:38   ` Boris BREZILLON
  0 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:38 UTC (permalink / raw)
  To: linux-arm-kernel

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 drivers/mmc/host/atmel-mci.c |   34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index bdb84da..69e438e 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -378,6 +378,8 @@ static int atmci_regs_show(struct seq_file *s, void *v)
 {
 	struct atmel_mci	*host = s->private;
 	u32			*buf;
+	int			ret = 0;
+
 
 	buf = kmalloc(ATMCI_REGS_SIZE, GFP_KERNEL);
 	if (!buf)
@@ -388,12 +390,16 @@ static int atmci_regs_show(struct seq_file *s, void *v)
 	 * not disabling interrupts, so IMR and SR may not be
 	 * consistent.
 	 */
+	ret = clk_prepare_enable(host->mck);
+	if (ret)
+		goto out;
+
 	spin_lock_bh(&host->lock);
-	clk_enable(host->mck);
 	memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
-	clk_disable(host->mck);
 	spin_unlock_bh(&host->lock);
 
+	clk_disable_unprepare(host->mck);
+
 	seq_printf(s, "MR:\t0x%08x%s%s ",
 			buf[ATMCI_MR / 4],
 			buf[ATMCI_MR / 4] & ATMCI_MR_RDPROOF ? " RDPROOF" : "",
@@ -442,9 +448,10 @@ static int atmci_regs_show(struct seq_file *s, void *v)
 				val & ATMCI_CFG_LSYNC ? " LSYNC" : "");
 	}
 
+out:
 	kfree(buf);
 
-	return 0;
+	return ret;
 }
 
 static int atmci_regs_open(struct inode *inode, struct file *file)
@@ -1262,6 +1269,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	struct atmel_mci_slot	*slot = mmc_priv(mmc);
 	struct atmel_mci	*host = slot->host;
 	unsigned int		i;
+	bool			unprepare_clk;
 
 	slot->sdc_reg &= ~ATMCI_SDCBUS_MASK;
 	switch (ios->bus_width) {
@@ -1277,9 +1285,13 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		unsigned int clock_min = ~0U;
 		u32 clkdiv;
 
+		clk_prepare(host->mck);
+		unprepare_clk = true;
+
 		spin_lock_bh(&host->lock);
 		if (!host->mode_reg) {
 			clk_enable(host->mck);
+			unprepare_clk = false;
 			atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
 			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
 			if (host->caps.has_cfg_reg)
@@ -1347,6 +1359,8 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	} else {
 		bool any_slot_active = false;
 
+		unprepare_clk = false;
+
 		spin_lock_bh(&host->lock);
 		slot->clock = 0;
 		for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
@@ -1360,12 +1374,16 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 			if (host->mode_reg) {
 				atmci_readl(host, ATMCI_MR);
 				clk_disable(host->mck);
+				unprepare_clk = true;
 			}
 			host->mode_reg = 0;
 		}
 		spin_unlock_bh(&host->lock);
 	}
 
+	if (unprepare_clk)
+		clk_unprepare(host->mck);
+
 	switch (ios->power_mode) {
 	case MMC_POWER_UP:
 		set_bit(ATMCI_CARD_NEED_INIT, &slot->flags);
@@ -2376,10 +2394,12 @@ static int __init atmci_probe(struct platform_device *pdev)
 	if (!host->regs)
 		goto err_ioremap;
 
-	clk_enable(host->mck);
+	ret = clk_prepare_enable(host->mck);
+	if (ret)
+		goto err_request_irq;
 	atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
 	host->bus_hz = clk_get_rate(host->mck);
-	clk_disable(host->mck);
+	clk_disable_unprepare(host->mck);
 
 	host->mapbase = regs->start;
 
@@ -2482,11 +2502,11 @@ static int __exit atmci_remove(struct platform_device *pdev)
 			atmci_cleanup_slot(host->slot[i], i);
 	}
 
-	clk_enable(host->mck);
+	clk_prepare_enable(host->mck);
 	atmci_writel(host, ATMCI_IDR, ~0UL);
 	atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
 	atmci_readl(host, ATMCI_SR);
-	clk_disable(host->mck);
+	clk_disable_unprepare(host->mck);
 
 	if (host->dma.chan)
 		dma_release_channel(host->dma.chan);
-- 
1.7.9.5

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

* [PATCH v4 3/5] at91/avr32/atmel_lcdfb: prepare clk before calling enable
  2013-07-18  7:32 ` Boris BREZILLON
  (?)
@ 2013-07-18  7:40   ` Boris BREZILLON
  -1 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:40 UTC (permalink / raw)
  To: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: linux-arm-kernel, linux-kernel, linux-fbdev, Boris BREZILLON

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/video/atmel_lcdfb.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index ece49d5..bf9c5d0 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -954,14 +954,14 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
 
 static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
 {
-	clk_enable(sinfo->bus_clk);
-	clk_enable(sinfo->lcdc_clk);
+	clk_prepare_enable(sinfo->bus_clk);
+	clk_prepare_enable(sinfo->lcdc_clk);
 }
 
 static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
 {
-	clk_disable(sinfo->bus_clk);
-	clk_disable(sinfo->lcdc_clk);
+	clk_disable_unprepare(sinfo->bus_clk);
+	clk_disable_unprepare(sinfo->lcdc_clk);
 }
 
 #ifdef CONFIG_OF
-- 
1.7.9.5


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

* [PATCH v4 3/5] at91/avr32/atmel_lcdfb: prepare clk before calling enable
@ 2013-07-18  7:40   ` Boris BREZILLON
  0 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:40 UTC (permalink / raw)
  To: linux-arm-kernel

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/video/atmel_lcdfb.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index ece49d5..bf9c5d0 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -954,14 +954,14 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
 
 static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
 {
-	clk_enable(sinfo->bus_clk);
-	clk_enable(sinfo->lcdc_clk);
+	clk_prepare_enable(sinfo->bus_clk);
+	clk_prepare_enable(sinfo->lcdc_clk);
 }
 
 static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
 {
-	clk_disable(sinfo->bus_clk);
-	clk_disable(sinfo->lcdc_clk);
+	clk_disable_unprepare(sinfo->bus_clk);
+	clk_disable_unprepare(sinfo->lcdc_clk);
 }
 
 #ifdef CONFIG_OF
-- 
1.7.9.5


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

* [PATCH v4 3/5] at91/avr32/atmel_lcdfb: prepare clk before calling enable
@ 2013-07-18  7:40   ` Boris BREZILLON
  0 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:40 UTC (permalink / raw)
  To: linux-arm-kernel

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/video/atmel_lcdfb.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index ece49d5..bf9c5d0 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -954,14 +954,14 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
 
 static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
 {
-	clk_enable(sinfo->bus_clk);
-	clk_enable(sinfo->lcdc_clk);
+	clk_prepare_enable(sinfo->bus_clk);
+	clk_prepare_enable(sinfo->lcdc_clk);
 }
 
 static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
 {
-	clk_disable(sinfo->bus_clk);
-	clk_disable(sinfo->lcdc_clk);
+	clk_disable_unprepare(sinfo->bus_clk);
+	clk_disable_unprepare(sinfo->lcdc_clk);
 }
 
 #ifdef CONFIG_OF
-- 
1.7.9.5

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

* [PATCH v4 4/5] USB: gadget: atmel_usba: prepare clk before calling enable
  2013-07-18  7:32 ` Boris BREZILLON
@ 2013-07-18  7:43   ` Boris BREZILLON
  -1 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:43 UTC (permalink / raw)
  To: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Felipe Balbi,
	Greg Kroah-Hartman
  Cc: linux-arm-kernel, linux-kernel, linux-usb, Boris BREZILLON

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 drivers/usb/gadget/atmel_usba_udc.c |   28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 1d97222..f018017 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1772,6 +1772,7 @@ out:
 static int atmel_usba_start(struct usb_gadget *gadget,
 		struct usb_gadget_driver *driver)
 {
+	int ret = 0;
 	struct usba_udc *udc = container_of(gadget, struct usba_udc, gadget);
 	unsigned long flags;
 
@@ -1781,8 +1782,14 @@ static int atmel_usba_start(struct usb_gadget *gadget,
 	udc->driver = driver;
 	spin_unlock_irqrestore(&udc->lock, flags);
 
-	clk_enable(udc->pclk);
-	clk_enable(udc->hclk);
+	ret = clk_prepare_enable(udc->pclk);
+	if (ret)
+		goto out;
+	ret = clk_prepare_enable(udc->hclk);
+	if (ret) {
+		clk_disable_unprepare(udc->pclk);
+		goto out;
+	}
 
 	DBG(DBG_GADGET, "registered driver `%s'\n", driver->driver.name);
 
@@ -1797,9 +1804,11 @@ static int atmel_usba_start(struct usb_gadget *gadget,
 		usba_writel(udc, CTRL, USBA_ENABLE_MASK);
 		usba_writel(udc, INT_ENB, USBA_END_OF_RESET);
 	}
+
+out:
 	spin_unlock_irqrestore(&udc->lock, flags);
 
-	return 0;
+	return ret;
 }
 
 static int atmel_usba_stop(struct usb_gadget *gadget,
@@ -1822,8 +1831,8 @@ static int atmel_usba_stop(struct usb_gadget *gadget,
 
 	udc->driver = NULL;
 
-	clk_disable(udc->hclk);
-	clk_disable(udc->pclk);
+	clk_disable_unprepare(udc->hclk);
+	clk_disable_unprepare(udc->pclk);
 
 	DBG(DBG_GADGET, "unregistered driver `%s'\n", driver->driver.name);
 
@@ -2022,10 +2031,14 @@ static int __init usba_udc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, udc);
 
 	/* Make sure we start from a clean slate */
-	clk_enable(pclk);
+	ret = clk_prepare_enable(pclk);
+	if (ret) {
+		dev_err(&pdev->dev, "Unable to enable pclk, aborting.\n");
+		goto err_clk_enable;
+	}
 	toggle_bias(0);
 	usba_writel(udc, CTRL, USBA_DISABLE_MASK);
-	clk_disable(pclk);
+	clk_disable_unprepare(pclk);
 
 	if (pdev->dev.of_node)
 		udc->usba_ep = atmel_udc_of_init(pdev, udc);
@@ -2081,6 +2094,7 @@ err_add_udc:
 	free_irq(irq, udc);
 err_request_irq:
 err_alloc_ep:
+err_clk_enable:
 	iounmap(udc->fifo);
 err_map_fifo:
 	iounmap(udc->regs);
-- 
1.7.9.5


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

* [PATCH v4 4/5] USB: gadget: atmel_usba: prepare clk before calling enable
@ 2013-07-18  7:43   ` Boris BREZILLON
  0 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:43 UTC (permalink / raw)
  To: linux-arm-kernel

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 drivers/usb/gadget/atmel_usba_udc.c |   28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 1d97222..f018017 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1772,6 +1772,7 @@ out:
 static int atmel_usba_start(struct usb_gadget *gadget,
 		struct usb_gadget_driver *driver)
 {
+	int ret = 0;
 	struct usba_udc *udc = container_of(gadget, struct usba_udc, gadget);
 	unsigned long flags;
 
@@ -1781,8 +1782,14 @@ static int atmel_usba_start(struct usb_gadget *gadget,
 	udc->driver = driver;
 	spin_unlock_irqrestore(&udc->lock, flags);
 
-	clk_enable(udc->pclk);
-	clk_enable(udc->hclk);
+	ret = clk_prepare_enable(udc->pclk);
+	if (ret)
+		goto out;
+	ret = clk_prepare_enable(udc->hclk);
+	if (ret) {
+		clk_disable_unprepare(udc->pclk);
+		goto out;
+	}
 
 	DBG(DBG_GADGET, "registered driver `%s'\n", driver->driver.name);
 
@@ -1797,9 +1804,11 @@ static int atmel_usba_start(struct usb_gadget *gadget,
 		usba_writel(udc, CTRL, USBA_ENABLE_MASK);
 		usba_writel(udc, INT_ENB, USBA_END_OF_RESET);
 	}
+
+out:
 	spin_unlock_irqrestore(&udc->lock, flags);
 
-	return 0;
+	return ret;
 }
 
 static int atmel_usba_stop(struct usb_gadget *gadget,
@@ -1822,8 +1831,8 @@ static int atmel_usba_stop(struct usb_gadget *gadget,
 
 	udc->driver = NULL;
 
-	clk_disable(udc->hclk);
-	clk_disable(udc->pclk);
+	clk_disable_unprepare(udc->hclk);
+	clk_disable_unprepare(udc->pclk);
 
 	DBG(DBG_GADGET, "unregistered driver `%s'\n", driver->driver.name);
 
@@ -2022,10 +2031,14 @@ static int __init usba_udc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, udc);
 
 	/* Make sure we start from a clean slate */
-	clk_enable(pclk);
+	ret = clk_prepare_enable(pclk);
+	if (ret) {
+		dev_err(&pdev->dev, "Unable to enable pclk, aborting.\n");
+		goto err_clk_enable;
+	}
 	toggle_bias(0);
 	usba_writel(udc, CTRL, USBA_DISABLE_MASK);
-	clk_disable(pclk);
+	clk_disable_unprepare(pclk);
 
 	if (pdev->dev.of_node)
 		udc->usba_ep = atmel_udc_of_init(pdev, udc);
@@ -2081,6 +2094,7 @@ err_add_udc:
 	free_irq(irq, udc);
 err_request_irq:
 err_alloc_ep:
+err_clk_enable:
 	iounmap(udc->fifo);
 err_map_fifo:
 	iounmap(udc->regs);
-- 
1.7.9.5

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

* [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
  2013-07-18  7:32 ` Boris BREZILLON
@ 2013-07-18  7:48   ` Boris BREZILLON
  -1 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:48 UTC (permalink / raw)
  To: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Arnd Bergmann,
	Greg Kroah-Hartman, Mark Brown
  Cc: linux-arm-kernel, linux-kernel, Boris BREZILLON

clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
may sleep and thus cannot be called in critical section.

This patch fix a bug introduced by commit
6f0d94790efe9f4481bbd7c174ef0e9b5e5db7c4 where clk_disable_unprepare was
called with user_lock hold.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 drivers/misc/atmel-ssc.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index f7b90661..e068a76 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -66,14 +66,19 @@ EXPORT_SYMBOL(ssc_request);
 
 void ssc_free(struct ssc_device *ssc)
 {
+	bool disable_clk = true;
+
 	spin_lock(&user_lock);
-	if (ssc->user) {
+	if (ssc->user)
 		ssc->user--;
-		clk_disable_unprepare(ssc->clk);
-	} else {
+	else {
+		disable_clk = false;
 		dev_dbg(&ssc->pdev->dev, "device already free\n");
 	}
 	spin_unlock(&user_lock);
+
+	if (disable_clk)
+		clk_disable_unprepare(ssc->clk);
 }
 EXPORT_SYMBOL(ssc_free);
 
-- 
1.7.9.5


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

* [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
@ 2013-07-18  7:48   ` Boris BREZILLON
  0 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:48 UTC (permalink / raw)
  To: linux-arm-kernel

clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
may sleep and thus cannot be called in critical section.

This patch fix a bug introduced by commit
6f0d94790efe9f4481bbd7c174ef0e9b5e5db7c4 where clk_disable_unprepare was
called with user_lock hold.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 drivers/misc/atmel-ssc.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index f7b90661..e068a76 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -66,14 +66,19 @@ EXPORT_SYMBOL(ssc_request);
 
 void ssc_free(struct ssc_device *ssc)
 {
+	bool disable_clk = true;
+
 	spin_lock(&user_lock);
-	if (ssc->user) {
+	if (ssc->user)
 		ssc->user--;
-		clk_disable_unprepare(ssc->clk);
-	} else {
+	else {
+		disable_clk = false;
 		dev_dbg(&ssc->pdev->dev, "device already free\n");
 	}
 	spin_unlock(&user_lock);
+
+	if (disable_clk)
+		clk_disable_unprepare(ssc->clk);
 }
 EXPORT_SYMBOL(ssc_free);
 
-- 
1.7.9.5

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

* [PATCH v4 1/5] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare.
  2013-07-18  7:32 ` Boris BREZILLON
@ 2013-07-18  7:58   ` Boris BREZILLON
  -1 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:58 UTC (permalink / raw)
  To: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, John Stultz, Thomas Gleixner
  Cc: linux-arm-kernel, linux-kernel, Boris BREZILLON

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 drivers/clocksource/tcb_clksrc.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
index 8a61872..229c019 100644
--- a/drivers/clocksource/tcb_clksrc.c
+++ b/drivers/clocksource/tcb_clksrc.c
@@ -100,7 +100,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 			|| tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) {
 		__raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR));
 		__raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR));
-		clk_disable(tcd->clk);
+		clk_disable_unprepare(tcd->clk);
 	}
 
 	switch (m) {
@@ -109,7 +109,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 	 * of oneshot, we get lower overhead and improved accuracy.
 	 */
 	case CLOCK_EVT_MODE_PERIODIC:
-		clk_enable(tcd->clk);
+		clk_prepare_enable(tcd->clk);
 
 		/* slow clock, count up to RC, then irq and restart */
 		__raw_writel(timer_clock
@@ -126,7 +126,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 		break;
 
 	case CLOCK_EVT_MODE_ONESHOT:
-		clk_enable(tcd->clk);
+		clk_prepare_enable(tcd->clk);
 
 		/* slow clock, count up to RC, then irq and stop */
 		__raw_writel(timer_clock | ATMEL_TC_CPCSTOP
@@ -275,7 +275,7 @@ static int __init tcb_clksrc_init(void)
 	pdev = tc->pdev;
 
 	t0_clk = tc->clk[0];
-	clk_enable(t0_clk);
+	clk_prepare_enable(t0_clk);
 
 	/* How fast will we be counting?  Pick something over 5 MHz.  */
 	rate = (u32) clk_get_rate(t0_clk);
@@ -313,7 +313,7 @@ static int __init tcb_clksrc_init(void)
 		/* tclib will give us three clocks no matter what the
 		 * underlying platform supports.
 		 */
-		clk_enable(tc->clk[1]);
+		clk_prepare_enable(tc->clk[1]);
 		/* setup both channel 0 & 1 */
 		tcb_setup_dual_chan(tc, best_divisor_idx);
 	}
-- 
1.7.9.5


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

* [PATCH v4 1/5] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare.
@ 2013-07-18  7:58   ` Boris BREZILLON
  0 siblings, 0 replies; 40+ messages in thread
From: Boris BREZILLON @ 2013-07-18  7:58 UTC (permalink / raw)
  To: linux-arm-kernel

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 drivers/clocksource/tcb_clksrc.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
index 8a61872..229c019 100644
--- a/drivers/clocksource/tcb_clksrc.c
+++ b/drivers/clocksource/tcb_clksrc.c
@@ -100,7 +100,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 			|| tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) {
 		__raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR));
 		__raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR));
-		clk_disable(tcd->clk);
+		clk_disable_unprepare(tcd->clk);
 	}
 
 	switch (m) {
@@ -109,7 +109,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 	 * of oneshot, we get lower overhead and improved accuracy.
 	 */
 	case CLOCK_EVT_MODE_PERIODIC:
-		clk_enable(tcd->clk);
+		clk_prepare_enable(tcd->clk);
 
 		/* slow clock, count up to RC, then irq and restart */
 		__raw_writel(timer_clock
@@ -126,7 +126,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
 		break;
 
 	case CLOCK_EVT_MODE_ONESHOT:
-		clk_enable(tcd->clk);
+		clk_prepare_enable(tcd->clk);
 
 		/* slow clock, count up to RC, then irq and stop */
 		__raw_writel(timer_clock | ATMEL_TC_CPCSTOP
@@ -275,7 +275,7 @@ static int __init tcb_clksrc_init(void)
 	pdev = tc->pdev;
 
 	t0_clk = tc->clk[0];
-	clk_enable(t0_clk);
+	clk_prepare_enable(t0_clk);
 
 	/* How fast will we be counting?  Pick something over 5 MHz.  */
 	rate = (u32) clk_get_rate(t0_clk);
@@ -313,7 +313,7 @@ static int __init tcb_clksrc_init(void)
 		/* tclib will give us three clocks no matter what the
 		 * underlying platform supports.
 		 */
-		clk_enable(tc->clk[1]);
+		clk_prepare_enable(tc->clk[1]);
 		/* setup both channel 0 & 1 */
 		tcb_setup_dual_chan(tc, best_divisor_idx);
 	}
-- 
1.7.9.5

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

* Re: [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
  2013-07-18  7:48   ` Boris BREZILLON
@ 2013-07-18  9:53     ` Mark Brown
  -1 siblings, 0 replies; 40+ messages in thread
From: Mark Brown @ 2013-07-18  9:53 UTC (permalink / raw)
  To: Boris BREZILLON
  Cc: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Arnd Bergmann,
	Greg Kroah-Hartman, linux-arm-kernel, linux-kernel

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

On Thu, Jul 18, 2013 at 09:48:40AM +0200, Boris BREZILLON wrote:
> clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
> may sleep and thus cannot be called in critical section.

I'm missing patches 1-4?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
@ 2013-07-18  9:53     ` Mark Brown
  0 siblings, 0 replies; 40+ messages in thread
From: Mark Brown @ 2013-07-18  9:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 18, 2013 at 09:48:40AM +0200, Boris BREZILLON wrote:
> clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
> may sleep and thus cannot be called in critical section.

I'm missing patches 1-4?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130718/b35734e3/attachment.sig>

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

* Re: [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
  2013-07-18  9:53     ` Mark Brown
@ 2013-07-18 10:21       ` boris brezillon
  -1 siblings, 0 replies; 40+ messages in thread
From: boris brezillon @ 2013-07-18 10:21 UTC (permalink / raw)
  To: Mark Brown
  Cc: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Arnd Bergmann,
	Greg Kroah-Hartman, linux-arm-kernel, linux-kernel

On 18/07/2013 11:53, Mark Brown wrote:
> On Thu, Jul 18, 2013 at 09:48:40AM +0200, Boris BREZILLON wrote:
>> clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
>> may sleep and thus cannot be called in critical section.
> I'm missing patches 1-4?
I can send you the whole series if you want (already sent to LKML and 
LAKML).

But I'd like to understand who I should send patches from this series to.

Here's my approach:
1) send all patches of the series to at91 maintainers (as they are 
directly concerned).
2) send all patches of the series LKML and LAKML
3) send each patch of the series to the persons and mailing lists 
concerned by this patch :
     contributors and maintainers (retrieved by get_maintainer.pl script)

Could you tell me if I'm doing something wrong?

Thanks

Best Regards,

Boris

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

* [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
@ 2013-07-18 10:21       ` boris brezillon
  0 siblings, 0 replies; 40+ messages in thread
From: boris brezillon @ 2013-07-18 10:21 UTC (permalink / raw)
  To: linux-arm-kernel

On 18/07/2013 11:53, Mark Brown wrote:
> On Thu, Jul 18, 2013 at 09:48:40AM +0200, Boris BREZILLON wrote:
>> clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
>> may sleep and thus cannot be called in critical section.
> I'm missing patches 1-4?
I can send you the whole series if you want (already sent to LKML and 
LAKML).

But I'd like to understand who I should send patches from this series to.

Here's my approach:
1) send all patches of the series to at91 maintainers (as they are 
directly concerned).
2) send all patches of the series LKML and LAKML
3) send each patch of the series to the persons and mailing lists 
concerned by this patch :
     contributors and maintainers (retrieved by get_maintainer.pl script)

Could you tell me if I'm doing something wrong?

Thanks

Best Regards,

Boris

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

* Re: [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
  2013-07-18 10:21       ` boris brezillon
@ 2013-07-18 10:58         ` Mark Brown
  -1 siblings, 0 replies; 40+ messages in thread
From: Mark Brown @ 2013-07-18 10:58 UTC (permalink / raw)
  To: boris brezillon
  Cc: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Arnd Bergmann,
	Greg Kroah-Hartman, linux-arm-kernel, linux-kernel

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

On Thu, Jul 18, 2013 at 12:21:38PM +0200, boris brezillon wrote:

> I can send you the whole series if you want (already sent to LKML
> and LAKML).

> But I'd like to understand who I should send patches from this series to.

When you send me patch 5/5 with no other information on the rest of the
series I've no idea if there's any dependencies on the other code or
anything like that.  The key thing here is to make sure the people
getting the patch can understand the interdependencies somehow.

If you're sending a bunch of unrelated changes with no dependencies
you're better off sending them all separately rather than as a part of a
series.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
@ 2013-07-18 10:58         ` Mark Brown
  0 siblings, 0 replies; 40+ messages in thread
From: Mark Brown @ 2013-07-18 10:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 18, 2013 at 12:21:38PM +0200, boris brezillon wrote:

> I can send you the whole series if you want (already sent to LKML
> and LAKML).

> But I'd like to understand who I should send patches from this series to.

When you send me patch 5/5 with no other information on the rest of the
series I've no idea if there's any dependencies on the other code or
anything like that.  The key thing here is to make sure the people
getting the patch can understand the interdependencies somehow.

If you're sending a bunch of unrelated changes with no dependencies
you're better off sending them all separately rather than as a part of a
series.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130718/d69af9e4/attachment.sig>

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

* Re: [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
  2013-07-18  7:48   ` Boris BREZILLON
@ 2013-07-18 11:25     ` Mark Brown
  -1 siblings, 0 replies; 40+ messages in thread
From: Mark Brown @ 2013-07-18 11:25 UTC (permalink / raw)
  To: Boris BREZILLON
  Cc: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Arnd Bergmann,
	Greg Kroah-Hartman, linux-arm-kernel, linux-kernel

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

On Thu, Jul 18, 2013 at 09:48:40AM +0200, Boris BREZILLON wrote:
> clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
> may sleep and thus cannot be called in critical section.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
@ 2013-07-18 11:25     ` Mark Brown
  0 siblings, 0 replies; 40+ messages in thread
From: Mark Brown @ 2013-07-18 11:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 18, 2013 at 09:48:40AM +0200, Boris BREZILLON wrote:
> clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
> may sleep and thus cannot be called in critical section.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130718/6a63d4cf/attachment-0001.sig>

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

* Re: [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
  2013-07-18 10:58         ` Mark Brown
@ 2013-07-18 11:33           ` boris brezillon
  -1 siblings, 0 replies; 40+ messages in thread
From: boris brezillon @ 2013-07-18 11:33 UTC (permalink / raw)
  To: Mark Brown
  Cc: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Arnd Bergmann,
	Greg Kroah-Hartman, linux-arm-kernel, linux-kernel

On 18/07/2013 12:58, Mark Brown wrote:
> On Thu, Jul 18, 2013 at 12:21:38PM +0200, boris brezillon wrote:
>
>> I can send you the whole series if you want (already sent to LKML
>> and LAKML).
>> But I'd like to understand who I should send patches from this series to.
> When you send me patch 5/5 with no other information on the rest of the
> series I've no idea if there's any dependencies on the other code or
> anything like that.  The key thing here is to make sure the people
> getting the patch can understand the interdependencies somehow.
>
> If you're sending a bunch of unrelated changes with no dependencies
> you're better off sending them all separately rather than as a part of a
> series.
Noted, I will send each patch separately next time (if they are unrelated).

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

* [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
@ 2013-07-18 11:33           ` boris brezillon
  0 siblings, 0 replies; 40+ messages in thread
From: boris brezillon @ 2013-07-18 11:33 UTC (permalink / raw)
  To: linux-arm-kernel

On 18/07/2013 12:58, Mark Brown wrote:
> On Thu, Jul 18, 2013 at 12:21:38PM +0200, boris brezillon wrote:
>
>> I can send you the whole series if you want (already sent to LKML
>> and LAKML).
>> But I'd like to understand who I should send patches from this series to.
> When you send me patch 5/5 with no other information on the rest of the
> series I've no idea if there's any dependencies on the other code or
> anything like that.  The key thing here is to make sure the people
> getting the patch can understand the interdependencies somehow.
>
> If you're sending a bunch of unrelated changes with no dependencies
> you're better off sending them all separately rather than as a part of a
> series.
Noted, I will send each patch separately next time (if they are unrelated).

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

* Re: [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
  2013-07-18 11:25     ` Mark Brown
@ 2013-07-18 11:34       ` boris brezillon
  -1 siblings, 0 replies; 40+ messages in thread
From: boris brezillon @ 2013-07-18 11:34 UTC (permalink / raw)
  To: Mark Brown
  Cc: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Arnd Bergmann,
	Greg Kroah-Hartman, linux-arm-kernel, linux-kernel

On 18/07/2013 13:25, Mark Brown wrote:
> On Thu, Jul 18, 2013 at 09:48:40AM +0200, Boris BREZILLON wrote:
>> clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
>> may sleep and thus cannot be called in critical section.
> Applied, thanks.
Thanks

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

* [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
@ 2013-07-18 11:34       ` boris brezillon
  0 siblings, 0 replies; 40+ messages in thread
From: boris brezillon @ 2013-07-18 11:34 UTC (permalink / raw)
  To: linux-arm-kernel

On 18/07/2013 13:25, Mark Brown wrote:
> On Thu, Jul 18, 2013 at 09:48:40AM +0200, Boris BREZILLON wrote:
>> clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
>> may sleep and thus cannot be called in critical section.
> Applied, thanks.
Thanks

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

* Re: [PATCH v4 0/5] ARM: at91: prepare transition to common clk framework
  2013-07-18  7:32 ` Boris BREZILLON
@ 2013-07-22 17:03   ` Jean-Christophe PLAGNIOL-VILLARD
  -1 siblings, 0 replies; 40+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-22 17:03 UTC (permalink / raw)
  To: Boris BREZILLON
  Cc: Nicolas Ferre, Ludovic Desroches, linux-arm-kernel, linux-kernel

On 09:32 Thu 18 Jul     , Boris BREZILLON wrote:
> Hello,
> 
> This patch series prepares the transition to common clk framework by
> replacing all the clk_enable and clk_disable calls by clk_prepare_unable and
> clk_disable_unprepare to avoid common clock framework warnings.
on the whole serie

Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

> 
> Best Regards,
> Boris
> 
> Changes since v3:
>  - move usb clock config patches out of this series
>  - move clk_prepare/unprepare calls out of critical sections (ssc and
>    mci drivers)
>  - remove already applied spi clk_prepare patch 
> 
> Changes since v2:
>  - add configuraton of usb clock in ohci and udc drivers
>  - add clk_prepare patch for usba udc driver
>  - add clk_prepare patch for spi driver
>  - remove already applied udc clk_prepare patch
> 
> Changes since v1:
>  - remove unneeded clk_unprepare in mci driver
>  - remove already applied patches (ehci, ohci, dma and serial)
> 
> Changes since common clk patch series:
>  - add clk_prepare_enable return check
>  - fix a deadlock in atmel-mci (missing spin_unlock)
>  - remove already applied patches (atmel-ssc and pwm-atmel-tcb)
> 
> Boris BREZILLON (5):
>   ARM: at91/tc/clocksource: replace clk_enable/disable with
>     clk_prepare_enable/disable_unprepare.
>   mmc: atmel-mci: prepare clk before calling enable
>   at91/avr32/atmel_lcdfb: prepare clk before calling enable
>   USB: gadget: atmel_usba: prepare clk before calling enable
>   ASoC: atmel-ssc: remove clk_disable_unprepare call from critical
>     section
> 
>  drivers/clocksource/tcb_clksrc.c    |   10 +++++-----
>  drivers/misc/atmel-ssc.c            |   11 ++++++++---
>  drivers/mmc/host/atmel-mci.c        |   34 +++++++++++++++++++++++++++-------
>  drivers/usb/gadget/atmel_usba_udc.c |   28 +++++++++++++++++++++-------
>  drivers/video/atmel_lcdfb.c         |    8 ++++----
>  5 files changed, 65 insertions(+), 26 deletions(-)
> 
> -- 
> 1.7.9.5
> 

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

* [PATCH v4 0/5] ARM: at91: prepare transition to common clk framework
@ 2013-07-22 17:03   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 40+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-22 17:03 UTC (permalink / raw)
  To: linux-arm-kernel

On 09:32 Thu 18 Jul     , Boris BREZILLON wrote:
> Hello,
> 
> This patch series prepares the transition to common clk framework by
> replacing all the clk_enable and clk_disable calls by clk_prepare_unable and
> clk_disable_unprepare to avoid common clock framework warnings.
on the whole serie

Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

> 
> Best Regards,
> Boris
> 
> Changes since v3:
>  - move usb clock config patches out of this series
>  - move clk_prepare/unprepare calls out of critical sections (ssc and
>    mci drivers)
>  - remove already applied spi clk_prepare patch 
> 
> Changes since v2:
>  - add configuraton of usb clock in ohci and udc drivers
>  - add clk_prepare patch for usba udc driver
>  - add clk_prepare patch for spi driver
>  - remove already applied udc clk_prepare patch
> 
> Changes since v1:
>  - remove unneeded clk_unprepare in mci driver
>  - remove already applied patches (ehci, ohci, dma and serial)
> 
> Changes since common clk patch series:
>  - add clk_prepare_enable return check
>  - fix a deadlock in atmel-mci (missing spin_unlock)
>  - remove already applied patches (atmel-ssc and pwm-atmel-tcb)
> 
> Boris BREZILLON (5):
>   ARM: at91/tc/clocksource: replace clk_enable/disable with
>     clk_prepare_enable/disable_unprepare.
>   mmc: atmel-mci: prepare clk before calling enable
>   at91/avr32/atmel_lcdfb: prepare clk before calling enable
>   USB: gadget: atmel_usba: prepare clk before calling enable
>   ASoC: atmel-ssc: remove clk_disable_unprepare call from critical
>     section
> 
>  drivers/clocksource/tcb_clksrc.c    |   10 +++++-----
>  drivers/misc/atmel-ssc.c            |   11 ++++++++---
>  drivers/mmc/host/atmel-mci.c        |   34 +++++++++++++++++++++++++++-------
>  drivers/usb/gadget/atmel_usba_udc.c |   28 +++++++++++++++++++++-------
>  drivers/video/atmel_lcdfb.c         |    8 ++++----
>  5 files changed, 65 insertions(+), 26 deletions(-)
> 
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH v4 1/5] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare.
  2013-07-18  7:58   ` Boris BREZILLON
@ 2013-08-21 12:13     ` Nicolas Ferre
  -1 siblings, 0 replies; 40+ messages in thread
From: Nicolas Ferre @ 2013-08-21 12:13 UTC (permalink / raw)
  To: Boris BREZILLON, John Stultz, Thomas Gleixner
  Cc: Ludovic Desroches, Jean-Christophe Plagniol-Villard,
	linux-arm-kernel, linux-kernel

On 18/07/2013 09:58, Boris BREZILLON :
> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> avoid common clk framework warnings.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

John, Thomas,

Do you want me to re-sent this patch with acked-by collected or you can 
take it like this?

Also, tell me if I should take it with other AT91-related changes 
through ARM-soc git tree?

Bye,

> ---
>   drivers/clocksource/tcb_clksrc.c |   10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
> index 8a61872..229c019 100644
> --- a/drivers/clocksource/tcb_clksrc.c
> +++ b/drivers/clocksource/tcb_clksrc.c
> @@ -100,7 +100,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
>   			|| tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) {
>   		__raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR));
>   		__raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR));
> -		clk_disable(tcd->clk);
> +		clk_disable_unprepare(tcd->clk);
>   	}
>
>   	switch (m) {
> @@ -109,7 +109,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
>   	 * of oneshot, we get lower overhead and improved accuracy.
>   	 */
>   	case CLOCK_EVT_MODE_PERIODIC:
> -		clk_enable(tcd->clk);
> +		clk_prepare_enable(tcd->clk);
>
>   		/* slow clock, count up to RC, then irq and restart */
>   		__raw_writel(timer_clock
> @@ -126,7 +126,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
>   		break;
>
>   	case CLOCK_EVT_MODE_ONESHOT:
> -		clk_enable(tcd->clk);
> +		clk_prepare_enable(tcd->clk);
>
>   		/* slow clock, count up to RC, then irq and stop */
>   		__raw_writel(timer_clock | ATMEL_TC_CPCSTOP
> @@ -275,7 +275,7 @@ static int __init tcb_clksrc_init(void)
>   	pdev = tc->pdev;
>
>   	t0_clk = tc->clk[0];
> -	clk_enable(t0_clk);
> +	clk_prepare_enable(t0_clk);
>
>   	/* How fast will we be counting?  Pick something over 5 MHz.  */
>   	rate = (u32) clk_get_rate(t0_clk);
> @@ -313,7 +313,7 @@ static int __init tcb_clksrc_init(void)
>   		/* tclib will give us three clocks no matter what the
>   		 * underlying platform supports.
>   		 */
> -		clk_enable(tc->clk[1]);
> +		clk_prepare_enable(tc->clk[1]);
>   		/* setup both channel 0 & 1 */
>   		tcb_setup_dual_chan(tc, best_divisor_idx);
>   	}
>


-- 
Nicolas Ferre

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

* [PATCH v4 1/5] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare.
@ 2013-08-21 12:13     ` Nicolas Ferre
  0 siblings, 0 replies; 40+ messages in thread
From: Nicolas Ferre @ 2013-08-21 12:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 18/07/2013 09:58, Boris BREZILLON :
> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> avoid common clk framework warnings.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

John, Thomas,

Do you want me to re-sent this patch with acked-by collected or you can 
take it like this?

Also, tell me if I should take it with other AT91-related changes 
through ARM-soc git tree?

Bye,

> ---
>   drivers/clocksource/tcb_clksrc.c |   10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
> index 8a61872..229c019 100644
> --- a/drivers/clocksource/tcb_clksrc.c
> +++ b/drivers/clocksource/tcb_clksrc.c
> @@ -100,7 +100,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
>   			|| tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) {
>   		__raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR));
>   		__raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR));
> -		clk_disable(tcd->clk);
> +		clk_disable_unprepare(tcd->clk);
>   	}
>
>   	switch (m) {
> @@ -109,7 +109,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
>   	 * of oneshot, we get lower overhead and improved accuracy.
>   	 */
>   	case CLOCK_EVT_MODE_PERIODIC:
> -		clk_enable(tcd->clk);
> +		clk_prepare_enable(tcd->clk);
>
>   		/* slow clock, count up to RC, then irq and restart */
>   		__raw_writel(timer_clock
> @@ -126,7 +126,7 @@ static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
>   		break;
>
>   	case CLOCK_EVT_MODE_ONESHOT:
> -		clk_enable(tcd->clk);
> +		clk_prepare_enable(tcd->clk);
>
>   		/* slow clock, count up to RC, then irq and stop */
>   		__raw_writel(timer_clock | ATMEL_TC_CPCSTOP
> @@ -275,7 +275,7 @@ static int __init tcb_clksrc_init(void)
>   	pdev = tc->pdev;
>
>   	t0_clk = tc->clk[0];
> -	clk_enable(t0_clk);
> +	clk_prepare_enable(t0_clk);
>
>   	/* How fast will we be counting?  Pick something over 5 MHz.  */
>   	rate = (u32) clk_get_rate(t0_clk);
> @@ -313,7 +313,7 @@ static int __init tcb_clksrc_init(void)
>   		/* tclib will give us three clocks no matter what the
>   		 * underlying platform supports.
>   		 */
> -		clk_enable(tc->clk[1]);
> +		clk_prepare_enable(tc->clk[1]);
>   		/* setup both channel 0 & 1 */
>   		tcb_setup_dual_chan(tc, best_divisor_idx);
>   	}
>


-- 
Nicolas Ferre

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

* Re: [PATCH v4 2/5] mmc: atmel-mci: prepare clk before calling enable
  2013-07-18  7:38   ` Boris BREZILLON
@ 2013-08-22  9:41     ` boris brezillon
  -1 siblings, 0 replies; 40+ messages in thread
From: boris brezillon @ 2013-08-22  9:41 UTC (permalink / raw)
  To: Chris Ball
  Cc: Boris BREZILLON, Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, linux-arm-kernel, linux-kernel,
	linux-mmc

Hello Chris,

Could you take this patch ?

It has been acked by Ludovic, and I need it in order to gracefully handle
at91's SoCs migration to common clk framework.

Thanks.

Best Regards,

Boris

On 18/07/2013 09:38, Boris BREZILLON wrote:
> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> avoid common clk framework warnings.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> ---
>   drivers/mmc/host/atmel-mci.c |   34 +++++++++++++++++++++++++++-------
>   1 file changed, 27 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index bdb84da..69e438e 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -378,6 +378,8 @@ static int atmci_regs_show(struct seq_file *s, void *v)
>   {
>   	struct atmel_mci	*host = s->private;
>   	u32			*buf;
> +	int			ret = 0;
> +
>   
>   	buf = kmalloc(ATMCI_REGS_SIZE, GFP_KERNEL);
>   	if (!buf)
> @@ -388,12 +390,16 @@ static int atmci_regs_show(struct seq_file *s, void *v)
>   	 * not disabling interrupts, so IMR and SR may not be
>   	 * consistent.
>   	 */
> +	ret = clk_prepare_enable(host->mck);
> +	if (ret)
> +		goto out;
> +
>   	spin_lock_bh(&host->lock);
> -	clk_enable(host->mck);
>   	memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
> -	clk_disable(host->mck);
>   	spin_unlock_bh(&host->lock);
>   
> +	clk_disable_unprepare(host->mck);
> +
>   	seq_printf(s, "MR:\t0x%08x%s%s ",
>   			buf[ATMCI_MR / 4],
>   			buf[ATMCI_MR / 4] & ATMCI_MR_RDPROOF ? " RDPROOF" : "",
> @@ -442,9 +448,10 @@ static int atmci_regs_show(struct seq_file *s, void *v)
>   				val & ATMCI_CFG_LSYNC ? " LSYNC" : "");
>   	}
>   
> +out:
>   	kfree(buf);
>   
> -	return 0;
> +	return ret;
>   }
>   
>   static int atmci_regs_open(struct inode *inode, struct file *file)
> @@ -1262,6 +1269,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   	struct atmel_mci_slot	*slot = mmc_priv(mmc);
>   	struct atmel_mci	*host = slot->host;
>   	unsigned int		i;
> +	bool			unprepare_clk;
>   
>   	slot->sdc_reg &= ~ATMCI_SDCBUS_MASK;
>   	switch (ios->bus_width) {
> @@ -1277,9 +1285,13 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   		unsigned int clock_min = ~0U;
>   		u32 clkdiv;
>   
> +		clk_prepare(host->mck);
> +		unprepare_clk = true;
> +
>   		spin_lock_bh(&host->lock);
>   		if (!host->mode_reg) {
>   			clk_enable(host->mck);
> +			unprepare_clk = false;
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
>   			if (host->caps.has_cfg_reg)
> @@ -1347,6 +1359,8 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   	} else {
>   		bool any_slot_active = false;
>   
> +		unprepare_clk = false;
> +
>   		spin_lock_bh(&host->lock);
>   		slot->clock = 0;
>   		for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
> @@ -1360,12 +1374,16 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   			if (host->mode_reg) {
>   				atmci_readl(host, ATMCI_MR);
>   				clk_disable(host->mck);
> +				unprepare_clk = true;
>   			}
>   			host->mode_reg = 0;
>   		}
>   		spin_unlock_bh(&host->lock);
>   	}
>   
> +	if (unprepare_clk)
> +		clk_unprepare(host->mck);
> +
>   	switch (ios->power_mode) {
>   	case MMC_POWER_UP:
>   		set_bit(ATMCI_CARD_NEED_INIT, &slot->flags);
> @@ -2376,10 +2394,12 @@ static int __init atmci_probe(struct platform_device *pdev)
>   	if (!host->regs)
>   		goto err_ioremap;
>   
> -	clk_enable(host->mck);
> +	ret = clk_prepare_enable(host->mck);
> +	if (ret)
> +		goto err_request_irq;
>   	atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
>   	host->bus_hz = clk_get_rate(host->mck);
> -	clk_disable(host->mck);
> +	clk_disable_unprepare(host->mck);
>   
>   	host->mapbase = regs->start;
>   
> @@ -2482,11 +2502,11 @@ static int __exit atmci_remove(struct platform_device *pdev)
>   			atmci_cleanup_slot(host->slot[i], i);
>   	}
>   
> -	clk_enable(host->mck);
> +	clk_prepare_enable(host->mck);
>   	atmci_writel(host, ATMCI_IDR, ~0UL);
>   	atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
>   	atmci_readl(host, ATMCI_SR);
> -	clk_disable(host->mck);
> +	clk_disable_unprepare(host->mck);
>   
>   	if (host->dma.chan)
>   		dma_release_channel(host->dma.chan);


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

* [PATCH v4 2/5] mmc: atmel-mci: prepare clk before calling enable
@ 2013-08-22  9:41     ` boris brezillon
  0 siblings, 0 replies; 40+ messages in thread
From: boris brezillon @ 2013-08-22  9:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Chris,

Could you take this patch ?

It has been acked by Ludovic, and I need it in order to gracefully handle
at91's SoCs migration to common clk framework.

Thanks.

Best Regards,

Boris

On 18/07/2013 09:38, Boris BREZILLON wrote:
> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> avoid common clk framework warnings.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> ---
>   drivers/mmc/host/atmel-mci.c |   34 +++++++++++++++++++++++++++-------
>   1 file changed, 27 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index bdb84da..69e438e 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -378,6 +378,8 @@ static int atmci_regs_show(struct seq_file *s, void *v)
>   {
>   	struct atmel_mci	*host = s->private;
>   	u32			*buf;
> +	int			ret = 0;
> +
>   
>   	buf = kmalloc(ATMCI_REGS_SIZE, GFP_KERNEL);
>   	if (!buf)
> @@ -388,12 +390,16 @@ static int atmci_regs_show(struct seq_file *s, void *v)
>   	 * not disabling interrupts, so IMR and SR may not be
>   	 * consistent.
>   	 */
> +	ret = clk_prepare_enable(host->mck);
> +	if (ret)
> +		goto out;
> +
>   	spin_lock_bh(&host->lock);
> -	clk_enable(host->mck);
>   	memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
> -	clk_disable(host->mck);
>   	spin_unlock_bh(&host->lock);
>   
> +	clk_disable_unprepare(host->mck);
> +
>   	seq_printf(s, "MR:\t0x%08x%s%s ",
>   			buf[ATMCI_MR / 4],
>   			buf[ATMCI_MR / 4] & ATMCI_MR_RDPROOF ? " RDPROOF" : "",
> @@ -442,9 +448,10 @@ static int atmci_regs_show(struct seq_file *s, void *v)
>   				val & ATMCI_CFG_LSYNC ? " LSYNC" : "");
>   	}
>   
> +out:
>   	kfree(buf);
>   
> -	return 0;
> +	return ret;
>   }
>   
>   static int atmci_regs_open(struct inode *inode, struct file *file)
> @@ -1262,6 +1269,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   	struct atmel_mci_slot	*slot = mmc_priv(mmc);
>   	struct atmel_mci	*host = slot->host;
>   	unsigned int		i;
> +	bool			unprepare_clk;
>   
>   	slot->sdc_reg &= ~ATMCI_SDCBUS_MASK;
>   	switch (ios->bus_width) {
> @@ -1277,9 +1285,13 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   		unsigned int clock_min = ~0U;
>   		u32 clkdiv;
>   
> +		clk_prepare(host->mck);
> +		unprepare_clk = true;
> +
>   		spin_lock_bh(&host->lock);
>   		if (!host->mode_reg) {
>   			clk_enable(host->mck);
> +			unprepare_clk = false;
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
>   			if (host->caps.has_cfg_reg)
> @@ -1347,6 +1359,8 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   	} else {
>   		bool any_slot_active = false;
>   
> +		unprepare_clk = false;
> +
>   		spin_lock_bh(&host->lock);
>   		slot->clock = 0;
>   		for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
> @@ -1360,12 +1374,16 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   			if (host->mode_reg) {
>   				atmci_readl(host, ATMCI_MR);
>   				clk_disable(host->mck);
> +				unprepare_clk = true;
>   			}
>   			host->mode_reg = 0;
>   		}
>   		spin_unlock_bh(&host->lock);
>   	}
>   
> +	if (unprepare_clk)
> +		clk_unprepare(host->mck);
> +
>   	switch (ios->power_mode) {
>   	case MMC_POWER_UP:
>   		set_bit(ATMCI_CARD_NEED_INIT, &slot->flags);
> @@ -2376,10 +2394,12 @@ static int __init atmci_probe(struct platform_device *pdev)
>   	if (!host->regs)
>   		goto err_ioremap;
>   
> -	clk_enable(host->mck);
> +	ret = clk_prepare_enable(host->mck);
> +	if (ret)
> +		goto err_request_irq;
>   	atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
>   	host->bus_hz = clk_get_rate(host->mck);
> -	clk_disable(host->mck);
> +	clk_disable_unprepare(host->mck);
>   
>   	host->mapbase = regs->start;
>   
> @@ -2482,11 +2502,11 @@ static int __exit atmci_remove(struct platform_device *pdev)
>   			atmci_cleanup_slot(host->slot[i], i);
>   	}
>   
> -	clk_enable(host->mck);
> +	clk_prepare_enable(host->mck);
>   	atmci_writel(host, ATMCI_IDR, ~0UL);
>   	atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
>   	atmci_readl(host, ATMCI_SR);
> -	clk_disable(host->mck);
> +	clk_disable_unprepare(host->mck);
>   
>   	if (host->dma.chan)
>   		dma_release_channel(host->dma.chan);

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

* Re: [PATCH v4 2/5] mmc: atmel-mci: prepare clk before calling enable
  2013-07-18  7:38   ` Boris BREZILLON
@ 2013-08-25  3:18     ` Chris Ball
  -1 siblings, 0 replies; 40+ messages in thread
From: Chris Ball @ 2013-08-25  3:18 UTC (permalink / raw)
  To: Boris BREZILLON
  Cc: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, linux-arm-kernel, linux-kernel,
	linux-mmc

Hi,

On Thu, Jul 18 2013, Boris BREZILLON wrote:
> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> avoid common clk framework warnings.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>

Okay, pushed to mmc-next for 3.12.

Boris, you got feedback from Thomas Petazzoni and Russell King, but
you didn't CC either of them on the patch v4, and you didn't write a
changelog explaining the differences between patches v3 and v4 --
please do both of those next time.

Also, it looks like the Ack from Ludovic happened away from the MMC
list, since I don't see a message from Ludovic on the thread here.
It would be better if the Ack happened somewhere I can see it.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>

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

* [PATCH v4 2/5] mmc: atmel-mci: prepare clk before calling enable
@ 2013-08-25  3:18     ` Chris Ball
  0 siblings, 0 replies; 40+ messages in thread
From: Chris Ball @ 2013-08-25  3:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Thu, Jul 18 2013, Boris BREZILLON wrote:
> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> avoid common clk framework warnings.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>

Okay, pushed to mmc-next for 3.12.

Boris, you got feedback from Thomas Petazzoni and Russell King, but
you didn't CC either of them on the patch v4, and you didn't write a
changelog explaining the differences between patches v3 and v4 --
please do both of those next time.

Also, it looks like the Ack from Ludovic happened away from the MMC
list, since I don't see a message from Ludovic on the thread here.
It would be better if the Ack happened somewhere I can see it.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>

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

* Re: [PATCH v4 2/5] mmc: atmel-mci: prepare clk before calling enable
  2013-08-25  3:18     ` Chris Ball
@ 2013-08-25  5:35       ` boris brezillon
  -1 siblings, 0 replies; 40+ messages in thread
From: boris brezillon @ 2013-08-25  5:35 UTC (permalink / raw)
  To: Chris Ball
  Cc: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, linux-arm-kernel, linux-kernel,
	linux-mmc

Hello Chris,

On 25/08/2013 05:18, Chris Ball wrote:
> Hi,
>
> On Thu, Jul 18 2013, Boris BREZILLON wrote:
>> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
>> avoid common clk framework warnings.
>>
>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Okay, pushed to mmc-next for 3.12.

Thanks.

>
> Boris, you got feedback from Thomas Petazzoni and Russell King, but
> you didn't CC either of them on the patch v4

I didn't knew I had to add the reviewers of a patch in the cc list
of the future versions. I'll do it next time.

> , and you didn't write a
> changelog explaining the differences between patches v3 and v4 --
> please do both of those next time.

The changelog is in the cover letter ("Changes since v3").
But I didn't send you this cover letter.

> Also, it looks like the Ack from Ludovic happened away from the MMC
> list, since I don't see a message from Ludovic on the thread here.
> It would be better if the Ack happened somewhere I can see it.

The 'Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>' was added
in the 2nd version of this patch series.
But I don't know if I should have kept it in this version since this 
patch has evolved.


Thanks for these feebacks, I'm still learning the good practices of the 
kernel
submission process.
I'll check these points next time.

Best Regards,

Boris
> Thanks,
>
> - Chris.


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

* [PATCH v4 2/5] mmc: atmel-mci: prepare clk before calling enable
@ 2013-08-25  5:35       ` boris brezillon
  0 siblings, 0 replies; 40+ messages in thread
From: boris brezillon @ 2013-08-25  5:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Chris,

On 25/08/2013 05:18, Chris Ball wrote:
> Hi,
>
> On Thu, Jul 18 2013, Boris BREZILLON wrote:
>> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
>> avoid common clk framework warnings.
>>
>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Okay, pushed to mmc-next for 3.12.

Thanks.

>
> Boris, you got feedback from Thomas Petazzoni and Russell King, but
> you didn't CC either of them on the patch v4

I didn't knew I had to add the reviewers of a patch in the cc list
of the future versions. I'll do it next time.

> , and you didn't write a
> changelog explaining the differences between patches v3 and v4 --
> please do both of those next time.

The changelog is in the cover letter ("Changes since v3").
But I didn't send you this cover letter.

> Also, it looks like the Ack from Ludovic happened away from the MMC
> list, since I don't see a message from Ludovic on the thread here.
> It would be better if the Ack happened somewhere I can see it.

The 'Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>' was added
in the 2nd version of this patch series.
But I don't know if I should have kept it in this version since this 
patch has evolved.


Thanks for these feebacks, I'm still learning the good practices of the 
kernel
submission process.
I'll check these points next time.

Best Regards,

Boris
> Thanks,
>
> - Chris.

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

* Re: [PATCH v4 3/5] at91/avr32/atmel_lcdfb: prepare clk before calling enable
  2013-07-18  7:40   ` Boris BREZILLON
  (?)
@ 2013-08-30  7:18     ` Tomi Valkeinen
  -1 siblings, 0 replies; 40+ messages in thread
From: Tomi Valkeinen @ 2013-08-30  7:18 UTC (permalink / raw)
  To: Boris BREZILLON
  Cc: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, linux-arm-kernel, linux-kernel,
	linux-fbdev

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

On 18/07/13 10:40, Boris BREZILLON wrote:
> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> avoid common clk framework warnings.
> 
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  drivers/video/atmel_lcdfb.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index ece49d5..bf9c5d0 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -954,14 +954,14 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
>  
>  static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
>  {
> -	clk_enable(sinfo->bus_clk);
> -	clk_enable(sinfo->lcdc_clk);
> +	clk_prepare_enable(sinfo->bus_clk);
> +	clk_prepare_enable(sinfo->lcdc_clk);
>  }
>  
>  static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
>  {
> -	clk_disable(sinfo->bus_clk);
> -	clk_disable(sinfo->lcdc_clk);
> +	clk_disable_unprepare(sinfo->bus_clk);
> +	clk_disable_unprepare(sinfo->lcdc_clk);
>  }
>  
>  #ifdef CONFIG_OF

Thanks, queued this for 3.12.

 Tomi




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

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

* Re: [PATCH v4 3/5] at91/avr32/atmel_lcdfb: prepare clk before calling enable
@ 2013-08-30  7:18     ` Tomi Valkeinen
  0 siblings, 0 replies; 40+ messages in thread
From: Tomi Valkeinen @ 2013-08-30  7:18 UTC (permalink / raw)
  To: linux-arm-kernel

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

On 18/07/13 10:40, Boris BREZILLON wrote:
> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> avoid common clk framework warnings.
> 
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  drivers/video/atmel_lcdfb.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index ece49d5..bf9c5d0 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -954,14 +954,14 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
>  
>  static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
>  {
> -	clk_enable(sinfo->bus_clk);
> -	clk_enable(sinfo->lcdc_clk);
> +	clk_prepare_enable(sinfo->bus_clk);
> +	clk_prepare_enable(sinfo->lcdc_clk);
>  }
>  
>  static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
>  {
> -	clk_disable(sinfo->bus_clk);
> -	clk_disable(sinfo->lcdc_clk);
> +	clk_disable_unprepare(sinfo->bus_clk);
> +	clk_disable_unprepare(sinfo->lcdc_clk);
>  }
>  
>  #ifdef CONFIG_OF

Thanks, queued this for 3.12.

 Tomi




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

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

* [PATCH v4 3/5] at91/avr32/atmel_lcdfb: prepare clk before calling enable
@ 2013-08-30  7:18     ` Tomi Valkeinen
  0 siblings, 0 replies; 40+ messages in thread
From: Tomi Valkeinen @ 2013-08-30  7:18 UTC (permalink / raw)
  To: linux-arm-kernel

On 18/07/13 10:40, Boris BREZILLON wrote:
> Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> avoid common clk framework warnings.
> 
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  drivers/video/atmel_lcdfb.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index ece49d5..bf9c5d0 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -954,14 +954,14 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
>  
>  static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
>  {
> -	clk_enable(sinfo->bus_clk);
> -	clk_enable(sinfo->lcdc_clk);
> +	clk_prepare_enable(sinfo->bus_clk);
> +	clk_prepare_enable(sinfo->lcdc_clk);
>  }
>  
>  static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
>  {
> -	clk_disable(sinfo->bus_clk);
> -	clk_disable(sinfo->lcdc_clk);
> +	clk_disable_unprepare(sinfo->bus_clk);
> +	clk_disable_unprepare(sinfo->lcdc_clk);
>  }
>  
>  #ifdef CONFIG_OF

Thanks, queued this for 3.12.

 Tomi



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130830/396f8749/attachment-0001.sig>

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

end of thread, other threads:[~2013-08-30  7:18 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-18  7:32 [PATCH v4 0/5] ARM: at91: prepare transition to common clk framework Boris BREZILLON
2013-07-18  7:32 ` Boris BREZILLON
2013-07-18  7:34 ` [PATCH v4 1/5] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare Boris BREZILLON
2013-07-18  7:34   ` Boris BREZILLON
2013-07-18  7:38 ` [PATCH v4 2/5] mmc: atmel-mci: prepare clk before calling enable Boris BREZILLON
2013-07-18  7:38   ` Boris BREZILLON
2013-08-22  9:41   ` boris brezillon
2013-08-22  9:41     ` boris brezillon
2013-08-25  3:18   ` Chris Ball
2013-08-25  3:18     ` Chris Ball
2013-08-25  5:35     ` boris brezillon
2013-08-25  5:35       ` boris brezillon
2013-07-18  7:40 ` [PATCH v4 3/5] at91/avr32/atmel_lcdfb: " Boris BREZILLON
2013-07-18  7:40   ` Boris BREZILLON
2013-07-18  7:40   ` Boris BREZILLON
2013-08-30  7:18   ` Tomi Valkeinen
2013-08-30  7:18     ` Tomi Valkeinen
2013-08-30  7:18     ` Tomi Valkeinen
2013-07-18  7:43 ` [PATCH v4 4/5] USB: gadget: atmel_usba: " Boris BREZILLON
2013-07-18  7:43   ` Boris BREZILLON
2013-07-18  7:48 ` [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section Boris BREZILLON
2013-07-18  7:48   ` Boris BREZILLON
2013-07-18  9:53   ` Mark Brown
2013-07-18  9:53     ` Mark Brown
2013-07-18 10:21     ` boris brezillon
2013-07-18 10:21       ` boris brezillon
2013-07-18 10:58       ` Mark Brown
2013-07-18 10:58         ` Mark Brown
2013-07-18 11:33         ` boris brezillon
2013-07-18 11:33           ` boris brezillon
2013-07-18 11:25   ` Mark Brown
2013-07-18 11:25     ` Mark Brown
2013-07-18 11:34     ` boris brezillon
2013-07-18 11:34       ` boris brezillon
2013-07-18  7:58 ` [PATCH v4 1/5] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare Boris BREZILLON
2013-07-18  7:58   ` Boris BREZILLON
2013-08-21 12:13   ` Nicolas Ferre
2013-08-21 12:13     ` Nicolas Ferre
2013-07-22 17:03 ` [PATCH v4 0/5] ARM: at91: prepare transition to common clk framework Jean-Christophe PLAGNIOL-VILLARD
2013-07-22 17:03   ` Jean-Christophe PLAGNIOL-VILLARD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.