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

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 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 (4):
  ARM: at91/tc/clocksource: replace clk_enable/disable with
    clk_prepare_enable/disable_unprepare.
  mmc: atmel-mci: prepare clk before calling enable
  usb: gadget: at91_udc: prepare clk before calling enable
  at91/avr32/atmel_lcdfb: prepare clk before calling enable

 drivers/clocksource/tcb_clksrc.c |   10 +++++-----
 drivers/mmc/host/atmel-mci.c     |   27 ++++++++++++++++++---------
 drivers/usb/gadget/at91_udc.c    |   14 ++++++++------
 drivers/video/atmel_lcdfb.c      |    8 ++++----
 4 files changed, 35 insertions(+), 24 deletions(-)

-- 
1.7.9.5


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

* [PATCH v2 0/4] ARM: at91: prepare transition to common clk framework
@ 2013-06-25  8:08 ` Boris BREZILLON
  0 siblings, 0 replies; 22+ messages in thread
From: Boris BREZILLON @ 2013-06-25  8:08 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 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 (4):
  ARM: at91/tc/clocksource: replace clk_enable/disable with
    clk_prepare_enable/disable_unprepare.
  mmc: atmel-mci: prepare clk before calling enable
  usb: gadget: at91_udc: prepare clk before calling enable
  at91/avr32/atmel_lcdfb: prepare clk before calling enable

 drivers/clocksource/tcb_clksrc.c |   10 +++++-----
 drivers/mmc/host/atmel-mci.c     |   27 ++++++++++++++++++---------
 drivers/usb/gadget/at91_udc.c    |   14 ++++++++------
 drivers/video/atmel_lcdfb.c      |    8 ++++----
 4 files changed, 35 insertions(+), 24 deletions(-)

-- 
1.7.9.5

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

* [PATCH v2 1/4] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare.
  2013-06-25  8:08 ` Boris BREZILLON
@ 2013-06-25  8:10   ` Boris BREZILLON
  -1 siblings, 0 replies; 22+ messages in thread
From: Boris BREZILLON @ 2013-06-25  8:10 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] 22+ messages in thread

* [PATCH v2 1/4] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare.
@ 2013-06-25  8:10   ` Boris BREZILLON
  0 siblings, 0 replies; 22+ messages in thread
From: Boris BREZILLON @ 2013-06-25  8:10 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] 22+ messages in thread

* [PATCH v2 2/4] mmc: atmel-mci: prepare clk before calling enable
  2013-06-25  8:08 ` Boris BREZILLON
@ 2013-06-25  8:11   ` Boris BREZILLON
  -1 siblings, 0 replies; 22+ messages in thread
From: Boris BREZILLON @ 2013-06-25  8:11 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>
---
 drivers/mmc/host/atmel-mci.c |   27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index e75774f..631c4cf 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -380,6 +380,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)
@@ -391,9 +393,13 @@ static int atmci_regs_show(struct seq_file *s, void *v)
 	 * consistent.
 	 */
 	spin_lock_bh(&host->lock);
-	clk_enable(host->mck);
+	ret = clk_prepare_enable(host->mck);
+	if (ret) {
+		spin_unlock_bh(&host->lock);
+		goto out;
+	}
 	memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
-	clk_disable(host->mck);
+	clk_disable_unprepare(host->mck);
 	spin_unlock_bh(&host->lock);
 
 	seq_printf(s, "MR:\t0x%08x%s%s ",
@@ -444,9 +450,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)
@@ -1281,7 +1288,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
 		spin_lock_bh(&host->lock);
 		if (!host->mode_reg) {
-			clk_enable(host->mck);
+			clk_prepare_enable(host->mck);
 			atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
 			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
 			if (host->caps.has_cfg_reg)
@@ -1361,7 +1368,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
 			if (host->mode_reg) {
 				atmci_readl(host, ATMCI_MR);
-				clk_disable(host->mck);
+				clk_disable_unprepare(host->mck);
 			}
 			host->mode_reg = 0;
 		}
@@ -2379,10 +2386,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;
 
@@ -2487,11 +2496,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] 22+ messages in thread

