All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/5] serial: pxa: prepare/unprepare clocks
@ 2014-11-17 15:07 ` Dmitry Eremin-Solenikov
  0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 15:07 UTC (permalink / raw)
  To: Robert Jarzmik, Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman,
	Wolfram Sang, Samuel Ortiz, Lee Jones, Felipe Balbi
  Cc: Jiri Slaby, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

Change clk_enable/disable() calls to clk_prepare_enable() and
clk_disable_unprepare().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/tty/serial/pxa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 21b7d8b8..2f4c329 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -647,7 +647,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
 	unsigned long flags;
 	int locked = 1;
 
-	clk_enable(up->clk);
+	clk_prepare_enable(up->clk);
 	local_irq_save(flags);
 	if (up->port.sysrq)
 		locked = 0;
@@ -674,7 +674,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
 	if (locked)
 		spin_unlock(&up->port.lock);
 	local_irq_restore(flags);
-	clk_disable(up->clk);
+	clk_disable_unprepare(up->clk);
 
 }
 
-- 
2.1.1

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

* [PATCH V2 1/5] serial: pxa: prepare/unprepare clocks
@ 2014-11-17 15:07 ` Dmitry Eremin-Solenikov
  0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

Change clk_enable/disable() calls to clk_prepare_enable() and
clk_disable_unprepare().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/tty/serial/pxa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 21b7d8b8..2f4c329 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -647,7 +647,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
 	unsigned long flags;
 	int locked = 1;
 
-	clk_enable(up->clk);
+	clk_prepare_enable(up->clk);
 	local_irq_save(flags);
 	if (up->port.sysrq)
 		locked = 0;
@@ -674,7 +674,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
 	if (locked)
 		spin_unlock(&up->port.lock);
 	local_irq_restore(flags);
-	clk_disable(up->clk);
+	clk_disable_unprepare(up->clk);
 
 }
 
-- 
2.1.1

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

* [PATCH V2 2/5] i2c: pxa: prepare/unprepare clocks
  2014-11-17 15:07 ` Dmitry Eremin-Solenikov
@ 2014-11-17 15:07   ` Dmitry Eremin-Solenikov
  -1 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 15:07 UTC (permalink / raw)
  To: Robert Jarzmik, Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman,
	Wolfram Sang, Samuel Ortiz, Lee Jones, Felipe Balbi
  Cc: Jiri Slaby, linux-i2c, linux-arm-kernel, linux-serial, linux-usb

Change clk_enable/disable() calls to clk_prepare_enable() and
clk_disable_unprepare().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/i2c/busses/i2c-pxa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index be671f7..2e75375 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1297,7 +1297,7 @@ static int i2c_pxa_suspend_noirq(struct device *dev)
 	struct platform_device *pdev = to_platform_device(dev);
 	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
 
-	clk_disable(i2c->clk);
+	clk_disable_unprepare(i2c->clk);
 
 	return 0;
 }
@@ -1307,7 +1307,7 @@ static int i2c_pxa_resume_noirq(struct device *dev)
 	struct platform_device *pdev = to_platform_device(dev);
 	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
 
-	clk_enable(i2c->clk);
+	clk_prepare_enable(i2c->clk);
 	i2c_pxa_reset(i2c);
 
 	return 0;
-- 
2.1.1


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

* [PATCH V2 2/5] i2c: pxa: prepare/unprepare clocks
@ 2014-11-17 15:07   ` Dmitry Eremin-Solenikov
  0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

Change clk_enable/disable() calls to clk_prepare_enable() and
clk_disable_unprepare().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/i2c/busses/i2c-pxa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index be671f7..2e75375 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1297,7 +1297,7 @@ static int i2c_pxa_suspend_noirq(struct device *dev)
 	struct platform_device *pdev = to_platform_device(dev);
 	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
 
-	clk_disable(i2c->clk);
+	clk_disable_unprepare(i2c->clk);
 
 	return 0;
 }
@@ -1307,7 +1307,7 @@ static int i2c_pxa_resume_noirq(struct device *dev)
 	struct platform_device *pdev = to_platform_device(dev);
 	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
 
-	clk_enable(i2c->clk);
+	clk_prepare_enable(i2c->clk);
 	i2c_pxa_reset(i2c);
 
 	return 0;
-- 
2.1.1

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-17 15:07 ` Dmitry Eremin-Solenikov
@ 2014-11-17 15:07     ` Dmitry Eremin-Solenikov
  -1 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 15:07 UTC (permalink / raw)
  To: Robert Jarzmik, Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman,
	Wolfram Sang, Samuel Ortiz, Lee Jones, Felipe Balbi
  Cc: Jiri Slaby, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

Change clk_enable/disable() calls to clk_prepare_enable() and
clk_disable_unprepare().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/usb/gadget/udc/pxa25x_udc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
index 42f7eeb..e4964ee 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -103,8 +103,8 @@ static const char ep0name [] = "ep0";
 
 /* IXP doesn't yet support <linux/clk.h> */
 #define clk_get(dev,name)	NULL
-#define clk_enable(clk)		do { } while (0)
-#define clk_disable(clk)	do { } while (0)
+#define clk_prepare_enable(clk)	do { } while (0)
+#define clk_disable_unprepare(clk)	do { } while (0)
 #define clk_put(clk)		do { } while (0)
 
 #endif
@@ -932,7 +932,7 @@ static int pullup(struct pxa25x_udc *udc)
 		if (!udc->active) {
 			udc->active = 1;
 			/* Enable clock for USB device */
-			clk_enable(udc->clk);
+			clk_prepare_enable(udc->clk);
 			udc_enable(udc);
 		}
 	} else {
@@ -945,7 +945,7 @@ static int pullup(struct pxa25x_udc *udc)
 			}
 			udc_disable(udc);
 			/* Disable clock for USB device */
-			clk_disable(udc->clk);
+			clk_disable_unprepare(udc->clk);
 			udc->active = 0;
 		}
 
-- 
2.1.1

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
@ 2014-11-17 15:07     ` Dmitry Eremin-Solenikov
  0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

Change clk_enable/disable() calls to clk_prepare_enable() and
clk_disable_unprepare().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/usb/gadget/udc/pxa25x_udc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
index 42f7eeb..e4964ee 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -103,8 +103,8 @@ static const char ep0name [] = "ep0";
 
 /* IXP doesn't yet support <linux/clk.h> */
 #define clk_get(dev,name)	NULL
-#define clk_enable(clk)		do { } while (0)
-#define clk_disable(clk)	do { } while (0)
+#define clk_prepare_enable(clk)	do { } while (0)
+#define clk_disable_unprepare(clk)	do { } while (0)
 #define clk_put(clk)		do { } while (0)
 
 #endif
@@ -932,7 +932,7 @@ static int pullup(struct pxa25x_udc *udc)
 		if (!udc->active) {
 			udc->active = 1;
 			/* Enable clock for USB device */
-			clk_enable(udc->clk);
+			clk_prepare_enable(udc->clk);
 			udc_enable(udc);
 		}
 	} else {
@@ -945,7 +945,7 @@ static int pullup(struct pxa25x_udc *udc)
 			}
 			udc_disable(udc);
 			/* Disable clock for USB device */
-			clk_disable(udc->clk);
+			clk_disable_unprepare(udc->clk);
 			udc->active = 0;
 		}
 
-- 
2.1.1

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

* [PATCH V2 4/5] mfd: t7l66xb: prepare/unprepare clocks
  2014-11-17 15:07 ` Dmitry Eremin-Solenikov
@ 2014-11-17 15:07   ` Dmitry Eremin-Solenikov
  -1 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 15:07 UTC (permalink / raw)
  To: Robert Jarzmik, Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman,
	Wolfram Sang, Samuel Ortiz, Lee Jones, Felipe Balbi
  Cc: Jiri Slaby, linux-i2c, linux-arm-kernel, linux-serial, linux-usb

Change clk_enable/disable() calls to clk_prepare_enable() and
clk_disable_unprepare().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/mfd/t7l66xb.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index 9e04a74..439d905 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -87,7 +87,7 @@ static int t7l66xb_mmc_enable(struct platform_device *mmc)
 	unsigned long flags;
 	u8 dev_ctl;
 
-	clk_enable(t7l66xb->clk32k);
+	clk_prepare_enable(t7l66xb->clk32k);
 
 	spin_lock_irqsave(&t7l66xb->lock, flags);
 
@@ -118,7 +118,7 @@ static int t7l66xb_mmc_disable(struct platform_device *mmc)
 
 	spin_unlock_irqrestore(&t7l66xb->lock, flags);
 
-	clk_disable(t7l66xb->clk32k);
+	clk_disable_unprepare(t7l66xb->clk32k);
 
 	return 0;
 }
