RE: [RFC PATCH 00/13] DMA Engine support for AM33xx

2012-09-26 Thread Hebbar, Gururaja
On Fri, Sep 21, 2012 at 23:52:11, Porter, Matt wrote:
 On Fri, Sep 21, 2012 at 08:27:07AM +, Hebbar, Gururaja wrote:
  On Thu, Sep 20, 2012 at 20:13:33, Porter, Matt wrote:
   This series adds DMA Engine support for AM33xx, which uses
   an EDMA DMAC. The EDMA DMAC has been previously supported by only
   a private API implementation (much like the situation with OMAP
   DMA) found on the DaVinci family of SoCs.
   
   There are a mind-boggling number of dependencies for this series:
   
 - Jon Hunter's OF DMA helpers series
   https://patchwork.kernel.org/patch/1461061/
   https://patchwork.kernel.org/patch/1461051/
 - Patch to address OF DMA helpers naming issues:
   https://patchwork.kernel.org/patch/1477921/
 - EDMA DMA Engine wrapper driver in linux-next
   c2dde5f8f2095d7c623ff3565c1462e190272273
 - EDMA DMA Engine wrapper driver bug fix:
   https://patchwork.kernel.org/patch/1474411/  
 - A huge number of patches in linux-next for AM33xx boot
   (too numerous to list)
   
   The approach taken is similar to how OMAP DMA is being converted to
   DMA Engine support. With the functional EDMA private API already
   existing in mach-davinci/dma.c, we first move that to an ARM common
   area so it can be shared. Adding DT and runtime PM support to the
   private EDMA API implementation allows it to run on AM33xx. AM33xx
   *only* boots using DT so we leverage Jon's generic DT DMA helpers to
   register EDMA DMAC with the of_dma framework and then add support
   for calling the dma_request_slave_channel() API to both the mmc
   and spi drivers.
   
   What works? Well, with this series we now have MMC and SPI support
   on AM33xx. The only caveat for MMC is that the mmc3 controller has
   its events on the crossbar and is not usable right now.
   
   This is tested on BeagleBone with a SPI framebuffer driver and SD
   card.
   
   After this series, the plan is to convert the last in-tree user
   of the private EDMA API (davinci-pcm/mcasp) and then eliminate
   the private EDMA API by folding its functionality into
   drivers/dma/edma.c.
   
   TODO:
 add AM33xx crossbar support to the private EDMA API
 (any EDMA events on the crossbar are not supported)
   
  
  
  Can you please mention the base repo you have taken as starting point.
  (repo + extra patches ...).
 
 It's mainline 3.6-rc6 and you can see the complete set of patches
 at https://github.com/ohporter/linux/tree/edma-dmaengine-am33xx-rfc-v1
 after commit 5698bd757d55b1bb87edd1a9744ab09c142abfc2
 
  This will help us to test the code.
  
  This is because I looked at the patch 12/13 and I see that mmc
  device-node is modified. But in mainline I don’t see device 
  node for mmc (yet).
 
 Oops. You'll need e62aae450bcdefbe9d7bc277ae0ef645 and
 fe97304557d2c6f7d0aaf1ea028ea48ffca366a9 which I forgot to include
 in this series. I'll have them in for v2.

Yesterday I tested edma patches on latest linux-next/master + merge of 
linux-omap/for_3.7/dts_part2. Below are my observations

1. baseline = linux-next/master + merge of linux-omap/for_3.7/dts_part2
2. on top of above branch, I applied patches [1-9]/13 of your edma 
   patches
3. few patches required trivial changes before applying
4. Applied dma of patches as you mentioned
5. add custom patch (ARM: CUSTOM: Build a uImage with dtb already 
   appended)
   From https://github.com/hvaibhav/am335x-linux/commit/
7e72f5ed4b702c9373d19f7626f07ae31a381d53#arch/arm/Makefile

6. Modified 9/13 patch to apply properly on latest am33xx.dtsi.
a. Edma portion as it is
b. mmc portion as below
mmc1: mmc@4806 {
compatible = ti,omap3-hsmmc;
ti,hwmods = mmc1;
ti,dual-volt;
ti,needs-special-reset;
bus-width = 4;
vmmc-supply = vmmc_reg;
dmas = edma 24
edma 25;
dma-names = tx, rx;
};
c. added mmc pinmux as-well

7. make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm distclean
   make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm 
   omap2plus_defconfig

8. enabled TI_EDMA from menuconfig (since it was not enabled for 
   omap2plus_defconfig

9. make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm uImage
   make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm 
   uImage-dtb.am335x-evm

With above changes, edma probe was failing at request_mem_region() 
Inside linux-next/arch/arm/common/edma.c -- edma_probe()

I had to modify edma_probe as below


diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index f337f81..efe2673 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -1589,11 +1589,11 @@ static int __init edma_probe(struct platform_device 
*pdev)
for (j = 0; j  EDMA_MAX_CC; j++) {
if (node) {
 

[PATCH 1/2] spi:pl022: Disable/Enable functional clock from suspend/resume

2012-09-26 Thread Vipul Kumar Samar
SPI functional clock must be disalble/enable in non RTPM suspend/resume
hooks. Currently it is only done for RTPM cases.

This patch add support to disable/enbale clock for conventional
suspend/resume calls.

Signed-off-by: Vipul Kumar Samar vipulkumar.sa...@st.com
---
 drivers/spi/spi-pl022.c |8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index f2a80ff..09fb09e 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2310,6 +2310,8 @@ static int pl022_suspend(struct device *dev)
}
 
dev_dbg(dev, suspended\n);
+   clk_disable(pl022-clk);
+
return 0;
 }
 
@@ -2318,6 +2320,12 @@ static int pl022_resume(struct device *dev)
struct pl022 *pl022 = dev_get_drvdata(dev);
int ret;
 
+   ret = clk_enable(pl022-clk);
+   if (ret) {
+   dev_err(dev, could not enable SSP/SPI bus clock\n);
+   return ret;
+   }
+
/* Start the queue running */
ret = spi_master_resume(pl022-master);
if (ret)
-- 
1.7.10


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


[PATCH 0/2] ARM: AMBA: Fix clock disable/enable issue in conventional suspend/resume

2012-09-26 Thread Vipul Kumar Samar
Vipul Kumar Samar (2):
  spi:pl022: Disable/Enable functional clock from suspend/resume
  ARM: ABMA: Disable/Enable interface clock from suspend/resume

 drivers/amba/bus.c  |   42 +++---
 drivers/spi/spi-pl022.c |8 
 2 files changed, 47 insertions(+), 3 deletions(-)

-- 
1.7.10


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 1/2] spi:pl022: Disable/Enable functional clock from suspend/resume