* [PATCH v2 2/4] mmc: atmel-mci: prepare clk before calling enable
@ 2013-06-25  8:11   ` Boris BREZILLON
  0 siblings, 0 replies; 22+ messages in thread
From: Boris BREZILLON @ 2013-06-25  8:11 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/mmc/host/atmel-mci.c |   27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index e75774f..631c4cf 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -380,6 +380,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)
@@ -391,9 +393,13 @@ static int atmci_regs_show(struct seq_file *s, void *v)
 	 * consistent.
 	 */
 	spin_lock_bh(&host->lock);
-	clk_enable(host->mck);
+	ret = clk_prepare_enable(host->mck);
+	if (ret) {
+		spin_unlock_bh(&host->lock);
+		goto out;
+	}
 	memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
-	clk_disable(host->mck);
+	clk_disable_unprepare(host->mck);
 	spin_unlock_bh(&host->lock);
 
 	seq_printf(s, "MR:\t0x%08x%s%s ",
@@ -444,9 +450,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)
@@ -1281,7 +1288,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
 		spin_lock_bh(&host->lock);
 		if (!host->mode_reg) {
-			clk_enable(host->mck);
+			clk_prepare_enable(host->mck);
 			atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
 			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
 			if (host->caps.has_cfg_reg)
@@ -1361,7 +1368,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
 			if (host->mode_reg) {
 				atmci_readl(host, ATMCI_MR);
-				clk_disable(host->mck);
+				clk_disable_unprepare(host->mck);
 			}
 			host->mode_reg = 0;
 		}
@@ -2379,10 +2386,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;
 
@@ -2487,11 +2496,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] 22+ messages in thread

* [PATCH v2 3/4] usb: gadget: at91_udc: prepare clk before calling enable
  2013-06-25  8:08 ` Boris BREZILLON
@ 2013-06-25  8:12   ` Boris BREZILLON
  -1 siblings, 0 replies; 22+ messages in thread
From: Boris BREZILLON @ 2013-06-25  8:12 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/at91_udc.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 073b938..fce8e4e 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -870,8 +870,8 @@ static void clk_on(struct at91_udc *udc)
 	if (udc->clocked)
 		return;
 	udc->clocked = 1;
-	clk_enable(udc->iclk);
-	clk_enable(udc->fclk);
+	clk_prepare_enable(udc->iclk);
+	clk_prepare_enable(udc->fclk);
 }
 
 static void clk_off(struct at91_udc *udc)
@@ -880,8 +880,8 @@ static void clk_off(struct at91_udc *udc)
 		return;
 	udc->clocked = 0;
 	udc->gadget.speed = USB_SPEED_UNKNOWN;
-	clk_disable(udc->fclk);
-	clk_disable(udc->iclk);
+	clk_disable_unprepare(udc->fclk);
+	clk_disable_unprepare(udc->iclk);
 }
 
 /*
@@ -1782,12 +1782,14 @@ static int at91udc_probe(struct platform_device *pdev)
 	}
 
 	/* don't do anything until we have both gadget driver and VBUS */
-	clk_enable(udc->iclk);
+	retval = clk_prepare_enable(udc->iclk);
+	if (retval)
+		goto fail1;
 	at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);
 	at91_udp_write(udc, AT91_UDP_IDR, 0xffffffff);
 	/* Clear all pending interrupts - UDP may be used by bootloader. */
 	at91_udp_write(udc, AT91_UDP_ICR, 0xffffffff);
-	clk_disable(udc->iclk);
+	clk_disable_unprepare(udc->iclk);
 
 	/* request UDC and maybe VBUS irqs */
 	udc->udp_irq = platform_get_irq(pdev, 0);
-- 
1.7.9.5


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

* [PATCH v2 3/4] usb: gadget: at91_udc: prepare clk before calling enable
@ 2013-06-25  8:12   ` Boris BREZILLON
  0 siblings, 0 replies; 22+ messages in thread
From: Boris BREZILLON @ 2013-06-25  8:12 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/at91_udc.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 073b938..fce8e4e 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -870,8 +870,8 @@ static void clk_on(struct at91_udc *udc)
 	if (udc->clocked)
 		return;
 	udc->clocked = 1;
-	clk_enable(udc->iclk);
-	clk_enable(udc->fclk);
+	clk_prepare_enable(udc->iclk);
+	clk_prepare_enable(udc->fclk);
 }
 
 static void clk_off(struct at91_udc *udc)
