Re: [PATCH] spi: add spi controller master driver for Blackfin 6xx processor

2013-06-03 Thread Viresh Kumar
On Tue, Jun 4, 2013 at 3:13 AM, Scott Jiang scott.jiang.li...@gmail.com wrote: diff --git a/drivers/spi/spi-bfin6xx.c b/drivers/spi/spi-bfin6xx.c +#include linux/workqueue.h Why do you need this? -- Get 100%

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

Re: [PATCH] spi: pl022: Add clk_{un}prepare() support in runtime PM

2012-09-17 Thread viresh kumar
On Mon, Sep 17, 2012 at 4:07 PM, Vipul Kumar Samar vipulkumar.sa...@st.com wrote: clk_{un}prepare is mandatory for platforms using common clock framework. Add clk_{un}prepare() support for spi-pl022 runtime PM. You are not calling these routines in actualy patch.. Fix commit log and add my

Re: [PATCH] spi: pl022: Add clk_{un}prepare() support in runtime PM

2012-09-17 Thread viresh kumar
On Mon, Sep 17, 2012 at 7:09 PM, Linus Walleij linus.wall...@linaro.org wrote: This driver does clk_prepare/unprepare at probe and removed, so I guess what you're trying to say is that on your platform the clk_unprepare() process context call is needed to save power? Please elaborate... Hi

Re: [PATCH] spi/pl022: Fill master-dev.of_node to get spi devices registered via DT

2012-08-22 Thread Viresh Kumar
On 19 August 2012 03:56, Linus Walleij linus.wall...@linaro.org wrote: On Sat, Aug 18, 2012 at 4:25 AM, Viresh Kumar viresh.ku...@linaro.org wrote: spi_register_master() calls of_register_spi_devices() to register spi devices. This routine expects master-dev.of_node to be a valid pointer

[PATCH] spi/pl022: Fill master-dev.of_node to get spi devices registered via DT

2012-08-17 Thread Viresh Kumar
spi_register_master() calls of_register_spi_devices() to register spi devices. This routine expects master-dev.of_node to be a valid pointer. This is responsibility of master driver to fill this field, which wasn't done for pl022. Fix it to get devices added to pl022. Signed-off-by: Viresh Kumar

Re: [PATCH] spi: pl022: Fix calculate_effective_freq()

2012-04-26 Thread Viresh Kumar
On 4/19/2012 2:44 PM, Viresh KUMAR wrote: calculate_effective_freq() was still not optimized and there were cases when it returned without error and with values of cpsr and scr as zero. Also, the variable named found is not used well. This patch targets to optimize and correct

[PATCH] spi: pl022: Allow request for higher frequency than maximum possible

2012-04-19 Thread Viresh Kumar
Shenoy vinit.she...@st.com Signed-off-by: Viresh Kumar viresh.ku...@st.com --- drivers/spi/spi-pl022.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 09c925a..99d5f6d 100644 --- a/drivers/spi/spi-pl022.c

[PATCH] spi: pl022: Fix calculate_effective_freq()

2012-04-19 Thread Viresh Kumar
calculate_effective_freq() was still not optimized and there were cases when it returned without error and with values of cpsr and scr as zero. Also, the variable named found is not used well. This patch targets to optimize and correct this routine. Tested for SPEAr. Signed-off-by: Viresh Kumar

Re: [PATCH] spi/pl022: Add high priority message pump support