2012-09-26 Thread Linus Walleij
On Wed, Sep 26, 2012 at 1:24 PM, Vipul Kumar Samar
vipulkumar.sa...@st.com wrote:

 SPI functional clock must be disalble/enable in non RTPM suspend/resume
 hooks. Currently it is only done for RTPM cases.

 This patch add support to disable/enbale clock for conventional
 suspend/resume calls.

 Signed-off-by: Vipul Kumar Samar vipulkumar.sa...@st.com

Cross dependency between runtime suspend/resume and
common suspend/resume. Oh the horror ...

Ulf Hansson has experienced pain with this as well, let's
discuss this a bit.

 @@ -2310,6 +2310,8 @@ static int pl022_suspend(struct device *dev)
 }

 dev_dbg(dev, suspended\n);
 +   clk_disable(pl022-clk);
 +
 return 0;
  }

 @@ -2318,6 +2320,12 @@ static int pl022_resume(struct device *dev)
 struct pl022 *pl022 = dev_get_drvdata(dev);
 int ret;

 +   ret = clk_enable(pl022-clk);
 +   if (ret) {
 +   dev_err(dev, could not enable SSP/SPI bus clock\n);
 +   return ret;
 +   }
 +

There is a potential race between the runtime
suspend/resume and ordinary suspend/resume hooks here
I'm afraid.

I think in this case since we're not reading nor writing
registers, we should just wait for the device to
go down to runtime suspend in the ordinary suspend
hook, just wait for runtime suspend to happen in
suspend, do nothing in resume (and wait for the device
to wake itself as needed).

So something like:

while (!pm_runtime_status_suspended(dev))
   cpu_relax();  // or usleep_range()?
/* Here you know the block is gated off */

Or is this better:

pm_runtime_get_sync();
/* Now we know for sure it's on! */
pm_runtime_put_sync();
/* Now we know for sure it's off! */

Is there a *good* way to await runtime suspend?

I don't know if any of this is the proper solution so let
Rafael and Magnus comment on how it's supposed
to be done.


Ramblings:

The semantics between runtime suspend/resume and
ordinary suspend/resume are unclear to me, it seems like
this is all up to the drivers and busses to figure out. Like
you weren't supposed to use both at the same time.

What we've done in other drivers here at ST-Ericsson is
to make the .suspend hook actually do a runtime get so that
runtime PM is running, then hammer off all resources
and go to suspend with PM runtime actually enabled.

Something like this:

suspend()
  pm_runtime_get_sync()
  /* Maybe poke some registers here */
  clk_disable();

resume():
  clk_enable();
  /* Maybe poke some registers here */
  pm_runtime_put();

This is to be sure that there is not a race between runtime
suspend/resume and ordinary suspend/resume.

I don't like it since it actually turns things upside-down
completely, during ordinary suspend the device is
runtime resumed for example.

Rafael, Magnus: help.

Yours,
Linus Walleij

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 1/2] spi:pl022: Disable/Enable functional clock from suspend/resume

2012-09-26 Thread Mark Brown
On Wed, Sep 26, 2012 at 02:17:36PM +0200, Linus Walleij wrote:
 On Wed, Sep 26, 2012 at 1:24 PM, Vipul Kumar Samar

  SPI functional clock must be disalble/enable in non RTPM suspend/resume
  hooks. Currently it is only done for RTPM cases.

  This patch add support to disable/enbale clock for conventional
  suspend/resume calls.

 Cross dependency between runtime suspend/resume and
 common suspend/resume. Oh the horror ...

This should be fine, we runtime resume before we suspend.

 The semantics between runtime suspend/resume and
 ordinary suspend/resume are unclear to me, it seems like
 this is all up to the drivers and busses to figure out. Like
 you weren't supposed to use both at the same time.

This was clarified at some point relatively recently with the above
(which is essentially the same as the solution you describe).

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 2/2] ARM: ABMA: Disable/Enable interface clock from suspend/resume

2012-09-26 Thread Linus Walleij
On Wed, Sep 26, 2012 at 1:24 PM, Vipul Kumar Samar
vipulkumar.sa...@st.com wrote:

 AMBA devices interface clock is disabled in RTPM suspend/resume hooks
 but not in conventional hooks.

 This patch adds support to disable/enable clock for conventional
 suspend/resume calls.
(...)
 +   struct amba_device *pcdev = to_amba_device(dev);
 int ret = 0;

 if (!drv)
 @@ -132,16 +133,27 @@ static int amba_pm_suspend(struct device *dev)
 ret = amba_legacy_suspend(dev, PMSG_SUSPEND);
 }

 +   if (!ret)
 +   clk_disable(pcdev-pclk);
 +
 return ret;
  }

You're not accounting for the case where pcdev-pclk
is an error pointer (as happens if pclk lookup fails at
probe).

I think you can simplify some of the code using
the external accessors from linux/amba/bus.h:

amba_pclk_enable();
amba_pclk_disable();

But:

Again this is a case where you have a race between runtime
suspend/resume and ordinary suspend/resume.

These ordinary suspend/resume operations should probably
wait for runtime suspend to happen *first* if and only if
runtime PM is enabled, and then the block will be gated
off. So we really need to figure out how we can make sure
that this happens.

If just ordinary PM is enabled, the above makes sense but in
that case I think we should have that #ifdef:ed as an alternative
or something.