@@ -880,8 +880,8 @@ static void clk_off(struct at91_udc *udc)
 		return;
 	udc->clocked = 0;
 	udc->gadget.speed = USB_SPEED_UNKNOWN;
-	clk_disable(udc->fclk);
-	clk_disable(udc->iclk);
+	clk_disable_unprepare(udc->fclk);
+	clk_disable_unprepare(udc->iclk);
 }
 
 /*
@@ -1782,12 +1782,14 @@ static int at91udc_probe(struct platform_device *pdev)
 	}
 
 	/* don't do anything until we have both gadget driver and VBUS */
-	clk_enable(udc->iclk);
+	retval = clk_prepare_enable(udc->iclk);
+	if (retval)
+		goto fail1;
 	at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);
 	at91_udp_write(udc, AT91_UDP_IDR, 0xffffffff);
 	/* Clear all pending interrupts - UDP may be used by bootloader. */
 	at91_udp_write(udc, AT91_UDP_ICR, 0xffffffff);
-	clk_disable(udc->iclk);
+	clk_disable_unprepare(udc->iclk);
 
 	/* request UDC and maybe VBUS irqs */
 	udc->udp_irq = platform_get_irq(pdev, 0);
-- 
1.7.9.5

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

* [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
  2013-06-25  8:08 ` Boris BREZILLON
  (?)
@ 2013-06-25  8:14   ` Boris BREZILLON
  -1 siblings, 0 replies; 22+ messages in thread
From: Boris BREZILLON @ 2013-06-25  8:14 UTC (permalink / raw)
  To: Nicolas Ferre, Ludovic Desroches,
	Jean-Christophe Plagniol-Villard, Florian Tobias Schandinat
  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>
---
 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 540909d..8525457 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -893,14 +893,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);
 }
 
 
-- 
1.7.9.5


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

* [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
@ 2013-06-25  8:14   ` Boris BREZILLON
  0 siblings, 0 replies; 22+ messages in thread
From: Boris BREZILLON @ 2013-06-25  8:14 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/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 540909d..8525457 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -893,14 +893,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);
 }
 
 
-- 
1.7.9.5


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

* [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
@ 2013-06-25  8:14   ` Boris BREZILLON
  0 siblings, 0 replies; 22+ messages in thread
From: Boris BREZILLON @ 2013-06-25  8:14 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/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 540909d..8525457 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -893,14 +893,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);
 }
 
 
-- 
1.7.9.5

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

* Re: [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
  2013-06-25  8:14   ` Boris BREZILLON
  (?)
@ 2013-06-25  8:16     ` Nicolas Ferre
  -1 siblings, 0 replies; 22+ messages in thread
From: Nicolas Ferre @ 2013-06-25  8:16 UTC (permalink / raw)
  To: Boris BREZILLON, Jean-Christophe Plagniol-Villard
  Cc: Ludovic Desroches, Florian Tobias Schandinat, linux-arm-kernel,
	linux-kernel, linux-fbdev

On 25/06/2013 10:14, 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>

Jean-Christophe, can you take this one?

Thanks, best regards,

> ---
>   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 540909d..8525457 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -893,14 +893,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);
>   }
>
>
>


-- 
Nicolas Ferre

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

* Re: [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
@ 2013-06-25  8:16     ` Nicolas Ferre
  0 siblings, 0 replies; 22+ messages in thread
From: Nicolas Ferre @ 2013-06-25  8:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 25/06/2013 10:14, 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>

Jean-Christophe, can you take this one?

Thanks, best regards,

> ---
>   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 540909d..8525457 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -893,14 +893,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);
>   }
>
>
>


-- 
Nicolas Ferre

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

* [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
@ 2013-06-25  8:16     ` Nicolas Ferre
  0 siblings, 0 replies; 22+ messages in thread
From: Nicolas Ferre @ 2013-06-25  8:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 25/06/2013 10:14, 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>

Jean-Christophe, can you take this one?

Thanks, best regards,

> ---
>   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 540909d..8525457 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -893,14 +893,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);
>   }
>
>
>


-- 
Nicolas Ferre

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