2012-01-24 Thread Viresh Kumar
pl022_ssp_controller { u16 bus_id; @@ -250,6 +252,7 @@ struct pl022_ssp_controller { void *dma_rx_param; void *dma_tx_param; int autosuspend_delay; + bool rt; }; /** Looks fine. Acked-by: Viresh Kumar viresh.ku...@st.com -- viresh

Re: [PATCH 3/7] spi/pl022: skip default configuration before suspending

2011-11-22 Thread Viresh Kumar
); return 0; } Reviewed-by: Viresh Kumar viresh.ku...@st.com -- viresh -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security

Re: [PATCH 4/7] spi/pl022: move device disable to workqueue thread

2011-11-22 Thread Viresh Kumar
anymore? Reviewed-by: Viresh Kumar viresh.ku...@st.com -- viresh -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats

Re: [PATCH 7/7] spi/pl022: make the chip deselect handling thread safe

2011-11-22 Thread Viresh Kumar
; spin_unlock_irqrestore(pl022-queue_lock, flags); queue_work(pl022-workqueue, pl022-pump_messages); Reviewed-by: Viresh Kumar viresh.ku...@st.com -- viresh -- All the data continuously generated in your IT infrastructure

Re: [PATCH 1/6] spi/pl022: only enable RX interrupts when TX is complete

2011-11-09 Thread Viresh Kumar
On 11/9/2011 4:08 PM, Linus WALLEIJ wrote: + /* default is to enable all interrupts except RX - + * this will be enabled once TX is complete + */ Other than fixing this multiline comment, everything other looks fine. Reviewed-by: Viresh Kumar viresh.ku...@st.com -- viresh

Re: [PATCH 2/6] spi/pl022: fix build warnings

2011-11-09 Thread Viresh Kumar
(spi-master); unsigned int bits = spi-bits_per_word; Reviewed-by: Viresh Kumar viresh.ku...@st.com -- viresh -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1

Re: [PATCH 3/6] spi/pl022: disable the PL022 block when unused

2011-11-09 Thread Viresh Kumar
)) + (~SSP_CR1_MASK_SSE)), SSP_CR1(pl022-virtbase)); + /* This message is completed, so let's turn off the clocks power */ pm_runtime_put(pl022-adev-dev); } Reviewed-by: Viresh Kumar viresh.ku...@st.com -- viresh

Re: [PATCH 4/6] spi/pl022: skip default configuration before suspending

2011-11-09 Thread Viresh Kumar
On 11/9/2011 4:09 PM, Linus WALLEIJ wrote: From: Virupax Sadashivpetimath virupax.sadashivpetim...@stericsson.com The loading of the default configuration before suspending has been in the driver since its inception, but it is not really needed. Especially so since we take to all the trouble

Re: [PATCH 5/6] spi/pl022: move device disable to workqueue thread