So something like:

suspend():
#ifdef CONFIG_PM_RUNTIME
   /* Wait for runtime PM to hammer down the pclk */
#elif CONFIG_PM
   amba_pclk_disable();
#endif

resume():
#if defined(CONFIG_PM)  !defined(CONFIG_PM_RUNTIME)
  amba_pclk_enable();
#endif
  /* Let runtime PM lazily enable the clock when needed */

To complicate things further the bus operations can be
overridden by e.g. voltage domains. In this case we (ux500)
have choosen to call out to the AMBA level to make sure
semantics are preserved.

Yours,
Linus Walleij

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 1/2] spi:pl022: Disable/Enable functional clock from suspend/resume

2012-09-26 Thread Linus Walleij
On Wed, Sep 26, 2012 at 2:19 PM, Mark Brown
broo...@opensource.wolfsonmicro.com wrote:
 On Wed, Sep 26, 2012 at 02:17:36PM +0200, Linus Walleij wrote:
 On Wed, Sep 26, 2012 at 1:24 PM, Vipul Kumar Samar

  SPI functional clock must be disalble/enable in non RTPM suspend/resume
  hooks. Currently it is only done for RTPM cases.

  This patch add support to disable/enbale clock for conventional
  suspend/resume calls.

 Cross dependency between runtime suspend/resume and
 common suspend/resume. Oh the horror ...

 This should be fine, we runtime resume before we suspend.
(...)
 This was clarified at some point relatively recently with the above
 (which is essentially the same as the solution you describe).

Oh. How come that whenever I poke my nose into this stuff I
feel like a compleat n00b X-D

Can you point me to the relevant posts/doc so I can read up on
it, would be much appreciated!

Yours,
Linus Walleij

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [RFC PATCH 00/13] DMA Engine support for AM33xx

2012-09-26 Thread Matt Porter
On Wed, Sep 26, 2012 at 08:26:19AM +, Hebbar, Gururaja wrote:
 On Fri, Sep 21, 2012 at 23:52:11, Porter, Matt wrote:
  On Fri, Sep 21, 2012 at 08:27:07AM +, Hebbar, Gururaja wrote:
   On Thu, Sep 20, 2012 at 20:13:33, Porter, Matt wrote:
This series adds DMA Engine support for AM33xx, which uses
an EDMA DMAC. The EDMA DMAC has been previously supported by only
a private API implementation (much like the situation with OMAP
DMA) found on the DaVinci family of SoCs.

There are a mind-boggling number of dependencies for this series:

- Jon Hunter's OF DMA helpers series
  https://patchwork.kernel.org/patch/1461061/
  https://patchwork.kernel.org/patch/1461051/
- Patch to address OF DMA helpers naming issues:
  https://patchwork.kernel.org/patch/1477921/
- EDMA DMA Engine wrapper driver in linux-next
  c2dde5f8f2095d7c623ff3565c1462e190272273
- EDMA DMA Engine wrapper driver bug fix:
  https://patchwork.kernel.org/patch/1474411/  
- A huge number of patches in linux-next for AM33xx boot
  (too numerous to list)

The approach taken is similar to how OMAP DMA is being converted to
DMA Engine support. With the functional EDMA private API already
existing in mach-davinci/dma.c, we first move that to an ARM common
area so it can be shared. Adding DT and runtime PM support to the
private EDMA API implementation allows it to run on AM33xx. AM33xx
*only* boots using DT so we leverage Jon's generic DT DMA helpers to
register EDMA DMAC with the of_dma framework and then add support
for calling the dma_request_slave_channel() API to both the mmc
and spi drivers.

What works? Well, with this series we now have MMC and SPI support
on AM33xx. The only caveat for MMC is that the mmc3 controller has
its events on the crossbar and is not usable right now.

This is tested on BeagleBone with a SPI framebuffer driver and SD
card.

After this series, the plan is to convert the last in-tree user
of the private EDMA API (davinci-pcm/mcasp) and then eliminate
the private EDMA API by folding its functionality into
drivers/dma/edma.c.

TODO:
add AM33xx crossbar support to the private EDMA API
(any EDMA events on the crossbar are not supported)

   
   
   Can you please mention the base repo you have taken as starting point.
   (repo + extra patches ...).
  
  It's mainline 3.6-rc6 and you can see the complete set of patches
  at https://github.com/ohporter/linux/tree/edma-dmaengine-am33xx-rfc-v1
  after commit 5698bd757d55b1bb87edd1a9744ab09c142abfc2
  
   This will help us to test the code.
   
   This is because I looked at the patch 12/13 and I see that mmc
   device-node is modified. But in mainline I don’t see device 
   node for mmc (yet).
  
  Oops. You'll need e62aae450bcdefbe9d7bc277ae0ef645 and
  fe97304557d2c6f7d0aaf1ea028ea48ffca366a9 which I forgot to include
  in this series. I'll have them in for v2.
 
 Yesterday I tested edma patches on latest linux-next/master + merge of 
 linux-omap/for_3.7/dts_part2. Below are my observations
 
 1. baseline = linux-next/master + merge of linux-omap/for_3.7/dts_part2
 2. on top of above branch, I applied patches [1-9]/13 of your edma 
patches
 3. few patches required trivial changes before applying
 4. Applied dma of patches as you mentioned
 5. add custom patch (ARM: CUSTOM: Build a uImage with dtb already 
appended)
From https://github.com/hvaibhav/am335x-linux/commit/
 7e72f5ed4b702c9373d19f7626f07ae31a381d53#arch/arm/Makefile

Alternatively you can run a current u-boot master build for am335x and
the appended dtb is no longer required.

 6. Modified 9/13 patch to apply properly on latest am33xx.dtsi.
   a. Edma portion as it is
   b. mmc portion as below
   mmc1: mmc@4806 {
   compatible = ti,omap3-hsmmc;
   ti,hwmods = mmc1;
   ti,dual-volt;
   ti,needs-special-reset;
   bus-width = 4;
   vmmc-supply = vmmc_reg;
   dmas = edma 24
   edma 25;
   dma-names = tx, rx;
   };
   c. added mmc pinmux as-well
 
 7. make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm distclean