@@ -285,7 +285,7 @@ static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state)
 
 	if (pdata && pdata->suspend)
 		pdata->suspend(dev);
-	clk_disable(t7l66xb->clk48m);
+	clk_disable_unprepare(t7l66xb->clk48m);
 
 	return 0;
 }
@@ -295,7 +295,7 @@ static int t7l66xb_resume(struct platform_device *dev)
 	struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
 	struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev);
 
-	clk_enable(t7l66xb->clk48m);
+	clk_prepare_enable(t7l66xb->clk48m);
 	if (pdata && pdata->resume)
 		pdata->resume(dev);
 
@@ -369,7 +369,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 		goto err_ioremap;
 	}
 
-	clk_enable(t7l66xb->clk48m);
+	clk_prepare_enable(t7l66xb->clk48m);
 
 	if (pdata && pdata->enable)
 		pdata->enable(dev);
@@ -414,9 +414,9 @@ static int t7l66xb_remove(struct platform_device *dev)
 	int ret;
 
 	ret = pdata->disable(dev);
-	clk_disable(t7l66xb->clk48m);
+	clk_disable_unprepare(t7l66xb->clk48m);
 	clk_put(t7l66xb->clk48m);
-	clk_disable(t7l66xb->clk32k);
+	clk_disable_unprepare(t7l66xb->clk32k);
 	clk_put(t7l66xb->clk32k);
 	t7l66xb_detach_irq(dev);
 	iounmap(t7l66xb->scr);
-- 
2.1.1


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

* [PATCH V2 4/5] mfd: t7l66xb: prepare/unprepare clocks
@ 2014-11-17 15:07   ` Dmitry Eremin-Solenikov
  0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

Change clk_enable/disable() calls to clk_prepare_enable() and
clk_disable_unprepare().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/mfd/t7l66xb.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index 9e04a74..439d905 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -87,7 +87,7 @@ static int t7l66xb_mmc_enable(struct platform_device *mmc)
 	unsigned long flags;
 	u8 dev_ctl;
 
-	clk_enable(t7l66xb->clk32k);
+	clk_prepare_enable(t7l66xb->clk32k);
 
 	spin_lock_irqsave(&t7l66xb->lock, flags);
 
@@ -118,7 +118,7 @@ static int t7l66xb_mmc_disable(struct platform_device *mmc)
 
 	spin_unlock_irqrestore(&t7l66xb->lock, flags);
 
-	clk_disable(t7l66xb->clk32k);
+	clk_disable_unprepare(t7l66xb->clk32k);
 
 	return 0;
 }
@@ -285,7 +285,7 @@ static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state)
 
 	if (pdata && pdata->suspend)
 		pdata->suspend(dev);
-	clk_disable(t7l66xb->clk48m);
+	clk_disable_unprepare(t7l66xb->clk48m);
 
 	return 0;
 }
@@ -295,7 +295,7 @@ static int t7l66xb_resume(struct platform_device *dev)
 	struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
 	struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev);
 
-	clk_enable(t7l66xb->clk48m);
+	clk_prepare_enable(t7l66xb->clk48m);
 	if (pdata && pdata->resume)
 		pdata->resume(dev);
 
@@ -369,7 +369,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 		goto err_ioremap;
 	}
 
-	clk_enable(t7l66xb->clk48m);
+	clk_prepare_enable(t7l66xb->clk48m);
 
 	if (pdata && pdata->enable)
 		pdata->enable(dev);
@@ -414,9 +414,9 @@ static int t7l66xb_remove(struct platform_device *dev)
 	int ret;
 
 	ret = pdata->disable(dev);
-	clk_disable(t7l66xb->clk48m);
+	clk_disable_unprepare(t7l66xb->clk48m);
 	clk_put(t7l66xb->clk48m);
-	clk_disable(t7l66xb->clk32k);
+	clk_disable_unprepare(t7l66xb->clk32k);
 	clk_put(t7l66xb->clk32k);
 	t7l66xb_detach_irq(dev);
 	iounmap(t7l66xb->scr);
-- 
2.1.1

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

* [PATCH V2 5/5] mfd: tc6387xb: prepare/unprepare clocks
  2014-11-17 15:07 ` Dmitry Eremin-Solenikov
@ 2014-11-17 15:07     ` Dmitry Eremin-Solenikov
  -1 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 15:07 UTC (permalink / raw)
  To: Robert Jarzmik, Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman,
	Wolfram Sang, Samuel Ortiz, Lee Jones, Felipe Balbi
  Cc: Jiri Slaby, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

Change clk_enable/disable() calls to clk_prepare_enable() and
clk_disable_unprepare().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/mfd/tc6387xb.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/tc6387xb.c b/drivers/mfd/tc6387xb.c
index e71f880..85fab37 100644
--- a/drivers/mfd/tc6387xb.c
+++ b/drivers/mfd/tc6387xb.c
@@ -52,7 +52,7 @@ static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state)
 
 	if (pdata && pdata->suspend)
 		pdata->suspend(dev);
-	clk_disable(tc6387xb->clk32k);
+	clk_disable_unprepare(tc6387xb->clk32k);
 
 	return 0;
 }
@@ -62,7 +62,7 @@ static int tc6387xb_resume(struct platform_device *dev)
 	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
 	struct tc6387xb_platform_data *pdata = dev_get_platdata(&dev->dev);
 
-	clk_enable(tc6387xb->clk32k);
+	clk_prepare_enable(tc6387xb->clk32k);
 	if (pdata && pdata->resume)
 		pdata->resume(dev);
 
@@ -100,7 +100,7 @@ static int tc6387xb_mmc_enable(struct platform_device *mmc)
 	struct platform_device *dev      = to_platform_device(mmc->dev.parent);
 	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
 
-	clk_enable(tc6387xb->clk32k);
+	clk_prepare_enable(tc6387xb->clk32k);
 
 	tmio_core_mmc_enable(tc6387xb->scr + 0x200, 0,
 		tc6387xb_mmc_resources[0].start & 0xfffe);
@@ -113,7 +113,7 @@ static int tc6387xb_mmc_disable(struct platform_device *mmc)
 	struct platform_device *dev      = to_platform_device(mmc->dev.parent);
 	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
 
-	clk_disable(tc6387xb->clk32k);
+	clk_disable_unprepare(tc6387xb->clk32k);
 
 	return 0;
 }
@@ -214,7 +214,7 @@ static int tc6387xb_remove(struct platform_device *dev)
 	mfd_remove_devices(&dev->dev);
 	iounmap(tc6387xb->scr);
 	release_resource(&tc6387xb->rscr);
-	clk_disable(tc6387xb->clk32k);
+	clk_disable_unprepare(tc6387xb->clk32k);
 	clk_put(tc6387xb->clk32k);
 	kfree(tc6387xb);
 
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH V2 5/5] mfd: tc6387xb: prepare/unprepare clocks
@ 2014-11-17 15:07     ` Dmitry Eremin-Solenikov
  0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

Change clk_enable/disable() calls to clk_prepare_enable() and
clk_disable_unprepare().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/mfd/tc6387xb.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/tc6387xb.c b/drivers/mfd/tc6387xb.c
index e71f880..85fab37 100644
--- a/drivers/mfd/tc6387xb.c
+++ b/drivers/mfd/tc6387xb.c
@@ -52,7 +52,7 @@ static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state)
 
 	if (pdata && pdata->suspend)
 		pdata->suspend(dev);
-	clk_disable(tc6387xb->clk32k);
+	clk_disable_unprepare(tc6387xb->clk32k);
 
 	return 0;
 }
@@ -62,7 +62,7 @@ static int tc6387xb_resume(struct platform_device *dev)
 	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
 	struct tc6387xb_platform_data *pdata = dev_get_platdata(&dev->dev);
 
-	clk_enable(tc6387xb->clk32k);
+	clk_prepare_enable(tc6387xb->clk32k);
 	if (pdata && pdata->resume)
 		pdata->resume(dev);
 
@@ -100,7 +100,7 @@ static int tc6387xb_mmc_enable(struct platform_device *mmc)
 	struct platform_device *dev      = to_platform_device(mmc->dev.parent);
 	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
 
-	clk_enable(tc6387xb->clk32k);
+	clk_prepare_enable(tc6387xb->clk32k);
 
 	tmio_core_mmc_enable(tc6387xb->scr + 0x200, 0,
 		tc6387xb_mmc_resources[0].start & 0xfffe);
@@ -113,7 +113,7 @@ static int tc6387xb_mmc_disable(struct platform_device *mmc)
 	struct platform_device *dev      = to_platform_device(mmc->dev.parent);
 	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
 