* Re: [PATCH v2 2/4] mmc: atmel-mci: prepare clk before calling enable
  2013-06-25  8:11   ` Boris BREZILLON
  (?)
@ 2013-06-28  7:44     ` Nicolas Ferre
  -1 siblings, 0 replies; 22+ messages in thread
From: Nicolas Ferre @ 2013-06-28  7:44 UTC (permalink / raw)
  To: Boris BREZILLON
  Cc: Ludovic Desroches, Jean-Christophe Plagniol-Villard, Chris Ball,
	linux-arm-kernel, linux-kernel, linux-mmc

On 25/06/2013 10:11, 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>

It seems that you forgot the Acked-by line from Ludovic.

One comment...

> ---
>   drivers/mmc/host/atmel-mci.c |   27 ++++++++++++++++++---------
>   1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index e75774f..631c4cf 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -380,6 +380,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)
> @@ -391,9 +393,13 @@ static int atmci_regs_show(struct seq_file *s, void *v)
>   	 * consistent.
>   	 */
>   	spin_lock_bh(&host->lock);
> -	clk_enable(host->mck);
> +	ret = clk_prepare_enable(host->mck);

Do you think that it is needed here? I do not think it can be called 
before the probe() function and I do not know if the result can change 
depending on when clk_prepare_enable() is called...

> +	if (ret) {
> +		spin_unlock_bh(&host->lock);
> +		goto out;
> +	}
>   	memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
> -	clk_disable(host->mck);
> +	clk_disable_unprepare(host->mck);
>   	spin_unlock_bh(&host->lock);
>
>   	seq_printf(s, "MR:\t0x%08x%s%s ",
> @@ -444,9 +450,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)
> @@ -1281,7 +1288,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>
>   		spin_lock_bh(&host->lock);
>   		if (!host->mode_reg) {
> -			clk_enable(host->mck);
> +			clk_prepare_enable(host->mck);
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
>   			if (host->caps.has_cfg_reg)
> @@ -1361,7 +1368,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
>   			if (host->mode_reg) {
>   				atmci_readl(host, ATMCI_MR);
> -				clk_disable(host->mck);
> +				clk_disable_unprepare(host->mck);
>   			}
>   			host->mode_reg = 0;
>   		}
> @@ -2379,10 +2386,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;
>
> @@ -2487,11 +2496,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);
>


-- 
Nicolas Ferre

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

* Re: [PATCH v2 2/4] mmc: atmel-mci: prepare clk before calling enable
@ 2013-06-28  7:44     ` Nicolas Ferre
  0 siblings, 0 replies; 22+ messages in thread
From: Nicolas Ferre @ 2013-06-28  7:44 UTC (permalink / raw)
  To: Boris BREZILLON
  Cc: Ludovic Desroches, Jean-Christophe Plagniol-Villard, Chris Ball,
	linux-arm-kernel, linux-kernel, linux-mmc

On 25/06/2013 10:11, 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>

It seems that you forgot the Acked-by line from Ludovic.

One comment...

> ---
>   drivers/mmc/host/atmel-mci.c |   27 ++++++++++++++++++---------
>   1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index e75774f..631c4cf 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -380,6 +380,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)
> @@ -391,9 +393,13 @@ static int atmci_regs_show(struct seq_file *s, void *v)
>   	 * consistent.
>   	 */
>   	spin_lock_bh(&host->lock);
> -	clk_enable(host->mck);
> +	ret = clk_prepare_enable(host->mck);

Do you think that it is needed here? I do not think it can be called 
before the probe() function and I do not know if the result can change 
depending on when clk_prepare_enable() is called...

> +	if (ret) {
> +		spin_unlock_bh(&host->lock);
> +		goto out;
> +	}
>   	memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
> -	clk_disable(host->mck);
> +	clk_disable_unprepare(host->mck);
>   	spin_unlock_bh(&host->lock);
>
>   	seq_printf(s, "MR:\t0x%08x%s%s ",
> @@ -444,9 +450,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)
> @@ -1281,7 +1288,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>
>   		spin_lock_bh(&host->lock);
>   		if (!host->mode_reg) {
> -			clk_enable(host->mck);
> +			clk_prepare_enable(host->mck);
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
>   			if (host->caps.has_cfg_reg)
> @@ -1361,7 +1368,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
>   			if (host->mode_reg) {
>   				atmci_readl(host, ATMCI_MR);
> -				clk_disable(host->mck);
> +				clk_disable_unprepare(host->mck);
>   			}
>   			host->mode_reg = 0;
>   		}
> @@ -2379,10 +2386,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;
>
> @@ -2487,11 +2496,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);
>


-- 
Nicolas Ferre

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

* [PATCH v2 2/4] mmc: atmel-mci: prepare clk before calling enable
@ 2013-06-28  7:44     ` Nicolas Ferre
  0 siblings, 0 replies; 22+ messages in thread