make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm 
omap2plus_defconfig
 
 8. enabled TI_EDMA from menuconfig (since it was not enabled for 
omap2plus_defconfig
 
 9. make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm uImage
make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm 
uImage-dtb.am335x-evm
 
 With above changes, edma probe was failing at request_mem_region() 
 Inside linux-next/arch/arm/common/edma.c -- edma_probe()
 
 I had to modify 

Re: [PATCH 1/2] spi:pl022: Disable/Enable functional clock from suspend/resume

2012-09-26 Thread viresh kumar
On Wed, Sep 26, 2012 at 5:49 PM, Mark Brown
broo...@opensource.wolfsonmicro.com wrote:
 On Wed, Sep 26, 2012 at 02:17:36PM +0200, Linus Walleij wrote:
 On Wed, Sep 26, 2012 at 1:24 PM, Vipul Kumar Samar

  SPI functional clock must be disalble/enable in non RTPM suspend/resume
  hooks. Currently it is only done for RTPM cases.

  This patch add support to disable/enbale clock for conventional
  suspend/resume calls.

 Cross dependency between runtime suspend/resume and
 common suspend/resume. Oh the horror ...

 This should be fine, we runtime resume before we suspend.

I believe Vipul sent this patch for the cases where RTPM in not
enabled in the configs.

--
viresh

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 1/2] spi:pl022: Disable/Enable functional clock from suspend/resume

2012-09-26 Thread Linus Walleij
On Wed, Sep 26, 2012 at 4:08 PM, viresh kumar viresh.ku...@linaro.org wrote:
 On Wed, Sep 26, 2012 at 5:49 PM, Mark Brown
 broo...@opensource.wolfsonmicro.com wrote:
 On Wed, Sep 26, 2012 at 02:17:36PM +0200, Linus Walleij wrote:
 On Wed, Sep 26, 2012 at 1:24 PM, Vipul Kumar Samar

  SPI functional clock must be disalble/enable in non RTPM suspend/resume
  hooks. Currently it is only done for RTPM cases.

  This patch add support to disable/enbale clock for conventional
  suspend/resume calls.

 Cross dependency between runtime suspend/resume and
 common suspend/resume. Oh the horror ...

 This should be fine, we runtime resume before we suspend.

 I believe Vipul sent this patch for the cases where RTPM in not
 enabled in the configs.

OK so we need to handle the cases where either, both or
just one of them is enabled...

Mark says the defined semantics is that runtime PM is
resumed across suspend/resume but I'd just like to
understand the overall mechanism that makes sure
this happens and I'm go...

However there is another problem with the patch,
because in -next there is also pin control handling
in the runtime hooks, so we need to duplicate
not only clocks but also that in each of the functions.