-	clk_disable(tc6387xb->clk32k);
+	clk_disable_unprepare(tc6387xb->clk32k);
 
 	return 0;
 }
@@ -214,7 +214,7 @@ static int tc6387xb_remove(struct platform_device *dev)
 	mfd_remove_devices(&dev->dev);
 	iounmap(tc6387xb->scr);
 	release_resource(&tc6387xb->rscr);
-	clk_disable(tc6387xb->clk32k);
+	clk_disable_unprepare(tc6387xb->clk32k);
 	clk_put(tc6387xb->clk32k);
 	kfree(tc6387xb);
 
-- 
2.1.1

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

* Re: [PATCH V2 2/5] i2c: pxa: prepare/unprepare clocks
  2014-11-17 15:07   ` Dmitry Eremin-Solenikov
@ 2014-11-17 15:51     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 39+ messages in thread
From: Russell King - ARM Linux @ 2014-11-17 15:51 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov
  Cc: Robert Jarzmik, Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman,
	Wolfram Sang, Samuel Ortiz, Lee Jones, Felipe Balbi, linux-usb,
	Jiri Slaby, linux-i2c, linux-arm-kernel, linux-serial

On Mon, Nov 17, 2014 at 06:07:40PM +0300, Dmitry Eremin-Solenikov wrote:
> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  drivers/i2c/busses/i2c-pxa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index be671f7..2e75375 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -1297,7 +1297,7 @@ static int i2c_pxa_suspend_noirq(struct device *dev)
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
>  
> -	clk_disable(i2c->clk);
> +	clk_disable_unprepare(i2c->clk);

Since clk_unprepare() and clk_prepare() can sleep, it is unwise to call
these with IRQs disabled - the _noirq variants of these are run with
IRQs disabled.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

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

* [PATCH V2 2/5] i2c: pxa: prepare/unprepare clocks
@ 2014-11-17 15:51     ` Russell King - ARM Linux
  0 siblings, 0 replies; 39+ messages in thread
From: Russell King - ARM Linux @ 2014-11-17 15:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 17, 2014 at 06:07:40PM +0300, Dmitry Eremin-Solenikov wrote:
> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  drivers/i2c/busses/i2c-pxa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index be671f7..2e75375 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -1297,7 +1297,7 @@ static int i2c_pxa_suspend_noirq(struct device *dev)
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
>  
> -	clk_disable(i2c->clk);
> +	clk_disable_unprepare(i2c->clk);

Since clk_unprepare() and clk_prepare() can sleep, it is unwise to call
these with IRQs disabled - the _noirq variants of these are run with
IRQs disabled.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

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

* Re: [PATCH V2 1/5] serial: pxa: prepare/unprepare clocks
  2014-11-17 15:07 ` Dmitry Eremin-Solenikov
@ 2014-11-17 15:51     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 39+ messages in thread
From: Russell King - ARM Linux @ 2014-11-17 15:51 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov
  Cc: Robert Jarzmik, Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman,
	Wolfram Sang, Samuel Ortiz, Lee Jones, Felipe Balbi,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Jiri Slaby,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA

On Mon, Nov 17, 2014 at 06:07:39PM +0300, Dmitry Eremin-Solenikov wrote:
> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().

NAK.  Console writes can be called from IRQs-off regions.  clk_prepare()
can sleep.  Sleeping is not permitted with IRQs off.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

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

* [PATCH V2 1/5] serial: pxa: prepare/unprepare clocks
@ 2014-11-17 15:51     ` Russell King - ARM Linux
  0 siblings, 0 replies; 39+ messages in thread
From: Russell King - ARM Linux @ 2014-11-17 15:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 17, 2014 at 06:07:39PM +0300, Dmitry Eremin-Solenikov wrote:
> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().

NAK.  Console writes can be called from IRQs-off regions.  clk_prepare()
can sleep.  Sleeping is not permitted with IRQs off.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

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

* Re: [PATCH V2 2/5] i2c: pxa: prepare/unprepare clocks
  2014-11-17 15:07   ` Dmitry Eremin-Solenikov
@ 2014-11-17 18:26       ` Wolfram Sang
  -1 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2014-11-17 18:26 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov
  Cc: Robert Jarzmik, Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman,
	Samuel Ortiz, Lee Jones, Felipe Balbi, Jiri Slaby,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

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

On Mon, Nov 17, 2014 at 06:07:40PM +0300, Dmitry Eremin-Solenikov wrote:
> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().

You describe what is done but we can see that from the patch. Please
describe here why the change is needed.

> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/i2c/busses/i2c-pxa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index be671f7..2e75375 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -1297,7 +1297,7 @@ static int i2c_pxa_suspend_noirq(struct device *dev)
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
>  
> -	clk_disable(i2c->clk);
> +	clk_disable_unprepare(i2c->clk);
>  
>  	return 0;
>  }
> @@ -1307,7 +1307,7 @@ static int i2c_pxa_resume_noirq(struct device *dev)
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
>  
> -	clk_enable(i2c->clk);
> +	clk_prepare_enable(i2c->clk);
>  	i2c_pxa_reset(i2c);
>  
>  	return 0;
> -- 
> 2.1.1
> 

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

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

* [PATCH V2 2/5] i2c: pxa: prepare/unprepare clocks
@ 2014-11-17 18:26       ` Wolfram Sang
  0 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2014-11-17 18:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 17, 2014 at 06:07:40PM +0300, Dmitry Eremin-Solenikov wrote:
> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().

You describe what is done but we can see that from the patch. Please
describe here why the change is needed.

> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  drivers/i2c/busses/i2c-pxa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index be671f7..2e75375 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -1297,7 +1297,7 @@ static int i2c_pxa_suspend_noirq(struct device *dev)
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
>  
> -	clk_disable(i2c->clk);
> +	clk_disable_unprepare(i2c->clk);
>  
>  	return 0;
>  }
> @@ -1307,7 +1307,7 @@ static int i2c_pxa_resume_noirq(struct device *dev)
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
>  
> -	clk_enable(i2c->clk);
> +	clk_prepare_enable(i2c->clk);
>  	i2c_pxa_reset(i2c);
>  
>  	return 0;
> -- 
> 2.1.1
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141117/7086b8e0/attachment.sig>

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

* Re: [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-17 15:07     ` Dmitry Eremin-Solenikov
@ 2014-11-17 18:44       ` Robert Jarzmik
  -1 siblings, 0 replies; 39+ messages in thread
From: Robert Jarzmik @ 2014-11-17 18:44 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov
  Cc: Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman, Wolfram Sang,
	Samuel Ortiz, Lee Jones, Felipe Balbi, Jiri Slaby, linux-i2c,
	linux-arm-kernel, linux-serial, linux-usb

Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:

> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  drivers/usb/gadget/udc/pxa25x_udc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
> index 42f7eeb..e4964ee 100644
> --- a/drivers/usb/gadget/udc/pxa25x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa25x_udc.c
> @@ -103,8 +103,8 @@ static const char ep0name [] = "ep0";
>  
>  /* IXP doesn't yet support <linux/clk.h> */
>  #define clk_get(dev,name)	NULL
> -#define clk_enable(clk)		do { } while (0)
> -#define clk_disable(clk)	do { } while (0)
> +#define clk_prepare_enable(clk)	do { } while (0)
> +#define clk_disable_unprepare(clk)	do { } while (0)
>  #define clk_put(clk)		do { } while (0)
>  
>  #endif
> @@ -932,7 +932,7 @@ static int pullup(struct pxa25x_udc *udc)
>  		if (!udc->active) {
>  			udc->active = 1;
>  			/* Enable clock for USB device */
> -			clk_enable(udc->clk);
> +			clk_prepare_enable(udc->clk);

Guess what, Russell's remark on i2c and serial made me cross-check.  And there
is a case where this will be called in irq context too ...

See :
-> do_IRQ
  -> lubbock_vbus_irq()
    -> pxa25x_udc_vbus_session()
      -> pullup()
        -> clk_prepare_enable()
          -> CRACK

Note that your patch is not really the faulty one, I think a threaded irq
instead of the "raw" irq should do the trick. And it is granted on UDC api that
vbus function is called in a "sleeping" context (Felipe correct me if I'm
wrong), so a patch to fix this before your current code would be fine.

Cheers.

--
Robert

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
@ 2014-11-17 18:44       ` Robert Jarzmik
  0 siblings, 0 replies; 39+ messages in thread
From: Robert Jarzmik @ 2014-11-17 18:44 UTC (permalink / raw)
  To: linux-arm-kernel

Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:

> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  drivers/usb/gadget/udc/pxa25x_udc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
> index 42f7eeb..e4964ee 100644
> --- a/drivers/usb/gadget/udc/pxa25x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa25x_udc.c
> @@ -103,8 +103,8 @@ static const char ep0name [] = "ep0";
>  
>  /* IXP doesn't yet support <linux/clk.h> */
>  #define clk_get(dev,name)	NULL
> -#define clk_enable(clk)		do { } while (0)
> -#define clk_disable(clk)	do { } while (0)
> +#define clk_prepare_enable(clk)	do { } while (0)
> +#define clk_disable_unprepare(clk)	do { } while (0)
>  #define clk_put(clk)		do { } while (0)
>  
>  #endif
> @@ -932,7 +932,7 @@ static int pullup(struct pxa25x_udc *udc)
>  		if (!udc->active) {
>  			udc->active = 1;
>  			/* Enable clock for USB device */
> -			clk_enable(udc->clk);
> +			clk_prepare_enable(udc->clk);

Guess what, Russell's remark on i2c and serial made me cross-check.  And there
is a case where this will be called in irq context too ...

See :
-> do_IRQ
  -> lubbock_vbus_irq()
    -> pxa25x_udc_vbus_session()
      -> pullup()
        -> clk_prepare_enable()
          -> CRACK

Note that your patch is not really the faulty one, I think a threaded irq
instead of the "raw" irq should do the trick. And it is granted on UDC api that
vbus function is called in a "sleeping" context (Felipe correct me if I'm
wrong), so a patch to fix this before your current code would be fine.

Cheers.

--
Robert

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-17 18:44       ` Robert Jarzmik
  (?)
@ 2014-11-17 20:05       ` Dmitry Eremin-Solenikov
  2014-11-17 20:07         ` Russell King - ARM Linux
                           ` (3 more replies)
  -1 siblings, 4 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 20:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

2014-11-17 21:44 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:
>
>> Change clk_enable/disable() calls to clk_prepare_enable() and
>> clk_disable_unprepare().
>>
>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
>> ---
>>  drivers/usb/gadget/udc/pxa25x_udc.c | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
>> index 42f7eeb..e4964ee 100644
>> --- a/drivers/usb/gadget/udc/pxa25x_udc.c
>> +++ b/drivers/usb/gadget/udc/pxa25x_udc.c
>> @@ -103,8 +103,8 @@ static const char ep0name [] = "ep0";
>>
>>  /* IXP doesn't yet support <linux/clk.h> */
>>  #define clk_get(dev,name)    NULL
>> -#define clk_enable(clk)              do { } while (0)
>> -#define clk_disable(clk)     do { } while (0)
>> +#define clk_prepare_enable(clk)      do { } while (0)
>> +#define clk_disable_unprepare(clk)   do { } while (0)
>>  #define clk_put(clk)         do { } while (0)
>>
>>  #endif
>> @@ -932,7 +932,7 @@ static int pullup(struct pxa25x_udc *udc)
>>               if (!udc->active) {
>>                       udc->active = 1;
>>                       /* Enable clock for USB device */
>> -                     clk_enable(udc->clk);
>> +                     clk_prepare_enable(udc->clk);
>
> Guess what, Russell's remark on i2c and serial made me cross-check.  And there
> is a case where this will be called in irq context too ...
>
> See :
> -> do_IRQ
>   -> lubbock_vbus_irq()
>     -> pxa25x_udc_vbus_session()
>       -> pullup()
>         -> clk_prepare_enable()
>           -> CRACK
>
> Note that your patch is not really the faulty one, I think a threaded irq
> instead of the "raw" irq should do the trick. And it is granted on UDC api that
> vbus function is called in a "sleeping" context (Felipe correct me if I'm
> wrong), so a patch to fix this before your current code would be fine.

OK, I will take a look. It seems the correct way would be to strip this code
away to a phy, like gpio-vbus or nop phys. Do you have access to lubbock
(or maybe Daniel, Haojian or Russell has?)?

Also, as we are at it.  Imre, Krzysztof, IIRC ixp4xx platform does not provide
clock api either in a form of COMMON_CLK or in a local hacked form
(like sa1100 does). Do you plan to add any in future, or it just does not
make sense to support this API for ixp4xx?

-- 
With best wishes
Dmitry

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-17 20:05       ` Dmitry Eremin-Solenikov
@ 2014-11-17 20:07         ` Russell King - ARM Linux
  2014-11-17 20:09         ` Robert Jarzmik
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 39+ messages in thread
From: Russell King - ARM Linux @ 2014-11-17 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 18, 2014 at 12:05:45AM +0400, Dmitry Eremin-Solenikov wrote:
> Hello,
> 
> 2014-11-17 21:44 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> > Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:
> >
> >> Change clk_enable/disable() calls to clk_prepare_enable() and
> >> clk_disable_unprepare().
> >>
> >> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> >> ---
> >>  drivers/usb/gadget/udc/pxa25x_udc.c | 8 ++++----
> >>  1 file changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
> >> index 42f7eeb..e4964ee 100644
> >> --- a/drivers/usb/gadget/udc/pxa25x_udc.c
> >> +++ b/drivers/usb/gadget/udc/pxa25x_udc.c
> >> @@ -103,8 +103,8 @@ static const char ep0name [] = "ep0";
> >>
> >>  /* IXP doesn't yet support <linux/clk.h> */
> >>  #define clk_get(dev,name)    NULL
> >> -#define clk_enable(clk)              do { } while (0)
> >> -#define clk_disable(clk)     do { } while (0)
> >> +#define clk_prepare_enable(clk)      do { } while (0)
> >> +#define clk_disable_unprepare(clk)   do { } while (0)
> >>  #define clk_put(clk)         do { } while (0)
> >>
> >>  #endif
> >> @@ -932,7 +932,7 @@ static int pullup(struct pxa25x_udc *udc)
> >>               if (!udc->active) {
> >>                       udc->active = 1;
> >>                       /* Enable clock for USB device */
> >> -                     clk_enable(udc->clk);
> >> +                     clk_prepare_enable(udc->clk);
> >
> > Guess what, Russell's remark on i2c and serial made me cross-check.  And there
> > is a case where this will be called in irq context too ...
> >
> > See :
> > -> do_IRQ
> >   -> lubbock_vbus_irq()
> >     -> pxa25x_udc_vbus_session()
> >       -> pullup()
> >         -> clk_prepare_enable()
> >           -> CRACK
> >
> > Note that your patch is not really the faulty one, I think a threaded irq
> > instead of the "raw" irq should do the trick. And it is granted on UDC api that
> > vbus function is called in a "sleeping" context (Felipe correct me if I'm
> > wrong), so a patch to fix this before your current code would be fine.
> 
> OK, I will take a look. It seems the correct way would be to strip this code
> away to a phy, like gpio-vbus or nop phys. Do you have access to lubbock
> (or maybe Daniel, Haojian or Russell has?)?

Robert has my Lubbock now.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-17 20:05       ` Dmitry Eremin-Solenikov
  2014-11-17 20:07         ` Russell King - ARM Linux
@ 2014-11-17 20:09         ` Robert Jarzmik
  2014-11-17 23:50         ` Dmitry Eremin-Solenikov
  2014-11-18 15:49         ` [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp Felipe Balbi
  3 siblings, 0 replies; 39+ messages in thread
From: Robert Jarzmik @ 2014-11-17 20:09 UTC (permalink / raw)
  To: linux-arm-kernel

Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:

> Hello,
> OK, I will take a look. It seems the correct way would be to strip this code
> away to a phy, like gpio-vbus or nop phys. Do you have access to lubbock
> (or maybe Daniel, Haojian or Russell has?)?
Actually Russell kindly gave me his, so I do have one for testing :)

> Also, as we are at it.  Imre, Krzysztof, IIRC ixp4xx platform does not provide
> clock api either in a form of COMMON_CLK or in a local hacked form
> (like sa1100 does). Do you plan to add any in future, or it just does not
> make sense to support this API for ixp4xx?
I don't have any plans for ixp4xx.

Cheers.

-- 
Robert

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-17 20:05       ` Dmitry Eremin-Solenikov
  2014-11-17 20:07         ` Russell King - ARM Linux
  2014-11-17 20:09         ` Robert Jarzmik
@ 2014-11-17 23:50         ` Dmitry Eremin-Solenikov
  2014-11-19 20:29           ` Robert Jarzmik
  2014-11-18 15:49         ` [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp Felipe Balbi
  3 siblings, 1 reply; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-17 23:50 UTC (permalink / raw)
  To: linux-arm-kernel

2014-11-17 23:05 GMT+03:00 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>:
> 2014-11-17 21:44 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
>> Guess what, Russell's remark on i2c and serial made me cross-check.  And there
>> is a case where this will be called in irq context too ...
>>
>> See :
>> -> do_IRQ
>>   -> lubbock_vbus_irq()
>>     -> pxa25x_udc_vbus_session()
>>       -> pullup()
>>         -> clk_prepare_enable()
>>           -> CRACK
>>
>> Note that your patch is not really the faulty one, I think a threaded irq
>> instead of the "raw" irq should do the trick. And it is granted on UDC api that
>> vbus function is called in a "sleeping" context (Felipe correct me if I'm
>> wrong), so a patch to fix this before your current code would be fine.
>
> OK, I will take a look. It seems the correct way would be to strip this code
> away to a phy, like gpio-vbus or nop phys. Do you have access to lubbock
> (or maybe Daniel, Haojian or Russell has?)?

I have sketched a compile-tested only PHY for the Lubbock platform. Could you
please take a look and test.
The following changes since commit fc14f9c1272f62c3e8d01300f52467c0d9af50f9:

  Linux 3.18-rc5 (2014-11-16 16:36:20 -0800)

are available in the git repository at:

  git://git.infradead.org/users/dbaryshkov/zaurus.git lubbock

for you to fetch changes up to 67d7e1e57af0a42d86476cd2e73fd154b590d3f8:

  usb: gadget: drop lubbock-specific code from pxa25x_udc (2014-11-18
02:43:03 +0300)

----------------------------------------------------------------
Dmitry Eremin-Solenikov (3):
      ARM: pxa: lubbock: add declaration of vbus tranceiver
      usb: phy: add lubbock phy driver
      usb: gadget: drop lubbock-specific code from pxa25x_udc

 arch/arm/mach-pxa/lubbock.c         |   6 +++
 drivers/usb/gadget/udc/pxa25x_udc.c |  61 -----------------------
 drivers/usb/phy/Kconfig             |  10 ++++
 drivers/usb/phy/Makefile            |   1 +
 drivers/usb/phy/phy-lubbock.c       | 225
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 242 insertions(+), 61 deletions(-)
 create mode 100644 drivers/usb/phy/phy-lubbock.c


-- 
With best wishes
Dmitry

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

* Re: [PATCH V2 5/5] mfd: tc6387xb: prepare/unprepare clocks
  2014-11-17 15:07     ` Dmitry Eremin-Solenikov
@ 2014-11-18 12:04       ` Lee Jones
  -1 siblings, 0 replies; 39+ messages in thread
From: Lee Jones @ 2014-11-18 12:04 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov
  Cc: Robert Jarzmik, Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman,
	Wolfram Sang, Samuel Ortiz, Felipe Balbi, Jiri Slaby, linux-i2c,
	linux-arm-kernel, linux-serial, linux-usb

On Mon, 17 Nov 2014, Dmitry Eremin-Solenikov wrote:

> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  drivers/mfd/tc6387xb.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Looks good.  Applied, thanks.

> diff --git a/drivers/mfd/tc6387xb.c b/drivers/mfd/tc6387xb.c
> index e71f880..85fab37 100644
> --- a/drivers/mfd/tc6387xb.c
> +++ b/drivers/mfd/tc6387xb.c
> @@ -52,7 +52,7 @@ static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state)
>  
>  	if (pdata && pdata->suspend)
>  		pdata->suspend(dev);
> -	clk_disable(tc6387xb->clk32k);
> +	clk_disable_unprepare(tc6387xb->clk32k);
>  
>  	return 0;
>  }
> @@ -62,7 +62,7 @@ static int tc6387xb_resume(struct platform_device *dev)
>  	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
>  	struct tc6387xb_platform_data *pdata = dev_get_platdata(&dev->dev);
>  
> -	clk_enable(tc6387xb->clk32k);
> +	clk_prepare_enable(tc6387xb->clk32k);
>  	if (pdata && pdata->resume)
>  		pdata->resume(dev);
>  
> @@ -100,7 +100,7 @@ static int tc6387xb_mmc_enable(struct platform_device *mmc)
>  	struct platform_device *dev      = to_platform_device(mmc->dev.parent);
>  	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
>  
> -	clk_enable(tc6387xb->clk32k);
> +	clk_prepare_enable(tc6387xb->clk32k);
>  
>  	tmio_core_mmc_enable(tc6387xb->scr + 0x200, 0,
>  		tc6387xb_mmc_resources[0].start & 0xfffe);
> @@ -113,7 +113,7 @@ static int tc6387xb_mmc_disable(struct platform_device *mmc)
>  	struct platform_device *dev      = to_platform_device(mmc->dev.parent);
>  	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
>  
> -	clk_disable(tc6387xb->clk32k);
> +	clk_disable_unprepare(tc6387xb->clk32k);
>  
>  	return 0;
>  }
> @@ -214,7 +214,7 @@ static int tc6387xb_remove(struct platform_device *dev)
>  	mfd_remove_devices(&dev->dev);
>  	iounmap(tc6387xb->scr);
>  	release_resource(&tc6387xb->rscr);
> -	clk_disable(tc6387xb->clk32k);
> +	clk_disable_unprepare(tc6387xb->clk32k);
>  	clk_put(tc6387xb->clk32k);
>  	kfree(tc6387xb);
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH V2 5/5] mfd: tc6387xb: prepare/unprepare clocks
@ 2014-11-18 12:04       ` Lee Jones
  0 siblings, 0 replies; 39+ messages in thread
From: Lee Jones @ 2014-11-18 12:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 17 Nov 2014, Dmitry Eremin-Solenikov wrote:

> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  drivers/mfd/tc6387xb.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Looks good.  Applied, thanks.

> diff --git a/drivers/mfd/tc6387xb.c b/drivers/mfd/tc6387xb.c
> index e71f880..85fab37 100644
> --- a/drivers/mfd/tc6387xb.c
> +++ b/drivers/mfd/tc6387xb.c
> @@ -52,7 +52,7 @@ static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state)
>  
>  	if (pdata && pdata->suspend)
>  		pdata->suspend(dev);
> -	clk_disable(tc6387xb->clk32k);
> +	clk_disable_unprepare(tc6387xb->clk32k);
>  
>  	return 0;
>  }
> @@ -62,7 +62,7 @@ static int tc6387xb_resume(struct platform_device *dev)
>  	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
>  	struct tc6387xb_platform_data *pdata = dev_get_platdata(&dev->dev);
>  
> -	clk_enable(tc6387xb->clk32k);
> +	clk_prepare_enable(tc6387xb->clk32k);
>  	if (pdata && pdata->resume)
>  		pdata->resume(dev);
>  
> @@ -100,7 +100,7 @@ static int tc6387xb_mmc_enable(struct platform_device *mmc)
>  	struct platform_device *dev      = to_platform_device(mmc->dev.parent);
>  	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
>  
> -	clk_enable(tc6387xb->clk32k);
> +	clk_prepare_enable(tc6387xb->clk32k);
>  
>  	tmio_core_mmc_enable(tc6387xb->scr + 0x200, 0,
>  		tc6387xb_mmc_resources[0].start & 0xfffe);
> @@ -113,7 +113,7 @@ static int tc6387xb_mmc_disable(struct platform_device *mmc)
>  	struct platform_device *dev      = to_platform_device(mmc->dev.parent);
>  	struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
>  
> -	clk_disable(tc6387xb->clk32k);
> +	clk_disable_unprepare(tc6387xb->clk32k);
>  
>  	return 0;
>  }
> @@ -214,7 +214,7 @@ static int tc6387xb_remove(struct platform_device *dev)
>  	mfd_remove_devices(&dev->dev);
>  	iounmap(tc6387xb->scr);
>  	release_resource(&tc6387xb->rscr);
> -	clk_disable(tc6387xb->clk32k);
> +	clk_disable_unprepare(tc6387xb->clk32k);
>  	clk_put(tc6387xb->clk32k);
>  	kfree(tc6387xb);
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH V2 4/5] mfd: t7l66xb: prepare/unprepare clocks
  2014-11-17 15:07   ` Dmitry Eremin-Solenikov