From: Nicolas Ferre @ 2013-06-28  7:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 25/06/2013 10:11, 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>

It seems that you forgot the Acked-by line from Ludovic.

One comment...

> ---
>   drivers/mmc/host/atmel-mci.c |   27 ++++++++++++++++++---------
>   1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index e75774f..631c4cf 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -380,6 +380,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)
> @@ -391,9 +393,13 @@ static int atmci_regs_show(struct seq_file *s, void *v)
>   	 * consistent.
>   	 */
>   	spin_lock_bh(&host->lock);
> -	clk_enable(host->mck);
> +	ret = clk_prepare_enable(host->mck);

Do you think that it is needed here? I do not think it can be called 
before the probe() function and I do not know if the result can change 
depending on when clk_prepare_enable() is called...

> +	if (ret) {
> +		spin_unlock_bh(&host->lock);
> +		goto out;
> +	}
>   	memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
> -	clk_disable(host->mck);
> +	clk_disable_unprepare(host->mck);
>   	spin_unlock_bh(&host->lock);
>
>   	seq_printf(s, "MR:\t0x%08x%s%s ",
> @@ -444,9 +450,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)
> @@ -1281,7 +1288,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>
>   		spin_lock_bh(&host->lock);
>   		if (!host->mode_reg) {
> -			clk_enable(host->mck);
> +			clk_prepare_enable(host->mck);
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
>   			if (host->caps.has_cfg_reg)
> @@ -1361,7 +1368,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>   			atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
>   			if (host->mode_reg) {
>   				atmci_readl(host, ATMCI_MR);
> -				clk_disable(host->mck);
> +				clk_disable_unprepare(host->mck);
>   			}
>   			host->mode_reg = 0;
>   		}
> @@ -2379,10 +2386,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;
>
> @@ -2487,11 +2496,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);
>


-- 
Nicolas Ferre

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

* Re: [PATCH v2 2/4] mmc: atmel-mci: prepare clk before calling enable
  2013-06-28  7:44     ` Nicolas Ferre
@ 2013-06-28  8:06       ` boris brezillon
  -1 siblings, 0 replies; 22+ messages in thread
From: boris brezillon @ 2013-06-28  8:06 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Ludovic Desroches, Jean-Christophe Plagniol-Villard, Chris Ball,
	linux-arm-kernel, linux-kernel, linux-mmc

On 28/06/2013 09:44, Nicolas Ferre wrote:
> On 25/06/2013 10:11, 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>
>
> It seems that you forgot the Acked-by line from Ludovic.
>
> One comment...
>
>> ---
>>   drivers/mmc/host/atmel-mci.c |   27 ++++++++++++++++++---------
>>   1 file changed, 18 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
>> index e75774f..631c4cf 100644
>> --- a/drivers/mmc/host/atmel-mci.c
>> +++ b/drivers/mmc/host/atmel-mci.c
>> @@ -380,6 +380,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)
>> @@ -391,9 +393,13 @@ static int atmci_regs_show(struct seq_file *s, 
>> void *v)
>>        * consistent.
>>        */
>>       spin_lock_bh(&host->lock);
>> -    clk_enable(host->mck);
>> +    ret = clk_prepare_enable(host->mck);
>
> Do you think that it is needed here? I do not think it can be called 
> before the probe() function and I do not know if the result can change 
> depending on when clk_prepare_enable() is called...
Same as for other patches: it should not fail if this function is called 
after probe,
because the prepare and enable process already succeed once.

But I think this is better to keep the check wherever we can reflect the 
error to the caller:
the code will be more robust to clk framework or at91 clk implementation 
changes.