Maybe we can first make a patch that breaks out
resource handling so we can call that from each
of the suspend/resume calls? (I'll try.)

Yours,
Linus Walleij

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


[PATCH] spi/pl022: use more managed resources

2012-09-26 Thread Linus Walleij
This switches the PL022 SPI driver to use devm_* managed resources
for IRQ, clocks, ioremap and GPIO. Prior to this, the GPIOs would
even leak.

Signed-off-by: Linus Walleij linus.wall...@stericsson.com
---
 drivers/spi/spi-pl022.c | 31 ++-
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index f8568b4..15737bc 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -1,7 +1,7 @@
 /*
  * A driver for the ARM PL022 PrimeCell SSP/SPI bus master.
  *
- * Copyright (C) 2008-2009 ST-Ericsson AB
+ * Copyright (C) 2008-2012 ST-Ericsson AB
  * Copyright (C) 2006 STMicroelectronics Pvt. Ltd.
  *
  * Author: Linus Walleij linus.wall...@stericsson.com
@@ -2074,24 +2074,21 @@ pl022_probe(struct amba_device *adev, const struct 
amba_id *id)
 
if (!platform_info) {
dev_err(dev, probe: no platform data defined\n);
-   status = -ENODEV;
-   goto err_no_pdata;
+   return -ENODEV;
}
 
if (platform_info-num_chipselect) {
num_cs = platform_info-num_chipselect;
} else {
dev_err(dev, probe: no chip select defined\n);
-   status = -ENODEV;
-   goto err_no_pdata;
+   return -ENODEV;
}
 
/* Allocate master with space for data */
master = spi_alloc_master(dev, sizeof(struct pl022));
if (master == NULL) {
dev_err(adev-dev, probe - cannot alloc SPI master\n);
-   status = -ENOMEM;
-   goto err_no_master;
+   return -ENOMEM;
}
 
pl022 = spi_master_get_devdata(master);
@@ -2153,7 +2150,7 @@ pl022_probe(struct amba_device *adev, const struct 
amba_id *id)
pl022-chipselects[i] = cs_gpio;
 
if (gpio_is_valid(cs_gpio)) {
-   if (gpio_request(cs_gpio, ssp-pl022))
+   if (devm_gpio_request(dev, cs_gpio, 
ssp-pl022))
dev_err(adev-dev,
could not request %d gpio\n,
cs_gpio);
@@ -2180,7 +2177,8 @@ pl022_probe(struct amba_device *adev, const struct 
amba_id *id)
goto err_no_ioregion;
 
pl022-phybase = adev-res.start;
-   pl022-virtbase = ioremap(adev-res.start, resource_size(adev-res));
+   pl022-virtbase = devm_ioremap(dev, adev-res.start,
+  resource_size(adev-res));
if (pl022-virtbase == NULL) {
status = -ENOMEM;
goto err_no_ioremap;
@@ -2190,7 +2188,7 @@ pl022_probe(struct amba_device *adev, const struct 
amba_id *id)
 
pm_runtime_resume(dev);
 
-   pl022-clk = clk_get(adev-dev, NULL);
+   pl022-clk = devm_clk_get(adev-dev, NULL);
if (IS_ERR(pl022-clk)) {
status = PTR_ERR(pl022-clk);
dev_err(adev-dev, could not retrieve SSP/SPI bus clock\n);
@@ -2218,8 +2216,8 @@ pl022_probe(struct amba_device *adev, const struct 
amba_id *id)
   SSP_CR1(pl022-virtbase));
load_ssp_default_config(pl022);
 
-   status = request_irq(adev-irq[0], pl022_interrupt_handler, 0, pl022,
-pl022);
+   status = devm_request_irq(dev, adev-irq[0], pl022_interrupt_handler,
+ 0, pl022, pl022);
if (status  0) {
dev_err(adev-dev, probe - cannot get IRQ (%d)\n, status);
goto err_no_irq;
@@ -2259,24 +2257,18 @@ pl022_probe(struct amba_device *adev, const struct 
amba_id *id)
  err_spi_register:
if (platform_info-enable_dma)
pl022_dma_remove(pl022);
-
-   free_irq(adev-irq[0], pl022);
  err_no_irq:
clk_disable(pl022-clk);
  err_no_clk_en:
clk_unprepare(pl022-clk);
  err_clk_prep:
-   clk_put(pl022-clk);
  err_no_clk:
-   iounmap(pl022-virtbase);
  err_no_ioremap:
amba_release_regions(adev);
  err_no_ioregion:
  err_no_gpio:
  err_no_pinctrl:
spi_master_put(master);
- err_no_master:
- err_no_pdata:
return status;
 }
 
@@ -2298,12 +2290,9 @@ pl022_remove(struct amba_device *adev)
if (pl022-master_info-enable_dma)
pl022_dma_remove(pl022);
 
-   free_irq(adev-irq[0], pl022);
clk_disable(pl022-clk);
clk_unprepare(pl022-clk);
-   clk_put(pl022-clk);
pm_runtime_disable(adev-dev);
-   iounmap(pl022-virtbase);
amba_release_regions(adev);
tasklet_disable(pl022-pump_transfers);
spi_unregister_master(pl022-master);
-- 
1.7.11.3


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can 

[PATCH] spi/pl022: get/put resources on suspend/resume

2012-09-26 Thread Linus Walleij
This factors out the resource handling in runtime
suspend/resume and also calls it from the ordinary suspend
and resume hooks.

The semantics require that ordinary PM op suspend is called
with runtime PM in resumed mode, so that ordinary suspend
can assume that it will e.g. decrease the clock reference
counter to 0, runtime resume having previously increased it
to 1.

Cc: Ulf Hansson ulf.hans...@linaro.org
Cc: Vipul Kumar Samar vipulkumar.sa...@st.com
Cc: Viresh Kumar viresh.ku...@linaro.org
Signed-off-by: Linus Walleij linus.wall...@stericsson.com
---
Vipin: can you confirm that this approach works for your
case with only suspend/resume but no runtime PM?

Question: can I be sure that the above semantics is taken
care of by runtime PM, or will I have to add kludges to
the ordinary suspend/resume hooks to make sure that the
device is out of runtime suspend before suspending?
---
 drivers/spi/spi-pl022.c | 64 -
 1 file changed, 42 insertions(+), 22 deletions(-)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 15737bc..63cd7c6 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2300,6 +2300,43 @@ pl022_remove(struct amba_device *adev)
return 0;
 }
 
+/*
+ * These two functions are used from both suspend/resume and
+ * the runtime counterparts to handle external resources like
+ * clocks, pins and regulators when going to sleep.
+ */
+static void pl022_suspend_resources(struct pl022 *pl022)
+{
+   int ret;
+
+   clk_disable(pl022-clk);
+
+   /* Optionally let pins go into sleep states */
+   if (!IS_ERR(pl022-pins_sleep)) {
+   ret = pinctrl_select_state(pl022-pinctrl,
+  pl022-pins_sleep);
+   if (ret)
+   dev_err(pl022-adev-dev,
+   could not set pins to sleep state\n);
+   }
+}
+
+static void pl022_resume_resources(struct pl022 *pl022)
+{
+   int ret;
+
+   /* Optionaly enable pins to be muxed in and configured */
+   if (!IS_ERR(pl022-pins_default)) {
+   ret = pinctrl_select_state(pl022-pinctrl,
+  pl022-pins_default);
+   if (ret)
+   dev_err(pl022-adev-dev,
+   could not set default pins\n);
+   }
+
+   clk_enable(pl022-clk);
+}
+
 #ifdef CONFIG_SUSPEND
 static int pl022_suspend(struct device *dev)
 {
@@ -2311,6 +2348,7 @@ static int pl022_suspend(struct device *dev)
dev_warn(dev, cannot suspend master\n);
return ret;
}
+   pl022_suspend_resources(pl022);
 
dev_dbg(dev, suspended\n);
return 0;
@@ -2321,6 +2359,8 @@ static int pl022_resume(struct device *dev)
struct pl022 *pl022 = dev_get_drvdata(dev);
int ret;
 
+   pl022_resume_resources(pl022);
+
/* Start the queue running */
ret = spi_master_resume(pl022-master);
if (ret)
@@ -2336,36 +2376,16 @@ static int pl022_resume(struct device *dev)
 static int pl022_runtime_suspend(struct device *dev)
 {
struct pl022 *pl022 = dev_get_drvdata(dev);
-   int status = 0;
-
-   clk_disable(pl022-clk);
-
-   /* Optionally let pins go into sleep states */
-   if (!IS_ERR(pl022-pins_sleep)) {
-   status = pinctrl_select_state(pl022-pinctrl,
-   pl022-pins_sleep);
-   if (status)
-   dev_err(dev, could not set pins to sleep state\n);
-   }
 
+   pl022_suspend_resources(pl022);
return 0;
 }
 
 static int pl022_runtime_resume(struct device *dev)
 {
struct pl022 *pl022 = dev_get_drvdata(dev);
-   int status = 0;
-
-   /* Optionaly enable pins to be muxed in and configured */
-   if (!IS_ERR(pl022-pins_default)) {
-   status = pinctrl_select_state(pl022-pinctrl,
-   pl022-pins_default);
-   if (status)
-   dev_err(dev, could not set default pins\n);
-   }
-
-   clk_enable(pl022-clk);
 
+   pl022_resume_resources(pl022);
return 0;
 }
 #endif
-- 
1.7.11.3


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH] spi/pl022: get/put resources on suspend/resume

2012-09-26 Thread Ulf Hansson
I can agree with the code as such. One issue remains though.

You will have compile warnings when not having CONFIG_SUSPEND and
CONFIG_RUNTIME_PM, due to unused code/functions.

Otherwise you have my ack.

Kind regards
Ulf Hansson


On 26 September 2012 17:08, Linus Walleij linus.wall...@stericsson.com wrote:
 This factors out the resource handling in runtime
 suspend/resume and also calls it from the ordinary suspend
 and resume hooks.

 The semantics require that ordinary PM op suspend is called
 with runtime PM in resumed mode, so that ordinary suspend
 can assume that it will e.g. decrease the clock reference
 counter to 0, runtime resume having previously increased it
 to 1.

 Cc: Ulf Hansson ulf.hans...@linaro.org
 Cc: Vipul Kumar Samar vipulkumar.sa...@st.com
 Cc: Viresh Kumar viresh.ku...@linaro.org
 Signed-off-by: Linus Walleij linus.wall...@stericsson.com
 ---
 Vipin: can you confirm that this approach works for your
 case with only suspend/resume but no runtime PM?

 Question: can I be sure that the above semantics is taken
 care of by runtime PM, or will I have to add kludges to
 the ordinary suspend/resume hooks to make sure that the
 device is out of runtime suspend before suspending?
 ---
  drivers/spi/spi-pl022.c | 64 
 -
  1 file changed, 42 insertions(+), 22 deletions(-)

 diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
 index 15737bc..63cd7c6 100644
 --- a/drivers/spi/spi-pl022.c
 +++ b/drivers/spi/spi-pl022.c
 @@ -2300,6 +2300,43 @@ pl022_remove(struct amba_device *adev)
 return 0;
  }

 +/*
 + * These two functions are used from both suspend/resume and
 + * the runtime counterparts to handle external resources like
 + * clocks, pins and regulators when going to sleep.
 + */
 +static void pl022_suspend_resources(struct pl022 *pl022)
 +{
 +   int ret;
 +
 +   clk_disable(pl022-clk);
 +
 +   /* Optionally let pins go into sleep states */
 +   if (!IS_ERR(pl022-pins_sleep)) {
 +   ret = pinctrl_select_state(pl022-pinctrl,
 +  pl022-pins_sleep);
 +   if (ret)
 +   dev_err(pl022-adev-dev,
 +   could not set pins to sleep state\n);
 +   }
 +}
 +
 +static void pl022_resume_resources(struct pl022 *pl022)
 +{
 +   int ret;
 +
 +   /* Optionaly enable pins to be muxed in and configured */
 +   if (!IS_ERR(pl022-pins_default)) {
 +   ret = pinctrl_select_state(pl022-pinctrl,
 +  pl022-pins_default);
 +   if (ret)
 +   dev_err(pl022-adev-dev,
 +   could not set default pins\n);
 +   }
 +
 +   clk_enable(pl022-clk);
 +}
 +
  #ifdef CONFIG_SUSPEND
  static int pl022_suspend(struct device *dev)
  {
 @@ -2311,6 +2348,7 @@ static int pl022_suspend(struct device *dev)
 dev_warn(dev, cannot suspend master\n);
 return ret;
 }
 +   pl022_suspend_resources(pl022);

 dev_dbg(dev, suspended\n);
 return 0;
 @@ -2321,6 +2359,8 @@ static int pl022_resume(struct device *dev)
 struct pl022 *pl022 = dev_get_drvdata(dev);
 int ret;

 +   pl022_resume_resources(pl022);
 +
 /* Start the queue running */
 ret = spi_master_resume(pl022-master);
 if (ret)
 @@ -2336,36 +2376,16 @@ static int pl022_resume(struct device *dev)
  static int pl022_runtime_suspend(struct device *dev)
  {
 struct pl022 *pl022 = dev_get_drvdata(dev);
 -   int status = 0;
 -
 -   clk_disable(pl022-clk);
 -
 -   /* Optionally let pins go into sleep states */
 -   if (!IS_ERR(pl022-pins_sleep)) {
 -   status = pinctrl_select_state(pl022-pinctrl,
 -   pl022-pins_sleep);
 -   if (status)
 -   dev_err(dev, could not set pins to sleep state\n);
 -   }

 +   pl022_suspend_resources(pl022);
 return 0;
  }

  static int pl022_runtime_resume(struct device *dev)
  {
 struct pl022 *pl022 = dev_get_drvdata(dev);
 -   int status = 0;
 -
 -   /* Optionaly enable pins to be muxed in and configured */
 -   if (!IS_ERR(pl022-pins_default)) {
 -   status = pinctrl_select_state(pl022-pinctrl,
 -   pl022-pins_default);
 -   if (status)
 -   dev_err(dev, could not set default pins\n);
 -   }
 -
 -   clk_enable(pl022-clk);

 +   pl022_resume_resources(pl022);
 return 0;
  }
  #endif
 --
 1.7.11.3


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 