@ 2014-11-18 13:14     ` Lee Jones
  -1 siblings, 0 replies; 39+ messages in thread
From: Lee Jones @ 2014-11-18 13:14 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov
  Cc: Robert Jarzmik, Daniel Mack, Haojian Zhuang, Greg Kroah-Hartman,
	Wolfram Sang, Samuel Ortiz, Felipe Balbi, Jiri Slaby, linux-i2c,
	linux-arm-kernel, linux-serial, linux-usb

On Mon, 17 Nov 2014, Dmitry Eremin-Solenikov wrote:

> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  drivers/mfd/t7l66xb.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
> index 9e04a74..439d905 100644
> --- a/drivers/mfd/t7l66xb.c
> +++ b/drivers/mfd/t7l66xb.c
> @@ -87,7 +87,7 @@ static int t7l66xb_mmc_enable(struct platform_device *mmc)
>  	unsigned long flags;
>  	u8 dev_ctl;
>  
> -	clk_enable(t7l66xb->clk32k);
> +	clk_prepare_enable(t7l66xb->clk32k);
>  
>  	spin_lock_irqsave(&t7l66xb->lock, flags);
>  
> @@ -118,7 +118,7 @@ static int t7l66xb_mmc_disable(struct platform_device *mmc)
>  
>  	spin_unlock_irqrestore(&t7l66xb->lock, flags);
>  
> -	clk_disable(t7l66xb->clk32k);
> +	clk_disable_unprepare(t7l66xb->clk32k);
>  
>  	return 0;
>  }
> @@ -285,7 +285,7 @@ static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state)
>  
>  	if (pdata && pdata->suspend)
>  		pdata->suspend(dev);
> -	clk_disable(t7l66xb->clk48m);
> +	clk_disable_unprepare(t7l66xb->clk48m);
>  
>  	return 0;
>  }
> @@ -295,7 +295,7 @@ static int t7l66xb_resume(struct platform_device *dev)
>  	struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
>  	struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev);
>  
> -	clk_enable(t7l66xb->clk48m);
> +	clk_prepare_enable(t7l66xb->clk48m);
>  	if (pdata && pdata->resume)
>  		pdata->resume(dev);
>  
> @@ -369,7 +369,7 @@ static int t7l66xb_probe(struct platform_device *dev)
>  		goto err_ioremap;
>  	}
>  
> -	clk_enable(t7l66xb->clk48m);
> +	clk_prepare_enable(t7l66xb->clk48m);
>  
>  	if (pdata && pdata->enable)
>  		pdata->enable(dev);
> @@ -414,9 +414,9 @@ static int t7l66xb_remove(struct platform_device *dev)
>  	int ret;
>  
>  	ret = pdata->disable(dev);
> -	clk_disable(t7l66xb->clk48m);
> +	clk_disable_unprepare(t7l66xb->clk48m);
>  	clk_put(t7l66xb->clk48m);
> -	clk_disable(t7l66xb->clk32k);
> +	clk_disable_unprepare(t7l66xb->clk32k);
>  	clk_put(t7l66xb->clk32k);
>  	t7l66xb_detach_irq(dev);
>  	iounmap(t7l66xb->scr);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH V2 4/5] mfd: t7l66xb: prepare/unprepare clocks
@ 2014-11-18 13:14     ` Lee Jones
  0 siblings, 0 replies; 39+ messages in thread