I know I told you this kind of check could be removed from dma driver, 
so this is a bit inconsistent.

It's up to you, tell me if you want me to remove this part.


>
>> +    if (ret) {
>> +        spin_unlock_bh(&host->lock);
>> +        goto out;
>> +    }
>>       memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
>> -    clk_disable(host->mck);
>> +    clk_disable_unprepare(host->mck);
>>       spin_unlock_bh(&host->lock);
>>
>>       seq_printf(s, "MR:\t0x%08x%s%s ",
>> @@ -444,9 +450,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)
>> @@ -1281,7 +1288,7 @@ static void atmci_set_ios(struct mmc_host *mmc, 
>> struct mmc_ios *ios)
>>
>>           spin_lock_bh(&host->lock);
>>           if (!host->mode_reg) {
>> -            clk_enable(host->mck);
>> +            clk_prepare_enable(host->mck);
>>               atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
>>               atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
>>               if (host->caps.has_cfg_reg)
>> @@ -1361,7 +1368,7 @@ static void atmci_set_ios(struct mmc_host *mmc, 
>> struct mmc_ios *ios)
>>               atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
>>               if (host->mode_reg) {
>>                   atmci_readl(host, ATMCI_MR);
>> -                clk_disable(host->mck);
>> +                clk_disable_unprepare(host->mck);
>>               }
>>               host->mode_reg = 0;
>>           }
>> @@ -2379,10 +2386,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;
>>
>> @@ -2487,11 +2496,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] 22+ messages in thread

* [PATCH v2 2/4] mmc: atmel-mci: prepare clk before calling enable
@ 2013-06-28  8:06       ` boris brezillon
  0 siblings, 0 replies; 22+ messages in thread
From: boris brezillon @ 2013-06-28  8:06 UTC (permalink / raw)
  To: linux-arm-kernel

On 28/06/2013 09:44, Nicolas Ferre wrote:
> On 25/06/2013 10:11, 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>
>
> It seems that you forgot the Acked-by line from Ludovic.
>
> One comment...
>
>> ---
>>   drivers/mmc/host/atmel-mci.c |   27 ++++++++++++++++++---------
>>   1 file changed, 18 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
>> index e75774f..631c4cf 100644
>> --- a/drivers/mmc/host/atmel-mci.c
>> +++ b/drivers/mmc/host/atmel-mci.c
>> @@ -380,6 +380,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)
>> @@ -391,9 +393,13 @@ static int atmci_regs_show(struct seq_file *s, 
>> void *v)
>>        * consistent.
>>        */
>>       spin_lock_bh(&host->lock);
>> -    clk_enable(host->mck);
>> +    ret = clk_prepare_enable(host->mck);
>
> Do you think that it is needed here? I do not think it can be called 
> before the probe() function and I do not know if the result can change 
> depending on when clk_prepare_enable() is called...
Same as for other patches: it should not fail if this function is called 
after probe,
because the prepare and enable process already succeed once.

But I think this is better to keep the check wherever we can reflect the 
error to the caller:
the code will be more robust to clk framework or at91 clk implementation 
changes.

I know I told you this kind of check could be removed from dma driver, 
so this is a bit inconsistent.

It's up to you, tell me if you want me to remove this part.


>
>> +    if (ret) {
>> +        spin_unlock_bh(&host->lock);
>> +        goto out;
>> +    }
>>       memcpy_fromio(buf, host->regs, ATMCI_REGS_SIZE);
>> -    clk_disable(host->mck);
>> +    clk_disable_unprepare(host->mck);
>>       spin_unlock_bh(&host->lock);
>>
>>       seq_printf(s, "MR:\t0x%08x%s%s ",
>> @@ -444,9 +450,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)
>> @@ -1281,7 +1288,7 @@ static void atmci_set_ios(struct mmc_host *mmc, 
>> struct mmc_ios *ios)
>>
>>           spin_lock_bh(&host->lock);
>>           if (!host->mode_reg) {
>> -            clk_enable(host->mck);
>> +            clk_prepare_enable(host->mck);
>>               atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
>>               atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
>>               if (host->caps.has_cfg_reg)
>> @@ -1361,7 +1368,7 @@ static void atmci_set_ios(struct mmc_host *mmc, 
>> struct mmc_ios *ios)
>>               atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIDIS);
>>               if (host->mode_reg) {
>>                   atmci_readl(host, ATMCI_MR);
>> -                clk_disable(host->mck);
>> +                clk_disable_unprepare(host->mck);
>>               }
>>               host->mode_reg = 0;
>>           }
>> @@ -2379,10 +2386,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;
>>
>> @@ -2487,11 +2496,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] 22+ messages in thread

* Re: [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
  2013-06-25  8:16     ` Nicolas Ferre
  (?)