Re: [PATCH] spi/pl022: get/put resources on suspend/resume

2012-09-26 Thread Linus Walleij
On Wed, Sep 26, 2012 at 5:23 PM, Ulf Hansson ulf.hans...@linaro.org wrote:

 You will have compile warnings when not having CONFIG_SUSPEND and
 CONFIG_RUNTIME_PM, due to unused code/functions.

Argh the evil #fidefs... I'll put in even more of them then.

 Otherwise you have my ack.

Thanks!

Yours,
Linus Walleij

--
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


[PATCH] spi/pl022: Simplify use of runtime pm

2012-09-26 Thread Ulf Hansson
From: Ulf Hansson ulf.hans...@linaro.org

Signed-off-by: Ulf Hansson ulf.hans...@linaro.org
---
 drivers/spi/spi-pl022.c |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index f8568b4..e51a026 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2188,8 +2188,6 @@ pl022_probe(struct amba_device *adev, const struct 
amba_id *id)
printk(KERN_INFO pl022: mapped registers from 0x%08x to %p\n,
   adev-res.start, pl022-virtbase);
 
-   pm_runtime_resume(dev);
-
pl022-clk = clk_get(adev-dev, NULL);
if (IS_ERR(pl022-clk)) {
status = PTR_ERR(pl022-clk);
@@ -2250,10 +2248,9 @@ pl022_probe(struct amba_device *adev, const struct 
amba_id *id)
pm_runtime_set_autosuspend_delay(dev,
platform_info-autosuspend_delay);
pm_runtime_use_autosuspend(dev);
-   pm_runtime_put_autosuspend(dev);
-   } else {
-   pm_runtime_put(dev);
}
+   pm_runtime_put(dev);
+
return 0;
 
  err_spi_register:
@@ -2302,7 +2299,6 @@ pl022_remove(struct amba_device *adev)
clk_disable(pl022-clk);
clk_unprepare(pl022-clk);
clk_put(pl022-clk);
-   pm_runtime_disable(adev-dev);
iounmap(pl022-virtbase);
amba_release_regions(adev);
tasklet_disable(pl022-pump_transfers);
-- 
1.7.10


--
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH] spi/pl022: get/put resources on suspend/resume

2012-09-26 Thread Ulf Hansson
On 26 September 2012 17:27, Linus Walleij linus.wall...@linaro.org wrote:
 On Wed, Sep 26, 2012 at 5:23 PM, Ulf Hansson ulf.hans...@linaro.org wrote:

 You will have compile warnings when not having CONFIG_SUSPEND and
 CONFIG_RUNTIME_PM, due to unused code/functions.

 Argh the evil #fidefs... I'll put in even more of them then.

Unless you duplicate some minor pieces of code, which I think would be
ok in this case. :-)


 Otherwise you have my ack.

 Thanks!

 Yours,
 Linus Walleij

Kind regards
Ulf Hansson

--
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


[PATCH v2] spi/pl022: get/put resources on suspend/resume

2012-09-26 Thread Linus Walleij
This factors out the resource handling in runtime
suspend/resume and also calls it from the ordinary suspend
and resume hooks.

The semantics require that ordinary PM op suspend is called
with runtime PM in resumed mode, so that ordinary suspend
can assume that it will e.g. decrease the clock reference
counter to 0, runtime resume having previously increased it
to 1.

Cc: Vipul Kumar Samar vipulkumar.sa...@st.com
Cc: Viresh Kumar viresh.ku...@linaro.org
Acked-by: Ulf Hansson ulf.hans...@linaro.org
Signed-off-by: Linus Walleij linus.wall...@stericsson.com
---
ChangeLog v1-v2:
- Add more #ifdef for the case where we have neither normal
  PM nor runtime PM.
---
 drivers/spi/spi-pl022.c | 66 -
 1 file changed, 44 insertions(+), 22 deletions(-)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 15737bc..9194641 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2300,6 +2300,45 @@ pl022_remove(struct amba_device *adev)
return 0;
 }
 
+#if defined(CONFIG_SUSPEND) || defined(CONFIG_PM_RUNTIME)
+/*
+ * These two functions are used from both suspend/resume and
+ * the runtime counterparts to handle external resources like
+ * clocks, pins and regulators when going to sleep.
+ */
+static void pl022_suspend_resources(struct pl022 *pl022)
+{
+   int ret;
+
+   clk_disable(pl022-clk);
+
+   /* Optionally let pins go into sleep states */
+   if (!IS_ERR(pl022-pins_sleep)) {
+   ret = pinctrl_select_state(pl022-pinctrl,
+  pl022-pins_sleep);
+   if (ret)
+   dev_err(pl022-adev-dev,
+   could not set pins to sleep state\n);
+   }
+}
+
+static void pl022_resume_resources(struct pl022 *pl022)
+{
+   int ret;
+
+   /* Optionaly enable pins to be muxed in and configured */
+   if (!IS_ERR(pl022-pins_default)) {
+   ret = pinctrl_select_state(pl022-pinctrl,
+  pl022-pins_default);
+   if (ret)
+   dev_err(pl022-adev-dev,
+   could not set default pins\n);
+   }
+
+   clk_enable(pl022-clk);
+}
+#endif
+
 #ifdef CONFIG_SUSPEND
 static int pl022_suspend(struct device *dev)
 {
@@ -2311,6 +2350,7 @@ static int pl022_suspend(struct device *dev)
dev_warn(dev, cannot suspend master\n);
return ret;
}
+   pl022_suspend_resources(pl022);
 
dev_dbg(dev, suspended\n);
return 0;
@@ -2321,6 +2361,8 @@ static int pl022_resume(struct device *dev)
struct pl022 *pl022 = dev_get_drvdata(dev);
int ret;
 
+   pl022_resume_resources(pl022);
+
/* Start the queue running */
ret = spi_master_resume(pl022-master);
if (ret)
@@ -2336,36 +2378,16 @@ static int pl022_resume(struct device *dev)
 static int pl022_runtime_suspend(struct device *dev)
 {
struct pl022 *pl022 = dev_get_drvdata(dev);
-   int status = 0;
-
-   clk_disable(pl022-clk);
-
-   /* Optionally let pins go into sleep states */
-   if (!IS_ERR(pl022-pins_sleep)) {
-   status = pinctrl_select_state(pl022-pinctrl,
-   pl022-pins_sleep);
-   if (status)
-   dev_err(dev, could not set pins to sleep state\n);
-   }
 
+   pl022_suspend_resources(pl022);
return 0;
 }
 
 static int pl022_runtime_resume(struct device *dev)
 {
struct pl022 *pl022 = dev_get_drvdata(dev);
-   int status = 0;
-
-   /* Optionaly enable pins to be muxed in and configured */
-   if (!IS_ERR(pl022-pins_default)) {
-   status = pinctrl_select_state(pl022-pinctrl,
-   pl022-pins_default);
-   if (status)
-   dev_err(dev, could not set default pins\n);
-   }
-
-   clk_enable(pl022-clk);
 
+   pl022_resume_resources(pl022);
return 0;
 }
 #endif