From: Lee Jones @ 2014-11-18 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 17 Nov 2014, Dmitry Eremin-Solenikov wrote:

> Change clk_enable/disable() calls to clk_prepare_enable() and
> clk_disable_unprepare().
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  drivers/mfd/t7l66xb.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
> index 9e04a74..439d905 100644
> --- a/drivers/mfd/t7l66xb.c
> +++ b/drivers/mfd/t7l66xb.c
> @@ -87,7 +87,7 @@ static int t7l66xb_mmc_enable(struct platform_device *mmc)
>  	unsigned long flags;
>  	u8 dev_ctl;
>  
> -	clk_enable(t7l66xb->clk32k);
> +	clk_prepare_enable(t7l66xb->clk32k);
>  
>  	spin_lock_irqsave(&t7l66xb->lock, flags);
>  
> @@ -118,7 +118,7 @@ static int t7l66xb_mmc_disable(struct platform_device *mmc)
>  
>  	spin_unlock_irqrestore(&t7l66xb->lock, flags);
>  
> -	clk_disable(t7l66xb->clk32k);
> +	clk_disable_unprepare(t7l66xb->clk32k);
>  
>  	return 0;
>  }
> @@ -285,7 +285,7 @@ static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state)
>  
>  	if (pdata && pdata->suspend)
>  		pdata->suspend(dev);
> -	clk_disable(t7l66xb->clk48m);
> +	clk_disable_unprepare(t7l66xb->clk48m);
>  
>  	return 0;
>  }
> @@ -295,7 +295,7 @@ static int t7l66xb_resume(struct platform_device *dev)
>  	struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
>  	struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev);
>  
> -	clk_enable(t7l66xb->clk48m);
> +	clk_prepare_enable(t7l66xb->clk48m);
>  	if (pdata && pdata->resume)
>  		pdata->resume(dev);
>  
> @@ -369,7 +369,7 @@ static int t7l66xb_probe(struct platform_device *dev)
>  		goto err_ioremap;
>  	}
>  
> -	clk_enable(t7l66xb->clk48m);
> +	clk_prepare_enable(t7l66xb->clk48m);
>  
>  	if (pdata && pdata->enable)
>  		pdata->enable(dev);
> @@ -414,9 +414,9 @@ static int t7l66xb_remove(struct platform_device *dev)
>  	int ret;
>  
>  	ret = pdata->disable(dev);
> -	clk_disable(t7l66xb->clk48m);
> +	clk_disable_unprepare(t7l66xb->clk48m);
>  	clk_put(t7l66xb->clk48m);
> -	clk_disable(t7l66xb->clk32k);
> +	clk_disable_unprepare(t7l66xb->clk32k);
>  	clk_put(t7l66xb->clk32k);
>  	t7l66xb_detach_irq(dev);
>  	iounmap(t7l66xb->scr);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-17 20:05       ` Dmitry Eremin-Solenikov
                           ` (2 preceding siblings ...)
  2014-11-17 23:50         ` Dmitry Eremin-Solenikov
@ 2014-11-18 15:49         ` Felipe Balbi
  3 siblings, 0 replies; 39+ messages in thread
From: Felipe Balbi @ 2014-11-18 15:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 18, 2014 at 12:05:45AM +0400, Dmitry Eremin-Solenikov wrote:
> Hello,
> 
> 2014-11-17 21:44 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> > Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:
> >
> >> Change clk_enable/disable() calls to clk_prepare_enable() and
> >> clk_disable_unprepare().
> >>
> >> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> >> ---
> >>  drivers/usb/gadget/udc/pxa25x_udc.c | 8 ++++----
> >>  1 file changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
> >> index 42f7eeb..e4964ee 100644
> >> --- a/drivers/usb/gadget/udc/pxa25x_udc.c
> >> +++ b/drivers/usb/gadget/udc/pxa25x_udc.c
> >> @@ -103,8 +103,8 @@ static const char ep0name [] = "ep0";
> >>
> >>  /* IXP doesn't yet support <linux/clk.h> */
> >>  #define clk_get(dev,name)    NULL
> >> -#define clk_enable(clk)              do { } while (0)
> >> -#define clk_disable(clk)     do { } while (0)
> >> +#define clk_prepare_enable(clk)      do { } while (0)
> >> +#define clk_disable_unprepare(clk)   do { } while (0)
> >>  #define clk_put(clk)         do { } while (0)
> >>
> >>  #endif
> >> @@ -932,7 +932,7 @@ static int pullup(struct pxa25x_udc *udc)
> >>               if (!udc->active) {
> >>                       udc->active = 1;
> >>                       /* Enable clock for USB device */
> >> -                     clk_enable(udc->clk);
> >> +                     clk_prepare_enable(udc->clk);
> >
> > Guess what, Russell's remark on i2c and serial made me cross-check.  And there
> > is a case where this will be called in irq context too ...
> >
> > See :
> > -> do_IRQ
> >   -> lubbock_vbus_irq()
> >     -> pxa25x_udc_vbus_session()
> >       -> pullup()
> >         -> clk_prepare_enable()
> >           -> CRACK
> >
> > Note that your patch is not really the faulty one, I think a threaded irq
> > instead of the "raw" irq should do the trick. And it is granted on UDC api that
> > vbus function is called in a "sleeping" context (Felipe correct me if I'm
> > wrong), so a patch to fix this before your current code would be fine.

Well, from the framework point of view, ->pullup() is only called
outside of IRQ context. But I see you're calling it from vbus_irq(), so
you brought this upon yourself :-)

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141118/34b182a1/attachment.sig>

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-17 23:50         ` Dmitry Eremin-Solenikov
@ 2014-11-19 20:29           ` Robert Jarzmik
  2014-11-19 21:11             ` Dmitry Eremin-Solenikov
  2014-11-22 13:56             ` Robert Jarzmik
  0 siblings, 2 replies; 39+ messages in thread
From: Robert Jarzmik @ 2014-11-19 20:29 UTC (permalink / raw)
  To: linux-arm-kernel

Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:

> I have sketched a compile-tested only PHY for the Lubbock platform. Could you
> please take a look and test.
>   git://git.infradead.org/users/dbaryshkov/zaurus.git lubbock