@ 2013-07-03 11:10       ` Jean-Christophe PLAGNIOL-VILLARD
  -1 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-03 11:10 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Boris BREZILLON, Ludovic Desroches, Florian Tobias Schandinat,
	linux-arm-kernel, linux-kernel, linux-fbdev

On 10:16 Tue 25 Jun     , Nicolas Ferre wrote:
> On 25/06/2013 10:14, 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>
> 
> Jean-Christophe, can you take this one?

Yes I'll

Best Regards,
J.
> 
> Thanks, best regards,
> 
> >---
> >  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 540909d..8525457 100644
> >--- a/drivers/video/atmel_lcdfb.c
> >+++ b/drivers/video/atmel_lcdfb.c
> >@@ -893,14 +893,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);
> >  }
> >
> >
> >
> 
> 
> -- 
> Nicolas Ferre

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

* Re: [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
@ 2013-07-03 11:10       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-03 11:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 10:16 Tue 25 Jun     , Nicolas Ferre wrote:
> On 25/06/2013 10:14, 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>
> 
> Jean-Christophe, can you take this one?

Yes I'll

Best Regards,
J.
> 
> Thanks, best regards,
> 
> >---
> >  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 540909d..8525457 100644
> >--- a/drivers/video/atmel_lcdfb.c
> >+++ b/drivers/video/atmel_lcdfb.c
> >@@ -893,14 +893,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);
> >  }
> >
> >
> >
> 
> 
> -- 
> Nicolas Ferre

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

* [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
@ 2013-07-03 11:10       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-03 11:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 10:16 Tue 25 Jun     , Nicolas Ferre wrote:
> On 25/06/2013 10:14, 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>
> 
> Jean-Christophe, can you take this one?

Yes I'll

Best Regards,
J.
> 
> Thanks, best regards,
> 
> >---
> >  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 540909d..8525457 100644
> >--- a/drivers/video/atmel_lcdfb.c
> >+++ b/drivers/video/atmel_lcdfb.c
> >@@ -893,14 +893,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);
> >  }
> >
> >
> >
> 
> 
> -- 
> Nicolas Ferre

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

end of thread, other threads:[~2013-07-03 11:51 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-25  8:08 [PATCH v2 0/4] ARM: at91: prepare transition to common clk framework Boris BREZILLON
2013-06-25  8:08 ` Boris BREZILLON
2013-06-25  8:10 ` [PATCH v2 1/4] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare Boris BREZILLON
2013-06-25  8:10   ` Boris BREZILLON
2013-06-25  8:11 ` [PATCH v2 2/4] mmc: atmel-mci: prepare clk before calling enable Boris BREZILLON
2013-06-25  8:11   ` Boris BREZILLON
2013-06-28  7:44   ` Nicolas Ferre
2013-06-28  7:44     ` Nicolas Ferre
2013-06-28  7:44     ` Nicolas Ferre
2013-06-28  8:06     ` boris brezillon
2013-06-28  8:06       ` boris brezillon
2013-06-25  8:12 ` [PATCH v2 3/4] usb: gadget: at91_udc: " Boris BREZILLON
2013-06-25  8:12   ` Boris BREZILLON
2013-06-25  8:14 ` [PATCH v2 4/4] at91/avr32/atmel_lcdfb: " Boris BREZILLON
2013-06-25  8:14   ` Boris BREZILLON
2013-06-25  8:14   ` Boris BREZILLON
2013-06-25  8:16   ` Nicolas Ferre
2013-06-25  8:16     ` Nicolas Ferre
2013-06-25  8:16     ` Nicolas Ferre
2013-07-03 11:10     ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-03 11:10       ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-03 11:10       ` 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.