-- 
1.7.11.3


--
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH V4] MXS: Implement DMA support into mxs-i2c

2012-09-26 Thread Marek Vasut
Dear Wolfram Sang,

[...]

Didn't you claim you're adding this DMA patch into next some time ago finally? 
;-)

Subject: Re: I2C_FUNC_SMBUS_QUICK on i2c-mxs
Message-ID: 20120830135612.gj27...@pengutronix.de

Best regards,
Marek Vasut

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Votre cadeau déco pour moins de 10 euros

2012-09-26 Thread PosterXXL par Duano
Pour voir le message, veuillez utiliser un lecteur de mail compatible HTML

Lien miroir : 
http://m10-fr.com/mc10_m/YT0xMyZiPTIwNzA1JmM9NDgzNjEyJmQ9MjAxMi0wOS0yNyAwMjoxMDowMSZlPTEmaD0yMDcwNCZmPTIwNzA1Jmc9MjA3MDU=

Lien de désinscription : 
http://m10-fr.com/mc10_unsub/YT0xMyZiPTIwNzA1JmM9NDgzNjEyJmQ9MjAxMi0wOS0yNyAwMjoxMDowMSZlPTEmaD0yMDcwNCZmPTIwNzA1Jmc9MjA3MDU=


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH v2] spi/pl022: get/put resources on suspend/resume

2012-09-26 Thread vipul kumar samar
On 9/26/2012 9:36 PM, Linus WALLEIJ wrote:
 This factors out the resource handling in runtime
 suspend/resume and also calls it from the ordinary suspend
 and resume hooks.

 The semantics require that ordinary PM op suspend is called
 with runtime PM in resumed mode, so that ordinary suspend
 can assume that it will e.g. decrease the clock reference
 counter to 0, runtime resume having previously increased it
 to 1.

 Cc: Vipul Kumar Samarvipulkumar.sa...@st.com
 Cc: Viresh Kumarviresh.ku...@linaro.org
 Acked-by: Ulf Hanssonulf.hans...@linaro.org
 Signed-off-by: Linus Walleijlinus.wall...@stericsson.com
 ---
 ChangeLog v1-v2:
 - Add more #ifdef for the case where we have neither normal
PM nor runtime PM.
 ---
   drivers/spi/spi-pl022.c | 66 
 -
   1 file changed, 44 insertions(+), 22 deletions(-)

 diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
 index 15737bc..9194641 100644
 --- a/drivers/spi/spi-pl022.c
 +++ b/drivers/spi/spi-pl022.c
 @@ -2300,6 +2300,45 @@ pl022_remove(struct amba_device *adev)
   return 0;
   }

 +#if defined(CONFIG_SUSPEND) || defined(CONFIG_PM_RUNTIME)
 +/*
 + * These two functions are used from both suspend/resume and
 + * the runtime counterparts to handle external resources like
 + * clocks, pins and regulators when going to sleep.
 + */
 +static void pl022_suspend_resources(struct pl022 *pl022)
 +{
 + int ret;
 +
 + clk_disable(pl022-clk);
 +
 + /* Optionally let pins go into sleep states */
 + if (!IS_ERR(pl022-pins_sleep)) {
 + ret = pinctrl_select_state(pl022-pinctrl,
 +pl022-pins_sleep);
 + if (ret)
 + dev_err(pl022-adev-dev,
 + could not set pins to sleep state\n);
 + }
 +}
 +
 +static void pl022_resume_resources(struct pl022 *pl022)
 +{
 + int ret;
 +
 + /* Optionaly enable pins to be muxed in and configured */
 + if (!IS_ERR(pl022-pins_default)) {
 + ret = pinctrl_select_state(pl022-pinctrl,
 +pl022-pins_default);
 + if (ret)
 + dev_err(pl022-adev-dev,
 + could not set default pins\n);
 + }
 +
 + clk_enable(pl022-clk);

What happen in case clk_enable returns an error??

Rest all is fine.

Regards
Vipul Samar

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Des petits prix à tomber. Des sélections beauté à partir de 2 euros.

2012-09-26 Thread Yves Rocher par Duano
Pour voir le message, veuillez utiliser un lecteur de mail compatible HTML

Lien miroir : 
http://m10-fr.com/mc10_m/YT0xMyZiPTIxMDQzJmM9NDgzNjEyJmQ9MjAxMi0wOS0yNyAwNjo1MDowMSZlPTEmaD0yMTA0MiZmPTIxMDQzJmc9MjEwNDM=

Lien de désinscription : 
http://m10-fr.com/mc10_unsub/YT0xMyZiPTIxMDQzJmM9NDgzNjEyJmQ9MjAxMi0wOS0yNyAwNjo1MDowMSZlPTEmaD0yMTA0MiZmPTIxMDQzJmc9MjEwNDM=


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Vos cartouches d'encre chez vous au meilleur prix avec un cadeau

2012-09-26 Thread Toner Services par Galerie Des Marques
Pour voir le message, veuillez utiliser un lecteur de mail compatible HTML

Lien miroir : 
http://m10-fr.com/mc10_m/YT04JmI9MjEwNDkmYz0xOTYxNjQxJmQ9MjAxMi0wOS0yNyAwNzowMDowMiZlPTEmaD0yMTA0OCZmPTIxMDQ5Jmc9MjEwNDk=

Lien de désinscription : 
http://m10-fr.com/mc10_unsub/YT04JmI9MjEwNDkmYz0xOTYxNjQxJmQ9MjAxMi0wOS0yNyAwNzowMDowMiZlPTEmaD0yMTA0OCZmPTIxMDQ5Jmc9MjEwNDk=


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general