Okay, now my ADSL line is repaired, thank you Mr farmer "I drive a tractor but I
don't care about telephone posts", I'll fetch your changes and make a
test. Let's say I schedule this for saturday.

Cheers.

--
Robert

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-19 20:29           ` Robert Jarzmik
@ 2014-11-19 21:11             ` Dmitry Eremin-Solenikov
  2014-11-22 13:56             ` Robert Jarzmik
  1 sibling, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-19 21:11 UTC (permalink / raw)
  To: linux-arm-kernel

2014-11-19 23:29 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:
>
>> I have sketched a compile-tested only PHY for the Lubbock platform. Could you
>> please take a look and test.
>>   git://git.infradead.org/users/dbaryshkov/zaurus.git lubbock
>
> Okay, now my ADSL line is repaired, thank you Mr farmer "I drive a tractor but I
> don't care about telephone posts", I'll fetch your changes and make a
> test. Let's say I schedule this for saturday.

Fine with me, thank you.

-- 
With best wishes
Dmitry

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-19 20:29           ` Robert Jarzmik
  2014-11-19 21:11             ` Dmitry Eremin-Solenikov
@ 2014-11-22 13:56             ` Robert Jarzmik
  2014-11-22 15:44               ` Dmitry Eremin-Solenikov
  1 sibling, 1 reply; 39+ messages in thread
From: Robert Jarzmik @ 2014-11-22 13:56 UTC (permalink / raw)
  To: linux-arm-kernel

Robert Jarzmik <robert.jarzmik@free.fr> writes:
> Okay, now my ADSL line is repaired, thank you Mr farmer "I drive a tractor but I
> don't care about telephone posts", I'll fetch your changes and make a
> test. Let's say I schedule this for saturday.

Removed people from the list for the tests aspect.

Well, my lubbock board seem to raise several interrupts in the linux kernel, all
the LUBBOCK_IRQ interrupts multiplexed on GPIO0 actually, amongst which are the
2 interrupts for the UDC.

That will mean delay I'm afraid, as I have to find out what happens. I'm pretty
sure the hardware is OK, because the "blob" loader uses the ethernet card which
is amongst the LUBBOCK_IRQs.

There is probably a regression in the kernel not seen for several revisions, and
I have to fix it before I can test.

Cheers.

-- 
Robert

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-22 13:56             ` Robert Jarzmik
@ 2014-11-22 15:44               ` Dmitry Eremin-Solenikov
  2014-11-22 17:18                 ` Robert Jarzmik
  0 siblings, 1 reply; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-22 15:44 UTC (permalink / raw)
  To: linux-arm-kernel

2014-11-22 16:56 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> Robert Jarzmik <robert.jarzmik@free.fr> writes:
>> Okay, now my ADSL line is repaired, thank you Mr farmer "I drive a tractor but I
>> don't care about telephone posts", I'll fetch your changes and make a
>> test. Let's say I schedule this for saturday.
>
> Removed people from the list for the tests aspect.
>
> Well, my lubbock board seem to raise several interrupts in the linux kernel, all
> the LUBBOCK_IRQ interrupts multiplexed on GPIO0 actually, amongst which are the
> 2 interrupts for the UDC.

This looks normal - GPIO0 is connected to an interrupt pin of the CPLD.
lubbock_init_irq function should be setting up a chained handler for the GPIO0.
And that chained handler (lubbock_irq_handler) should further decode which
IRQ bit is set. Do you see the handler being called? Can you print the (pending)
variable in the handler?

-- 
With best wishes
Dmitry

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-22 15:44               ` Dmitry Eremin-Solenikov
@ 2014-11-22 17:18                 ` Robert Jarzmik
  2014-11-22 17:48                   ` Dmitry Eremin-Solenikov
  0 siblings, 1 reply; 39+ messages in thread
From: Robert Jarzmik @ 2014-11-22 17:18 UTC (permalink / raw)
  To: linux-arm-kernel

Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:

> 2014-11-22 16:56 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
>> Robert Jarzmik <robert.jarzmik@free.fr> writes:
>>> Okay, now my ADSL line is repaired, thank you Mr farmer "I drive a tractor but I
>>> don't care about telephone posts", I'll fetch your changes and make a
>>> test. Let's say I schedule this for saturday.
>>
>> Removed people from the list for the tests aspect.
>>
>> Well, my lubbock board seem to raise several interrupts in the linux kernel, all
>> the LUBBOCK_IRQ interrupts multiplexed on GPIO0 actually, amongst which are the
>> 2 interrupts for the UDC.
Arg, what I meant to write was "seem to *never* raise several interrupts".

> This looks normal - GPIO0 is connected to an interrupt pin of the CPLD.
> lubbock_init_irq function should be setting up a chained handler for the GPIO0.
> And that chained handler (lubbock_irq_handler) should further decode which
> IRQ bit is set. Do you see the handler being called? Can you print the (pending)
> variable in the handler?
lubbock_irq_handler() is never called.
pxa_gpio_demux_handler() is never called.
  => this is the one worrying me most.

And as the lubbock_irq_handler() is never called there is not point in printing
that yet, first should be finding out why on earth the gpio demux is not getting
called.

Cheers.

-- 
Robert

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-22 17:18                 ` Robert Jarzmik
@ 2014-11-22 17:48                   ` Dmitry Eremin-Solenikov
  2014-11-22 17:49                     ` Robert Jarzmik
  0 siblings, 1 reply; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-22 17:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

2014-11-22 20:18 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:
>
>> 2014-11-22 16:56 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
>>> Robert Jarzmik <robert.jarzmik@free.fr> writes:
>>>> Okay, now my ADSL line is repaired, thank you Mr farmer "I drive a tractor but I
>>>> don't care about telephone posts", I'll fetch your changes and make a
>>>> test. Let's say I schedule this for saturday.
>>>
>>> Removed people from the list for the tests aspect.
>>>
>>> Well, my lubbock board seem to raise several interrupts in the linux kernel, all
>>> the LUBBOCK_IRQ interrupts multiplexed on GPIO0 actually, amongst which are the
>>> 2 interrupts for the UDC.
> Arg, what I meant to write was "seem to *never* raise several interrupts".

Understood. Just to make me sure - does the upstream kernel work?

-- 
With best wishes
Dmitry

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-22 17:48                   ` Dmitry Eremin-Solenikov
@ 2014-11-22 17:49                     ` Robert Jarzmik
  2014-11-22 17:51                       ` Dmitry Eremin-Solenikov
  0 siblings, 1 reply; 39+ messages in thread
From: Robert Jarzmik @ 2014-11-22 17:49 UTC (permalink / raw)
  To: linux-arm-kernel

Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:

> Hello,
>
> 2014-11-22 20:18 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
>> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:
>>
>>> 2014-11-22 16:56 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
>>>> Robert Jarzmik <robert.jarzmik@free.fr> writes:
>>>>> Okay, now my ADSL line is repaired, thank you Mr farmer "I drive a tractor but I
>>>>> don't care about telephone posts", I'll fetch your changes and make a
>>>>> test. Let's say I schedule this for saturday.
>>>>
>>>> Removed people from the list for the tests aspect.
>>>>
>>>> Well, my lubbock board seem to raise several interrupts in the linux kernel, all
>>>> the LUBBOCK_IRQ interrupts multiplexed on GPIO0 actually, amongst which are the
>>>> 2 interrupts for the UDC.
>> Arg, what I meant to write was "seem to *never* raise several interrupts".
>
> Understood. Just to make me sure - does the upstream kernel work?
Nope, that's the current situation with the upstream kernel.

Cheers.

-- 
Robert

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-22 17:49                     ` Robert Jarzmik
@ 2014-11-22 17:51                       ` Dmitry Eremin-Solenikov
  2014-11-24  7:53                         ` Robert Jarzmik
  0 siblings, 1 reply; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-22 17:51 UTC (permalink / raw)
  To: linux-arm-kernel

2014-11-22 20:49 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:
>
>> Hello,
>>
>> 2014-11-22 20:18 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
>>> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:
>>>
>>>> 2014-11-22 16:56 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
>>>>> Robert Jarzmik <robert.jarzmik@free.fr> writes:
>>>>>> Okay, now my ADSL line is repaired, thank you Mr farmer "I drive a tractor but I
>>>>>> don't care about telephone posts", I'll fetch your changes and make a
>>>>>> test. Let's say I schedule this for saturday.
>>>>>
>>>>> Removed people from the list for the tests aspect.
>>>>>
>>>>> Well, my lubbock board seem to raise several interrupts in the linux kernel, all
>>>>> the LUBBOCK_IRQ interrupts multiplexed on GPIO0 actually, amongst which are the
>>>>> 2 interrupts for the UDC.
>>> Arg, what I meant to write was "seem to *never* raise several interrupts".
>>
>> Understood. Just to make me sure - does the upstream kernel work?
> Nope, that's the current situation with the upstream kernel.