2011-11-09 Thread Viresh Kumar
On 11/9/2011 4:09 PM, Linus WALLEIJ wrote: From: Chris Blair chris.bl...@stericsson.com diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index bffad2a..2e3522d 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -512,13 +512,6 @@ static void giveback(struct

Re: [PATCH 6/6] spi/pl022: add support for pm_runtime autosuspend

2011-11-09 Thread Viresh Kumar
*dma_tx_param; + int autosuspend_delay; }; /** Reviewed-by: Viresh Kumar viresh.ku...@st.com -- viresh -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1

Re: [PATCH 1/3] spi/pl022: fix build warnings

2011-10-18 Thread Viresh Kumar
(spi-master); unsigned int bits = spi-bits_per_word; Reviewed-by: Viresh Kumar viresh.ku...@st.com -- viresh -- All the data continuously generated in your IT infrastructure contains a definitive record

Re: [PATCH 3/3] spi/pl022: skip default configuration before suspending

2011-10-18 Thread Viresh Kumar
status; } - amba_vcore_enable(adev); - amba_pclk_enable(adev); - load_ssp_default_config(pl022); - amba_pclk_disable(adev); - amba_vcore_disable(adev); dev_dbg(adev-dev, suspended\n); return 0; } Reviewed-by: Viresh Kumar viresh.ku...@st.com

Re: [PATCH V2 0/6] spi/spi-pl022 fixes

2011-09-20 Thread Viresh Kumar
On 9/1/2011 4:26 PM, Linus Walleij wrote: I agree. Acked-by: Linus Walleij linus.wall...@linaro.org for all except 6/6, it's probably just as possible to keep the channel handle taken in the driver if we modify the affected DMA driver instead. This would be better for performance I think. Hi

Re: [PATCH V2 0/6] spi/spi-pl022 fixes

2011-09-01 Thread Viresh Kumar
On 8/10/2011 2:20 PM, Viresh KUMAR wrote: Hi Grant, I have added Tested-by: Linus Walleij linus.wall...@linaro.org on all patches. This patchset mainly covers following fixes: - formatting related issues - Passing GFP_ATOMIC for sg allocation from tasklet - Fixing

[PATCH V2 2/6] spi/spi-pl022: Use GFP_ATOMIC for allocation from tasklet

2011-08-10 Thread Viresh Kumar
tasklets don't allow invocation to sleeping routines. In configure_dma() routine, sg_alloc_table() was called with GFP_KERNEL flag and so this causes crash when called from tasklet. Replace GFP_KERNEL with GFP_ATOMIC to get this fixed. Signed-off-by: Viresh Kumar viresh.ku...@st.com Tested

[PATCH V2 1/6] spi/spi-pl022: Resolve formatting issues

2011-08-10 Thread Viresh Kumar
There were few formatting related issues in code. This patch fixes them. Fixes include: - Remove extra blank lines - align code to 80 cols - combine several lines to one line - Replace multiple spaces with tabs - Remove spaces before labels Signed-off-by: Viresh Kumar viresh.ku...@st.com Tested

[PATCH V2 4/6] spi/spi-pl022: calculate_effective_freq() must set rate = requested rate

2011-08-10 Thread Viresh Kumar
to get more closer rate. This patch fixes these two issues, with some reformatting inside the code. This also creates a inline routine to calculate prescaled rate based on spi's rate, cpsdvsr and scr. Signed-off-by: Viresh Kumar viresh.ku...@st.com Tested-by: Linus Walleij linus.wall...@linaro.org

[PATCH V2 3/6] spi/spi-pl022: Don't allocate more sg than required.

2011-08-10 Thread Viresh Kumar
In routine configure_dma(), if transfer-len = PAGE_SIZE, then pages is one more than required. While leads to one more sg getting allocated. This is wrong. Correct this to allocate correct number of sg. Signed-off-by: Viresh Kumar viresh.ku...@st.com Tested-by: Linus Walleij linus.wall

[PATCH V2 5/6] spi/spi-pl022: Call pl022_dma_remove(pl022) only if enable_dma is true

2011-08-10 Thread Viresh Kumar
pl022_dma_remove() should be called only if enable_dma is true. There is no point calling it when pl022_dma_probe() is not called, which again depends on enable_dma. Signed-off-by: Viresh Kumar viresh.ku...@st.com Tested-by: Linus Walleij linus.wall...@linaro.org --- drivers/spi/spi-pl022.c

Re: [PATCH V2 6/6] spi/spi-pl022: Request/free DMA channels as and when required.

2011-08-10 Thread viresh kumar
On 08/10/2011 02:30 PM, Russell King - ARM Linux wrote: They must be allocated when they are required and must be freed after we are done with transfers. So that they can be used by other users. Which DMA engine driver requires this? dw_dmac.c Normally, when we have DMA engine drivers

Re: [PATCH V2 3/6] spi/spi-pl022: Don't allocate more sg than required.

2011-08-10 Thread viresh kumar
On 08/10/2011 02:24 PM, Russell King - ARM Linux wrote: It would be far better for this to be: pages = DIV_ROUND_UP(pl022-cur_transfer-len, PAGE_SIZE); The compiler will probably optimize it to the same code anyway. I thought of it too, but missed to update code. Thanks. -- viresh

[PATCH V2 6/6] spi/spi-pl022: Request/free DMA channels as and when required.

2011-08-10 Thread Viresh Kumar
Currently we request DMA channels at probe time and free them at remove. They are always occupied, irrespective of their usage. They must be allocated when they are required and must be freed after we are done with transfers. So that they can be used by other users. Signed-off-by: Viresh Kumar

Re: [PATCH V2 6/6] spi/spi-pl022: Request/free DMA channels as and when required.

2011-08-10 Thread viresh kumar
On 08/10/2011 03:31 PM, Koul, Vinod wrote: And on your patch, are you able to dynamically assign the channels for platform? What is the intended usage? (as Russell articulated it is bad to dynamically assign channel for something like uart) Are you talking about channels or DMA request lines?

[PATCH V3 3/6] spi/spi-pl022: Don't allocate more sg than required.

2011-08-10 Thread Viresh Kumar
In routine configure_dma(), if transfer-len = PAGE_SIZE, then pages is one more than required. While leads to one more sg getting allocated. This is wrong. Correct this to allocate correct number of sg. Signed-off-by: Viresh Kumar viresh.ku...@st.com Tested-by: Linus Walleij linus.wall

Re: [PATCH V2 3/6] spi/spi-pl022: Don't allocate more sg than required.

2011-08-10 Thread viresh kumar
On 08/10/2011 05:12 PM, Sergei Shtylyov wrote: - pages = (pl022-cur_transfer-len PAGE_SHIFT) + 1; + pages = ((pl022-cur_transfer-len + (1 PAGE_SHIFT) - 1) +PAGE_SHIFT); No need for parens around the rvalue. Oops, that was a mistake. Anyway i have send V3 for the

[PATCH 1/6] spi/spi-pl022: Resolve formatting issues

2011-08-09 Thread Viresh Kumar
There were few formatting related issues in code. This patch fixes them. Fixes include: - Remove extra blank lines - align code to 80 cols - combine several lines to one line - Replace multiple spaces with tabs - Remove spaces before labels Signed-off-by: Viresh Kumar viresh.ku...@st.com

[PATCH 5/6] spi/spi-pl022: Call pl022_dma_remove(pl022) only if enable_dma is true

2011-08-09 Thread Viresh Kumar
pl022_dma_remove() should be called only if enable_dma is true. There is no point calling it when pl022_dma_probe() is not called, which again depends on enable_dma. Signed-off-by: Viresh Kumar viresh.ku...@st.com --- drivers/spi/spi-pl022.c |8 ++-- 1 files changed, 6 insertions(+), 2

[PATCH 0/6] spi/spi-pl022 fixes

2011-08-09 Thread Viresh Kumar
: commit 9be355da3bae9feb09cdaf80c3ab560f1f0172cb Author: Stephen Rothwell s...@canb.auug.org.au Date: Tue Aug 9 13:30:19 2011 +1000 Add linux-next specific files for 20110809 Signed-off-by: Stephen Rothwell s...@canb.auug.org.au Looking forward to see your view on the patchset. Viresh

[PATCH 3/6] spi/spi-pl022: Don't allocate more sg than required.

2011-08-09 Thread Viresh Kumar
In routine configure_dma(), if transfer-len = PAGE_SIZE, then pages is one more than required. While leads to one more sg getting allocated. This is wrong. Correct this to allocate correct number of sg. Signed-off-by: Viresh Kumar viresh.ku...@st.com --- drivers/spi/spi-pl022.c |3 ++- 1

[PATCH 6/6] spi/spi-pl022: Request/free DMA channels as and when required.

2011-08-09 Thread Viresh Kumar
Currently we request DMA channels at probe time and free them at remove. They are always occupied, irrespective of their usage. They must be allocated when they are required and must be freed after we are done with transfers. So that they can be used by other users. Signed-off-by: Viresh Kumar

[PATCH 2/6] spi/spi-pl022: Use GFP_NOWAIT for allocation from tasklet

2011-08-09 Thread Viresh Kumar
tasklets don't allow invocation to sleeping routines. In configure_dma() routine, sg_alloc_table() was called with GFP_KERNEL flag and so this causes crash when called from tasklet. Replace GFP_KERNEL with GFP_NOWAIT to get this fixed. Signed-off-by: Viresh Kumar viresh.ku...@st.com --- drivers

Re: [PATCH 2/6] spi/spi-pl022: Use GFP_NOWAIT for allocation from tasklet

2011-08-09 Thread viresh kumar
On 08/09/2011 04:56 PM, Jassi Brar wrote: Since this could be called from when we actually need the transfer start, maybe we could try harder using GFP_ATOMIC instead ? Yes. Will do it. -- viresh -- uberSVN's rich

Re: [PATCH 4/6] spi/spi-pl022: calculate_effective_freq() must set rate = requested rate

2011-08-09 Thread viresh kumar
[Probably you missed reply-all by mistake, so adding them again] On 08/10/2011 01:34 AM, Linus Walleij wrote: On Tue, Aug 9, 2011 at 1:05 PM, Viresh Kumar viresh.ku...@st.com wrote: There were few issues with calculate_effective_freq() routine: - It was returning first rate found = requested

Re: [PATCH 0/6] spi/spi-pl022 fixes

2011-08-09 Thread viresh kumar
On 08/10/2011 01:40 AM, Linus Walleij wrote: On Tue, Aug 9, 2011 at 1:05 PM, Viresh Kumar viresh.ku...@st.com wrote: This patchset mainly covers following fixes: - formatting related issues - Passing GFP_NOWAIT for sg allocation from tasklet - Fixing calculate_effective_freq() routine

Re: spi/spi-pl022: Query on working of DMA mode

2011-08-04 Thread viresh kumar
On 08/04/2011 03:46 PM, Linus Walleij wrote: No maybe not, my test cases are for single messages, and on production systems we mainly use IRQ-driven traffic. I need to have these tests added I believe :-/ If you fix this up it will be much appreciated! Ya I am fixing this up. I have

spi/spi-pl022: Query on working of DMA mode

2011-08-03 Thread viresh kumar
Hi Linus, I am preparing few patches for spi-pl022 for Allocating DMA channels as and when required. And i found something strange. When we have many transfers in a single message, following routines are called in specified order: tasklet_schedule(pump_transfers) pump_transfers(unsigned long

Re: [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

2011-05-16 Thread viresh kumar
On 05/16/2011 04:34 PM, Russell King - ARM Linux wrote: On Mon, May 16, 2011 at 09:40:10AM +0530, Viresh Kumar wrote: If pl022_dma_probe fails, we can try to transfer data in polling or interrupt mode. Also, set platform_info-enable_dma to 0, so that no other code tries to use dma

Re: [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

2011-05-16 Thread viresh kumar
On 05/16/2011 09:40 AM, Viresh KUMAR wrote: If pl022_dma_probe fails, we can try to transfer data in polling or interrupt mode. Also, set platform_info-enable_dma to 0, so that no other code tries to use dma. Signed-off-by: Viresh Kumar viresh.ku...@st.com Acked-by: Linus Walleij linus.wall

[PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

2011-05-15 Thread Viresh Kumar
If pl022_dma_probe fails, we can try to transfer data in polling or interrupt mode. Also, set platform_info-enable_dma to 0, so that no other code tries to use dma. Signed-off-by: Viresh Kumar viresh.ku...@st.com Acked-by: Linus Walleij linus.wall...@linaro.org --- drivers/spi/amba-pl022.c

Re: [QUERY] amba/pl022: DMA channel allocation always fail.

2011-05-15 Thread viresh kumar
On 05/13/2011 08:01 PM, Linus Walleij wrote: 2011/5/13 viresh kumar viresh.ku...@st.com: amba/pl022 and my dma driver dw_dmac.c, both have registered init() routines with subsys_initcall(). Now at bootup, spi boots up before DMA and so DMA channels are never available at spi probe. What

Re: [QUERY] Behavior of spi slave memories w.r.t chip select signal.

2011-05-13 Thread viresh kumar
On 05/13/2011 12:24 PM, Linus Walleij wrote: 2011/5/13 viresh kumar viresh.ku...@st.com: Linus, Jamie, Have you ever seen this kind of issue? Which spi slave memories did you used for testing? I am using standard pl0022 and m25p80 driver. Tried in all modes: polling, interrupt, dma

[PATCH] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

2011-05-13 Thread Viresh Kumar
If pl022_dma_probe fails, we can try to transfer data in polling or interrupt mode. Also, set platform_info-enable_dma to 0, so that no other code tries to use dma. Signed-off-by: Viresh Kumar viresh.ku...@st.com --- drivers/spi/amba-pl022.c | 11 ++- 1 files changed, 6 insertions

[QUERY] amba/pl022: DMA channel allocation always fail.

2011-05-13 Thread viresh kumar
Linus, amba/pl022 and my dma driver dw_dmac.c, both have registered init() routines with subsys_initcall(). Now at bootup, spi boots up before DMA and so DMA channels are never available at spi probe. What should be done to solve this issue? One idea is allocate DMA channel as and when

Re: [PATCH] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails

2011-05-13 Thread viresh kumar
On 5/13/11, Viresh Kumar viresh.ku...@st.com wrote: diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c index 08de58e..82b98b8 100644 --- a/drivers/spi/amba-pl022.c +++ b/drivers/spi/amba-pl022.c @@ -1063,7 +1063,7 @@ static int __init pl022_dma_probe(struct pl022 *pl022

Re: [QUERY] Behavior of spi slave memories w.r.t chip select signal.

2011-05-12 Thread viresh kumar
On 05/11/2011 09:37 AM, viresh kumar wrote: Hello, Following is what i understood after reading m25p80 driver and spi master drivers in drivers/spi folder. chip_select signal controls start and end of transfer. For ex: if we have to read status reg of spi memory, then we use

Re: [QUERY] Behavior of spi slave memories w.r.t chip select signal.

2011-05-11 Thread viresh kumar
On 05/11/2011 12:47 PM, Jamie Iles wrote: What SPI controller are you using? I've seen a similar issue with the Synopsys DesignWare SPI controller where the controller manages the chip select itself, and once the FIFO is emptied the CS goes away, but the flash chip requires it to stay high

[QUERY] Behavior of spi slave memories w.r.t chip select signal.

2011-05-10 Thread viresh kumar
Hello, Following is what i understood after reading m25p80 driver and spi master drivers in drivers/spi folder. chip_select signal controls start and end of transfer. For ex: if we have to read status reg of spi memory, then we use write_and_then_read() routine. which writes 0x9F in one spi

[PATCH] amba-pl022: fixing compilation warning.

2011-01-13 Thread Viresh Kumar
clk_freq is used uninitialized in pl022_setup routine. This patch fix compilation warning for using uninitialized variable Signed-off-by: Viresh Kumar viresh.ku...@st.com --- drivers/spi/amba-pl022.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/spi/amba-pl022