Next point would be (from my POV) to make sure that
lubbock_unmask_irq() is called
and works as expected.

-- 
With best wishes
Dmitry

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-22 17:51                       ` Dmitry Eremin-Solenikov
@ 2014-11-24  7:53                         ` Robert Jarzmik
  2014-11-26 22:12                           ` Robert Jarzmik
  0 siblings, 1 reply; 39+ messages in thread
From: Robert Jarzmik @ 2014-11-24  7:53 UTC (permalink / raw)
  To: linux-arm-kernel

Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:

> 2014-11-22 20:49 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> Next point would be (from my POV) to make sure that
> lubbock_unmask_irq() is called
> and works as expected.

Actually the problem is probably within the CPLD.
Irrespective of the CPLD register LUB_IRQ_MASK_EN, the GPIO0 is always low,
indicating an interrupt all the time.

The only thing that changes that is the switch SW13, which forces GPIO0 to high,
but prevents interrupts.

Normally, GPIO0 = (SW13 | ! (LUB_IRQ_MASK_EN && LUB_IRQ_SET_CLR))

This is why I don't have any interrupt, next stage will be to verify U46 and U54
on the IO board for GPIO_INT# and USB_INT# signals ...

Cheers.

-- 
Robert

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-24  7:53                         ` Robert Jarzmik
@ 2014-11-26 22:12                           ` Robert Jarzmik
  2014-11-26 22:19                             ` Dmitry Eremin-Solenikov
  0 siblings, 1 reply; 39+ messages in thread
From: Robert Jarzmik @ 2014-11-26 22:12 UTC (permalink / raw)
  To: linux-arm-kernel

OK Dmitry, I pulled through, the interrupts are working back.

Actually one of the blockers I have is in pxa25x_udc, and it is also in your
phy-lubbock.c. The bottom of the error is that disable_irq() is called from
within a irq handler, and it deadlocks. A disable_irq_nosync() should be used
...

... but a better approach would be to use a threaded irq for vbus handling. I
think that way disable_irq() can be used, no workqueue is needed anymore in
phy-lubbock.

Would you make that change, I'll test it and review it.

Cheers.

--
Robert

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

* [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp
  2014-11-26 22:12                           ` Robert Jarzmik
@ 2014-11-26 22:19                             ` Dmitry Eremin-Solenikov
       [not found]                               ` <87zjbd1tb0.fsf_-_@free.fr>
  0 siblings, 1 reply; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-26 22:19 UTC (permalink / raw)
  To: linux-arm-kernel

2014-11-27 1:12 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> OK Dmitry, I pulled through, the interrupts are working back.

What was the problem? Hardware issues? Firmware in CPLD being of old
revision?

> Actually one of the blockers I have is in pxa25x_udc, and it is also in your
> phy-lubbock.c. The bottom of the error is that disable_irq() is called from
> within a irq handler, and it deadlocks. A disable_irq_nosync() should be used
> ...
>
> ... but a better approach would be to use a threaded irq for vbus handling. I
> think that way disable_irq() can be used, no workqueue is needed anymore in
> phy-lubbock.
>
> Would you make that change, I'll test it and review it.

OK, I will take a look in a next few days.

BTW: I have also received a pxa270 board (Sophia Sandgate II, the one
without the additional graphics accelerator), so after spending some efforts
on bringup & bsp, I should be able to also test pxa270 code.

-- 
With best wishes
Dmitry

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

* Lubbock interrupts fix (was lubbock udc phy)
       [not found]                               ` <87zjbd1tb0.fsf_-_@free.fr>
@ 2014-11-26 22:39                                 ` Dmitry Eremin-Solenikov
  0 siblings, 0 replies; 39+ messages in thread
From: Dmitry Eremin-Solenikov @ 2014-11-26 22:39 UTC (permalink / raw)
  To: linux-arm-kernel

2014-11-27 1:38 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:
>
>> 2014-11-27 1:12 GMT+03:00 Robert Jarzmik <robert.jarzmik@free.fr>:
>>> OK Dmitry, I pulled through, the interrupts are working back.
>>
>> What was the problem? Hardware issues? Firmware in CPLD being of old
>> revision?
> There were basically 2 problems :
>  - hardware: switch S13 was in a position that disabled interrupts all the time
>    One other problem which fooled me was the incorrect gate schematics I had,
>    and which make my understanding of linear function foo such as
>    GPIO0 = foo(LUB_IRQ_EN, LUB_SET_CLR) false.
>
>  - software: lubbock.c error
>    Since gpio-pxa was ported to device/gpio, it is probed *after*
>    lubbock_init_irq() is called. As lubbock_init_irq() installs
>    lubbock_irq_handler() and sets the irq to falling edge detect before gpio-pxa
>    is probed, gpio-pxa probe overwrites this by :
>      - clearing any edge detection (probe state reset)
>      - installing generic handle_edge_irq() instead of the lubbock irq handler
>
> So the conclusion is that I have to rework lubbock_init_irq(), remove from it
> the PXA_GPIO_TO_IRQ(0) stuff, and move it to a code in lubbock.c which will
> provide the guarantee of being executed _after_ gpio-pxa is probed. When I'm
> happy with my patch I'll submit it.

Thank you for your explanation.

-- 
With best wishes
Dmitry

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

end of thread, other threads:[~2014-11-26 22:39 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-17 15:07 [PATCH V2 1/5] serial: pxa: prepare/unprepare clocks Dmitry Eremin-Solenikov
2014-11-17 15:07 ` Dmitry Eremin-Solenikov
2014-11-17 15:07 ` [PATCH V2 2/5] i2c: " Dmitry Eremin-Solenikov
2014-11-17 15:07   ` Dmitry Eremin-Solenikov
2014-11-17 15:51   ` Russell King - ARM Linux
2014-11-17 15:51     ` Russell King - ARM Linux
     [not found]   ` <1416236863-20898-2-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-17 18:26     ` Wolfram Sang
2014-11-17 18:26       ` Wolfram Sang
2014-11-17 15:07 ` [PATCH V2 4/5] mfd: t7l66xb: " Dmitry Eremin-Solenikov
2014-11-17 15:07   ` Dmitry Eremin-Solenikov
2014-11-18 13:14   ` Lee Jones
2014-11-18 13:14     ` Lee Jones
     [not found] ` <1416236863-20898-1-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-17 15:07   ` [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp Dmitry Eremin-Solenikov
2014-11-17 15:07     ` Dmitry Eremin-Solenikov
2014-11-17 18:44     ` Robert Jarzmik
2014-11-17 18:44       ` Robert Jarzmik
2014-11-17 20:05       ` Dmitry Eremin-Solenikov
2014-11-17 20:07         ` Russell King - ARM Linux
2014-11-17 20:09         ` Robert Jarzmik
2014-11-17 23:50         ` Dmitry Eremin-Solenikov
2014-11-19 20:29           ` Robert Jarzmik
2014-11-19 21:11             ` Dmitry Eremin-Solenikov
2014-11-22 13:56             ` Robert Jarzmik
2014-11-22 15:44               ` Dmitry Eremin-Solenikov
2014-11-22 17:18                 ` Robert Jarzmik
2014-11-22 17:48                   ` Dmitry Eremin-Solenikov
2014-11-22 17:49                     ` Robert Jarzmik
2014-11-22 17:51                       ` Dmitry Eremin-Solenikov
2014-11-24  7:53                         ` Robert Jarzmik
2014-11-26 22:12                           ` Robert Jarzmik
2014-11-26 22:19                             ` Dmitry Eremin-Solenikov
     [not found]                               ` <87zjbd1tb0.fsf_-_@free.fr>
2014-11-26 22:39                                 ` Lubbock interrupts fix (was lubbock udc phy) Dmitry Eremin-Solenikov
2014-11-18 15:49         ` [PATCH V2 3/5] usb: gadget: pxa25x_udc: prepare/unprepare clocks in pxa-ssp Felipe Balbi
2014-11-17 15:07   ` [PATCH V2 5/5] mfd: tc6387xb: prepare/unprepare clocks Dmitry Eremin-Solenikov
2014-11-17 15:07     ` Dmitry Eremin-Solenikov
2014-11-18 12:04     ` Lee Jones
2014-11-18 12:04       ` Lee Jones
2014-11-17 15:51   ` [PATCH V2 1/5] serial: pxa: " Russell King - ARM Linux
2014-11-17 15:51     ` Russell King - ARM Linux

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.