Re: [PATCH 00/12] dma: various minor clean ups for slave drivers

2013-07-10 Thread Andy Shevchenko
On Thu, 2013-05-30 at 23:17 +0530, Vinod Koul wrote: On Mon, May 27, 2013 at 03:14:30PM +0300, Andy Shevchenko wrote: Here is a set of small independent patches that clean up or fix minor things across DMA slave drivers. The series looks fine. I am going to wait a day more and apply, pls

Re: [PATCH 00/12] dma: various minor clean ups for slave drivers

2013-07-15 Thread Andy Shevchenko
On Mon, 2013-07-15 at 15:07 +0530, Vinod Koul wrote: On Thu, May 30, 2013 at 09:32:19PM +0300, Andy Shevchenko wrote: Here is a set of small independent patches that clean up or fix minor things across DMA slave drivers. Applied thanks Thank you. You were faster than me, I was just

[PATCH] macintosh: use %*ph to print small buffers

2013-04-22 Thread Andy Shevchenko
Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- drivers/macintosh/smu.c | 6 +- drivers/macintosh/via-pmu.c | 5 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 9c6b964..b3b2d36 100644

[PATCH 00/12] dma: various minor clean ups for slave drivers

2013-05-27 Thread Andy Shevchenko
Here is a set of small independent patches that clean up or fix minor things across DMA slave drivers. Andy Shevchenko (12): imx-sdma: remove useless variable mxs-dma: remove useless variable edma: no need to assign residue to 0 explicitly ep93xx_dma: remove useless use of lock fsldma

[PATCH 05/12] fsldma: remove useless use of lock

2013-05-27 Thread Andy Shevchenko
Accordingly to dma_cookie_status() description locking is not required. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com Cc: Li Yang le...@freescale.com Cc: Zhang Wei z...@zh-kernel.org Cc: linuxppc-dev@lists.ozlabs.org --- drivers/dma/fsldma.c | 10 +- 1 file changed, 1

Re: [PATCH 00/12] dma: various minor clean ups for slave drivers

2013-05-30 Thread Andy Shevchenko
On Thu, May 30, 2013 at 8:47 PM, Vinod Koul vinod.k...@intel.com wrote: On Mon, May 27, 2013 at 03:14:30PM +0300, Andy Shevchenko wrote: Here is a set of small independent patches that clean up or fix minor things across DMA slave drivers. The series looks fine. I am going to wait a day more

Re: [PATCH RFC v9 2/6] dma: mpc512x: add support for peripheral transfers

2014-03-14 Thread Andy Shevchenko
. -- Andy Shevchenko andriy.shevche...@linux.intel.com Intel Finland Oy ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH RFC v9 3/6] dma: mpc512x: replace devm_request_irq() with request_irq()

2014-03-14 Thread Andy Shevchenko
); dma_async_device_unregister(mdma-dma); - devm_free_irq(dev, mdma-irq, mdma); + free_irq(mdma-irq, mdma); irq_dispose_mapping(mdma-irq); return 0; -- Andy Shevchenko andriy.shevche...@linux.intel.com Intel Finland Oy ___ Linuxppc-dev

Re: [PATCH v3 4/8] DMA: Freescale: add fsl_dma_free_descriptor() to reduce code duplication

2014-04-10 Thread Andy Shevchenko
will be the result of double list_del() against the same node? } /** -- Andy Shevchenko andriy.shevche...@linux.intel.com Intel Finland Oy ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 6/8] DMA: Freescale: change descriptor release process for supporting async_tx

2014-04-10 Thread Andy Shevchenko
; /* Descriptors pool */ struct device *dev; /* Channel device */ -- Andy Shevchenko andriy.shevche...@linux.intel.com Intel Finland Oy ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo

Re: [PATCH v3 8/8] DMA: Freescale: add suspend resume functions for DMA driver

2014-04-10 Thread Andy Shevchenko
fsldma_chan_regs_save regs_save; + enum fsldma_pm_state pm_state; +#endif void (*toggle_ext_pause)(struct fsldma_chan *fsl_chan, int enable); void (*toggle_ext_start)(struct fsldma_chan *fsl_chan, int enable); -- Andy Shevchenko andriy.shevche...@linux.intel.com Intel Finland

Re: [PATCH v3 4/8] DMA: Freescale: add fsl_dma_free_descriptor() to reduce code duplication

2014-04-14 Thread Andy Shevchenko
On Fri, 2014-04-11 at 16:14 +0800, Hongbo Zhang wrote: On 04/10/2014 07:29 PM, Andy Shevchenko wrote: On Thu, 2014-04-10 at 15:10 +0800, hongbo.zh...@freescale.com wrote: [] @@ -819,8 +826,7 @@ static void fsldma_cleanup_descriptor(struct fsldma_chan *chan, dma_run_dependencies(txd

Re: [PATCH v3 6/8] DMA: Freescale: change descriptor release process for supporting async_tx

2014-04-14 Thread Andy Shevchenko
against comments is really minor thing. -- Andy Shevchenko andriy.shevche...@linux.intel.com Intel Finland Oy ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH RFC v8 5/5] dma: mpc512x: register for device tree channel lookup

2014-02-24 Thread Andy Shevchenko
= op-dev; struct mpc_dma *mdma = dev_get_drvdata(dev); + if (dev-of_node) + of_dma_controller_free(dev-of_node); dma_async_device_unregister(mdma-dma); devm_free_irq(dev, mdma-irq, mdma); irq_dispose_mapping(mdma-irq); -- Andy Shevchenko

Re: [PATCH RFC v8 2/5] dma: mpc512x: add support for peripheral transfers

2014-02-24 Thread Andy Shevchenko
; + dma-device_control = mpc_dma_device_control; INIT_LIST_HEAD(dma-channels); dma_cap_set(DMA_MEMCPY, dma-cap_mask); + dma_cap_set(DMA_SLAVE, dma-cap_mask); for (i = 0; i dma-chancnt; i++) { mchan = mdma-channels[i]; -- Andy Shevchenko andriy.shevche

[PATCH v1 0/2] sata_dwc_460ex: move to generic DMA driver

2015-03-03 Thread Andy Shevchenko
for this module. The driver is compile tested only on x86. So, it would be nice if anyone who has either AMCC 460EX Canyonlands board or similar SATA controller in possession can test this. [1] http://www.spinics.net/lists/linux-ide/msg50334.html Andy Shevchenko (2): sata_dwc_460ex: move to generic

[PATCH v1 2/2] sata_dwc_460ex: re-use hsdev-dev instead of dwc_dev

2015-03-03 Thread Andy Shevchenko
This patch re-uses hsdev-dev which is allocated on heap. Therefore, the private structure, which is global variable, is reduced by one field. In one case ap-dev is used and there it seems to be right decision. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- drivers/ata

[PATCH v1 1/2] sata_dwc_460ex: move to generic DMA driver

2015-03-03 Thread Andy Shevchenko
to split the devices inside DTS as well like it's done on other platforms. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- drivers/ata/sata_dwc_460ex.c | 736 +++ 1 file changed, 122 insertions(+), 614 deletions(-) diff --git a/drivers/ata

Re: Kernel 4.1-rc1 build fails on Sam460ex amcc 460ex powerpc Canyonlands

2015-05-04 Thread Andy Shevchenko
1 Looks like it was caused by: commit 8b3444852a2b58129ee68a8dd69fef81ceb902a1 Author: Andy Shevchenko andriy.shevche...@linux.intel.com Date: Tue Mar 3 22:41:21 2015 +0200 sata_dwc_460ex: move to generic DMA driver Oops, Andy? Sorry for late answer. It requires

[PATCH 1/1] ata: select DW_DMAC in case of SATA_DWC

2015-05-05 Thread Andy Shevchenko
Since sata_dwc_460ex.c was moved to generic DMA driver we have to ensure that user can still compile it. Fixes: 8b3444852a2b (sata_dwc_460ex: move to generic DMA driver) Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- drivers/ata/Kconfig | 1 + 1 file changed, 1 insertion

[PATCH 4/5] powerpc/pseries: replace kmalloc + strlcpy

2015-08-04 Thread Andy Shevchenko
The helper kstrndup() will do the same in one line. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- arch/powerpc/platforms/pseries/of_helpers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/of_helpers.c b/arch/powerpc

[PATCH 5/5] powerpc/pseries: re-use code from of_helpers module

2015-08-04 Thread Andy Shevchenko
The derive_parent() has similar semantics to what we have in newly introduced of_helpers module. The replacement reduces code base and propagates the actual error code to the caller. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- arch/powerpc/platforms/pseries/dlpar.c | 31

[PATCH 3/5] powerpc/pseries: don't call strrchr() twice

2015-08-04 Thread Andy Shevchenko
There is no need to call strrchr() second time. We already know that in that case parent_path_len either 1 (/foo) or bigger (/foo/bar). Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- arch/powerpc/platforms/pseries/of_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 2/5] powerpc/pseries: fix a potential memory leak

2015-08-04 Thread Andy Shevchenko
In case we have a full node name like /foo/bar and /foo is not found the parent_path left unfreed. So, free a memory before return to a caller. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- arch/powerpc/platforms/pseries/of_helpers.c | 6 ++ 1 file changed, 2

[PATCH 1/5] powerpc/pseries: extract of_helpers module

2015-08-04 Thread Andy Shevchenko
Extract a new module to share the code between other modules. There is no functional change. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- arch/powerpc/platforms/pseries/Makefile | 1 + arch/powerpc/platforms/pseries/of_helpers.c | 38

Re: [PATCH 1/5] powerpc/pseries: extract of_helpers module

2015-08-05 Thread Andy Shevchenko
On Wed, 2015-08-05 at 00:20 -0500, Segher Boessenkool wrote: Hi Andy, On Tue, Aug 04, 2015 at 05:36:45PM +0300, Andy Shevchenko wrote: +struct device_node *pseries_of_derive_parent(const char *path) +{ + struct device_node *parent = NULL; + char *parent_path = /; + size_t

[PATCH v2 1/5] powerpc/pseries: extract of_helpers module

2015-08-11 Thread Andy Shevchenko
Extract a new module to share the code between other modules. There is no functional change. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- arch/powerpc/platforms/pseries/Makefile | 1 + arch/powerpc/platforms/pseries/of_helpers.c | 38

[PATCH v2 4/5] powerpc/pseries: handle nodes without '/'

2015-08-11 Thread Andy Shevchenko
In case we have node without '/' strrchr() returns NULL which might lead to crash. Replace strrchr() by kbasename() and modify condition to avoid such behaviour. Suggested-by: Segher Boessenkool seg...@kernel.crashing.org Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- arch

[PATCH v2 5/5] powerpc/pseries: re-use code from of_helpers module

2015-08-11 Thread Andy Shevchenko
The derive_parent() has similar semantics to what we have in newly introduced of_helpers module. The replacement reduces code base and propagates the actual error code to the caller. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- arch/powerpc/platforms/pseries/dlpar.c | 31

[PATCH v2 2/5] powerpc/pseries: fix a potential memory leak

2015-08-11 Thread Andy Shevchenko
In case we have a full node name like /foo/bar and /foo is not found the parent_path left unfreed. So, free a memory before return to a caller. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- arch/powerpc/platforms/pseries/of_helpers.c | 6 ++ 1 file changed, 2

[PATCH v2 3/5] powerpc/pseries: replace kmalloc + strlcpy

2015-08-11 Thread Andy Shevchenko
The helper kstrndup() will do the same in one line. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- arch/powerpc/platforms/pseries/of_helpers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/of_helpers.c b/arch/powerpc

Re: [PATCH] powerpc/pseries: Correct string length in pseries_of_derive_parent()

2015-10-27 Thread Andy Shevchenko
which is equivalent to (tail - 1 > path), can we amend both? For example (might be better, but first comes to my mind) const char *tail = kbasename(path) - 1; ... if (tail > path) { >   if (!parent_path) >   return ERR_PTR(-ENOMEM); >   }

Re: [PATCH v2] powerpc/pseries: Correct string length in pseries_of_derive_parent()

2015-10-27 Thread Andy Shevchenko
before the base name instead of the base name. This > then > adjusts the string length calculations to not include the trailing > '/' > in the parent path name. > > Signed-off-by: Nathan Fontenot <nf...@linux.vnet.ibm.com> Reviewed-by: Andy Shevchenko <andriy.shevch

Re: [PATCH 3/5] dma-mapping: cosolidate dma_mapping_error

2015-08-27 Thread Andy Shevchenko
unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ -- With Best Regards, Andy Shevchenko ___ Linuxppc-dev

[PATCH v3 0/5] powerpc/pseries: bug fix and clean up

2015-10-01 Thread Andy Shevchenko
Changelog v2: - fix compiler error - rebase on top of recent linux-next - compile tested Andy Shevchenko (5): powerpc/pseries: extract of_helpers module powerpc/pseries: fix a potential memory leak powerpc/pseries: replace kmalloc + strlcpy powerpc/pseries: handle nodes without

[PATCH v3 3/5] powerpc/pseries: replace kmalloc + strlcpy

2015-10-01 Thread Andy Shevchenko
The helper kstrndup() will do the same in one line. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- arch/powerpc/platforms/pseries/of_helpers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/of_helpers.c b/arch/p

[PATCH v3 5/5] powerpc/pseries: re-use code from of_helpers module

2015-10-01 Thread Andy Shevchenko
The derive_parent() has similar semantics to what we have in newly introduced of_helpers module. The replacement reduces code base and propagates the actual error code to the caller. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- arch/powerpc/platforms/pseries/d

[PATCH v3 1/5] powerpc/pseries: extract of_helpers module

2015-10-01 Thread Andy Shevchenko
Extract a new module to share the code between other modules. There is no functional change. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- arch/powerpc/platforms/pseries/Makefile | 1 + arch/powerpc/platforms/pseries/of_helpers.

[PATCH v3 2/5] powerpc/pseries: fix a potential memory leak

2015-10-01 Thread Andy Shevchenko
In case we have a full node name like /foo/bar and /foo is not found the parent_path left unfreed. So, free a memory before return to a caller. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- arch/powerpc/platforms/pseries/of_helpers.c | 6 ++ 1 file chan

[PATCH v3 4/5] powerpc/pseries: handle nodes without '/'

2015-10-01 Thread Andy Shevchenko
In case we have node without '/' strrchr() returns NULL which might lead to crash. Replace strrchr() by kbasename() and modify condition to avoid such behaviour. Suggested-by: Segher Boessenkool <seg...@kernel.crashing.org> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.

Re: [v2,5/5] powerpc/pseries: re-use code from of_helpers module

2015-10-01 Thread Andy Shevchenko
On Thu, 2015-10-01 at 10:02 +0300, Denis Kirjanov wrote: > On 10/1/15, Michael Ellerman <m...@ellerman.id.au> wrote: > > On Wed, 2015-09-30 at 19:19 +0300, Andy Shevchenko wrote: > > > On Fri, 2015-08-14 at 21:51 +1000, Michael Ellerman wrote: > > > > On T

Re: [v2,5/5] powerpc/pseries: re-use code from of_helpers module

2015-09-30 Thread Andy Shevchenko
On Fri, 2015-08-14 at 21:51 +1000, Michael Ellerman wrote: > On Tue, 2015-11-08 at 11:23:09 UTC, Andy Shevchenko wrote: > > The derive_parent() has similar semantics to what we have in newly > > introduced > > of_helpers module. The replacement reduces code base and propa

Re: [PATCH v1 1/2] sata_dwc_460ex: move to generic DMA driver

2015-11-23 Thread Andy Shevchenko
On Sun, 2015-11-22 at 13:03 +, Måns Rullgård wrote: > Andy Shevchenko <andriy.shevche...@linux.intel.com> writes: > > > The SATA implementation based on two actually different devices, > > i.e. SATA and > > DMA controllers. > > > > For Synopsy

Re: [PATCH v2 2/4] lib: update single-char callers of strtobool

2016-02-04 Thread Andy Shevchenko
glob.h > index a25b2513f146..d21da9f05bae 100644 > --- a/fs/cifs/cifsglob.h > +++ b/fs/cifs/cifsglob.h > @@ -1596,11 +1596,11 @@ GLOBAL_EXTERN atomic_t midCount; > > /* Misc globals */ > GLOBAL_EXTERN bool enable_oplocks; /* enable or d

Re: [PATCH v2 4/4] param: convert some "on"/"off" users to strtobool

2016-02-04 Thread Andy Shevchenko
ck-sched.c b/kernel/time/tick-sched.c > index 9d7a053545f5..b57f822c2069 100644 > --- a/kernel/time/tick-sched.c > +++ b/kernel/time/tick-sched.c > @@ -387,20 +387,14 @@ void __init tick_nohz_init(void) > /* > * NO HZ enabled ? > */ > -int tick_nohz_enabled __read_mostly = 1; > +bool tick_nohz_enabled __read_mostly = true; > unsigned long tick_nohz_active __read_mostly; > /* > * Enable / Disable tickless mode > */ > static int __init setup_tick_nohz(char *str) > { > - if (!strcmp(str, "off")) > - tick_nohz_enabled = 0; > - else if (!strcmp(str, "on")) > - tick_nohz_enabled = 1; > - else > - return 0; > - return 1; > + return kstrtobool(str, 0, _nohz_enabled); > } > > __setup("nohz=", setup_tick_nohz); > -- > 2.6.3 > -- With Best Regards, Andy Shevchenko ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 3/4] lib: add "on"/"off" support to kstrtobool

2016-02-04 Thread Andy Shevchenko
urn 0; > + case 'f': > + case 'F': > + *res = false; > + return 0; > + default: > + break; > + } > default: > break; > }

Re: [PATCH v2 1/4] lib: move strtobool to kstrtobool

2016-02-04 Thread Andy Shevchenko
; Signed-off-by: Kees Cook <keesc...@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevche...@gmail.com> One minor below. > --- > include/linux/kernel.h | 3 +++ > include/linux/string.h | 6 +- > lib/kstrtox.c | 35 +

Re: [PATCH 1/3] lib: fix callers of strtobool to use char array

2016-02-01 Thread Andy Shevchenko
lob.h b/fs/cifs/cifsglob.h > index a25b2513f146..d21da9f05bae 100644 > --- a/fs/cifs/cifsglob.h > +++ b/fs/cifs/cifsglob.h > @@ -1596,11 +1596,11 @@ GLOBAL_EXTERN atomic_t midCount; > > /* Misc globals */ > GLOBAL_EXTERN bool enable_oplocks; /* enable or disable oplocks */ > -

Re: linux-next: build failure after merge of the aio tree

2016-03-15 Thread Andy Shevchenko
\ > ({ \ > long __gu_err; \ > - unsigned long __gu_val; \ > + __inttype(*(ptr)) __gu_val; \

Re: linux-next: build failure after merge of the aio tree

2016-03-16 Thread Andy Shevchenko
think it is the best solution right now. > I've also sent a patch that fixes the link error on ARM and that should > work on all other architectures too. In case of avr32 signalfd_read() fails. Does your patch help with it as well? P.S. Bisecting shows same culprit: 150a0b4905f1 ("aio: add support for async openat()") -- With Best Regards, Andy Shevchenko ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V2] mtd: nand: pasemi: switch to pr_* functions

2016-04-09 Thread Andy Shevchenko
use dev_err(>dev, …); ? > err = -ENODEV; > goto out_lpc; > } > > - printk(KERN_INFO "PA Semi NAND flash at %08llx, control at I/O %x\n", > - res.start, lpcctl); > + pr_info("PA Semi NAND flash at %pR, control at

[PATCH v1 09/23] ata: sata_dwc_460ex: use "dmas" DT property to find dma channel

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard Currently this driver only works with a DesignWare DMA engine which it registers manually using the second "reg" address range and interrupt number from the DT node. This patch makes the driver instead use the "dmas" property if present, otherwise optionally

[PATCH v1 06/23] ata: sata_dwc_460ex: select only core part of DMA driver

2016-04-21 Thread Andy Shevchenko
There is no need to have a platform driver compiled since the DMA driver is used as a library. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/Kconfig b/drivers/ata/K

[PATCH v1 08/23] ata: sata_dwc_460ex: don't call ata_sff_qc_issue() on DMA commands

2016-04-21 Thread Andy Shevchenko
ata_sff_qc_issue() can't handle DMA commands and thus we have to avoid it for them. Do call ata_bmdma_qc_issue() instead for this case. Suggested-by: Christian Lamparter <chunk...@googlemail.com> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/sata

[PATCH v1 07/23] ata: sata_dwc_460ex: skip dma setup for non-dma commands

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard Calling dmaengine_prep_slave_sg() for non-dma ATA commands is unnecessary at best and could be harmful if the dma driver reacts badly to this. It also causes this driver to print a bogus error message in these cases. This patch changes sata_dwc_qc_issue() to

[PATCH v1 14/23] ata: sata_dwc_460ex: get rid of some pointless casts

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard Casting a pointer to unsigned long only to immediately cast it back to a pointer makes no sense. Fix this. Signed-off-by: Mans Rullgard --- drivers/ata/sata_dwc_460ex.c | 30 +++--- 1 file changed, 15 insertions(+),

[PATCH v1 16/23] ata: sata_dwc_460ex: add __iomem to register base pointer

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard The pointer to the mmio register base is missing the __iomem annotation. Fix this. Signed-off-by: Mans Rullgard --- drivers/ata/sata_dwc_460ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v1 20/23] ata: sata_dwc_460ex: tidy up sata_dwc_clear_dmacr()

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard This consolidates the reads from each of the if/else branches to one place making the code a lot nicer to look at. Signed-off-by: Mans Rullgard --- drivers/ata/sata_dwc_460ex.c | 14 ++ 1 file changed, 6 insertions(+), 8

[PATCH v1 21/23] ata: sata_dwc_460ex: use devm_ioremap

2016-04-21 Thread Andy Shevchenko
This simplifies error handling and cleanup by using devm to manage IO mappings. Signed-off-by: Mans Rullgard --- drivers/ata/sata_dwc_460ex.c | 30 +++--- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/drivers/ata/sata_dwc_460ex.c

[PATCH v1 15/23] ata: sata_dwc_460ex: get rid of incorrect cast

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard The (void *__iomem) cast is wrong. Change the target type of the "base" pointer to void __iomem instead and drop the cast. Signed-off-by: Mans Rullgard --- drivers/ata/sata_dwc_460ex.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v1 23/23] powerpc/4xx: Device tree update for the 460ex DWC SATA

2016-04-21 Thread Andy Shevchenko
Device tree update for the Applied micro processor 460ex on-chip SATA to use "dmas" property. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- arch/powerpc/boot/dts/canyonlands.dts | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) d

[PATCH v1 19/23] ata: sata_dwc_460ex: use readl/writel_relaxed()

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard Rename the register access macros and use standard _relaxed() ops instead of __raw variants with explicit byte swapping. The original driver used the ppc-specific in/out_le32(). When it was adapted to other systems, these were added to the driver under

[PATCH v1 17/23] ata: sata_dwc_460ex: supply physical address of FIFO to DMA

2016-04-21 Thread Andy Shevchenko
DMA operates with physical addresses which is not exactly the same as ioremap() returns. Introduce variable to keep physical address of the SATA FIFO register and supply it when prepare DMA channel. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drive

[PATCH v1 02/23] ata: sata_dwc_460ex: fix crash on offline links without an attached drive

2016-04-21 Thread Andy Shevchenko
From: Christian Lamparter This patch fixes Machine Check "Data Write PLB Error" which happens when libata-sff's ata_sff_dev_select is trying to write into the device_addr in order to select a drive. However, SATA has no master or slave devices like the old ATA Bus,

[PATCH v1 01/23] ata: sata_dwc_460ex: remove incorrect locking

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard This lock is already taken in ata_scsi_queuecmd() a few levels up the call stack so attempting to take it here is an error. Moreover, it is pointless in the first place since it only protects a single, atomic assignment. Enabling lock debugging gives the

[PATCH v1 12/23] ata: sata_dwc_460ex: correct HOSTDEV{P}_FROM_*() macros

2016-04-21 Thread Andy Shevchenko
Here we refactor HOSTDEV{P}_FROM_*() macros to fit one line and fix the definition of HSDEV_FROM_HSDEVP() where wrong name of the parameter waas used. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/sata_dwc_460ex.c | 17 ++--- 1 file chan

[PATCH v1 18/23] ata: sata_dwc_460ex: switch to new dmaengine_terminate_* API

2016-04-21 Thread Andy Shevchenko
Convert dmaengine_terminate_all() calls to synchronous and asynchronous versions where appropriate. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/sata_dwc_460ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/sata_dwc_4

[PATCH v1 22/23] ata: sata_dwc_460ex: make debug messages neat

2016-04-21 Thread Andy Shevchenko
There is a duplication in the debug messages when accessing SCR registers. Remove duplication to make the messages neat. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/sata_dwc_460ex.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH v1 04/23] ata: sata_dwc_460ex: burst size must be in items not bytes

2016-04-21 Thread Andy Shevchenko
The burst size as defined by DMAengine API is in items of address width. Derive burst size from AHB_DMA_BRST_DFLT (64 bytes) by dividing it to DMA_SLAVE_BUSWIDTH_4_BYTES (4 bytes) that gives us 16 items. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drive

[PATCH v1 00/23] ata: sata_dwc_460ex: make it working again

2016-04-21 Thread Andy Shevchenko
oards. In any case I ask Christian, Måns, and Julian to independently test and provide Tested-by tag or error report. Series depends on previously published but not yet fully applied series [1]. [1] http://www.spinics.net/lists/kernel/msg2239735.html Andy Shevchenko (11): ata: sata_dwc_460

[PATCH v1 13/23] ata: sata_dwc_460ex: remove empty libata callback

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard The sata_dwc_qc_prep() does nothing. Use the default ata_noop_qc_prep instead. Signed-off-by: Mans Rullgard --- drivers/ata/sata_dwc_460ex.c | 22 -- 1 file changed, 22 deletions(-) diff --git

[PATCH v1 03/23] ata: sata_dwc_460ex: set dma_boundary to 0x1fff

2016-04-21 Thread Andy Shevchenko
switched to generic DMAengine API we satisfy above by setting dma_boundary value to 0x1fff. Suggested-by: Mans Rullgard <m...@mansr.com> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/sata_dwc_460ex.c | 8 +++- 1 file changed, 7 insertions(+)

[PATCH v1 05/23] ata: sata_dwc_460ex: DMA is always a flow controller

2016-04-21 Thread Andy Shevchenko
In the original code the DMA is always a flow controller. Set this accordingly in updated code. Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/sata_dwc_460ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/sata_dwc_460

[PATCH v1 10/23] ata: sata_dwc_460ex: add phy support

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard This adds support for powering on an optional PHY when activating the device. Signed-off-by: Mans Rullgard --- drivers/ata/Kconfig | 1 + drivers/ata/sata_dwc_460ex.c | 22 ++ 2 files changed, 23 insertions(+)

[PATCH v1 11/23] ata: sata_dwc_460ex: get rid of global data

2016-04-21 Thread Andy Shevchenko
From: Mans Rullgard This moves all global data into the driver private struct, thus permitting multiple devices of this type to be used. The core_scr_read/write() functions are replaced with equivalent calls to the existing sata_dwc_scr_read/write(). Signed-off-by: Mans

[PATCH v2 03/23] ata: sata_dwc_460ex: set dma_boundary to 0x1fff

2016-04-26 Thread Andy Shevchenko
switched to generic DMAengine API we satisfy above by setting dma_boundary value to 0x1fff. Suggested-by: Mans Rullgard <m...@mansr.com> Tested-by: Christian Lamparter <chunk...@googlemail.com> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/sa

[PATCH v2 15/23] ata: sata_dwc_460ex: get rid of incorrect cast

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard The (void *__iomem) cast is wrong. Change the target type of the "base" pointer to void __iomem instead and drop the cast. Tested-by: Christian Lamparter Signed-off-by: Mans Rullgard ---

[PATCH v2 04/23] ata: sata_dwc_460ex: burst size must be in items not bytes

2016-04-26 Thread Andy Shevchenko
The burst size as defined by DMAengine API is in items of address width. Derive burst size from AHB_DMA_BRST_DFLT (64 bytes) by dividing it to DMA_SLAVE_BUSWIDTH_4_BYTES (4 bytes) that gives us 16 items. Tested-by: Christian Lamparter <chunk...@googlemail.com> Signed-off-by: Andy Shev

[PATCH v2 12/23] ata: sata_dwc_460ex: correct HOSTDEV{P}_FROM_*() macros

2016-04-26 Thread Andy Shevchenko
Here we refactor HOSTDEV{P}_FROM_*() macros to fit one line and fix the definition of HSDEV_FROM_HSDEVP() where wrong name of the parameter waas used. Tested-by: Christian Lamparter <chunk...@googlemail.com> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> ---

[PATCH v2 19/23] ata: sata_dwc_460ex: use readl/writel_relaxed()

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard Rename the register access macros and use standard _relaxed() ops instead of __raw variants with explicit byte swapping. The original driver used the ppc-specific in/out_le32(). When it was adapted to other systems, these were added to the driver under

[PATCH v2 00/23] ata: sata_dwc_460ex: make it working again

2016-04-26 Thread Andy Shevchenko
09250.html [2] https://bitbucket.org/andy-shev/linux/branch/topic%2Fdw%2Fsata Since v1: - simplify patch 8 (David Laight) - add Tested-by and Acked-by tags Andy Shevchenko (11): ata: sata_dwc_460ex: set dma_boundary to 0x1fff ata: sata_dwc_460ex: burst size must be in items not bytes ata:

[PATCH v2 20/23] ata: sata_dwc_460ex: tidy up sata_dwc_clear_dmacr()

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard This consolidates the reads from each of the if/else branches to one place making the code a lot nicer to look at. Tested-by: Christian Lamparter Signed-off-by: Mans Rullgard --- drivers/ata/sata_dwc_460ex.c | 14

[PATCH v2 07/23] ata: sata_dwc_460ex: skip dma setup for non-dma commands

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard Calling dmaengine_prep_slave_sg() for non-dma ATA commands is unnecessary at best and could be harmful if the dma driver reacts badly to this. It also causes this driver to print a bogus error message in these cases. This patch changes sata_dwc_qc_issue() to

[PATCH v2 18/23] ata: sata_dwc_460ex: switch to new dmaengine_terminate_* API

2016-04-26 Thread Andy Shevchenko
Convert dmaengine_terminate_all() calls to synchronous and asynchronous versions where appropriate. Tested-by: Christian Lamparter <chunk...@googlemail.com> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/sata_dwc_460ex.c | 2 +- 1 file changed,

[PATCH v2 22/23] ata: sata_dwc_460ex: make debug messages neat

2016-04-26 Thread Andy Shevchenko
There is a duplication in the debug messages when accessing SCR registers. Remove duplication to make the messages neat. Tested-by: Christian Lamparter <chunk...@googlemail.com> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/sata_dwc_460ex.c | 8

[PATCH v2 10/23] ata: sata_dwc_460ex: add phy support

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard This adds support for powering on an optional PHY when activating the device. Tested-by: Christian Lamparter Signed-off-by: Mans Rullgard --- drivers/ata/Kconfig | 1 + drivers/ata/sata_dwc_460ex.c | 22

[PATCH v2 09/23] ata: sata_dwc_460ex: use "dmas" DT property to find dma channel

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard Currently this driver only works with a DesignWare DMA engine which it registers manually using the second "reg" address range and interrupt number from the DT node. This patch makes the driver instead use the "dmas" property if present, otherwise optionally

[PATCH v2 11/23] ata: sata_dwc_460ex: get rid of global data

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard This moves all global data into the driver private struct, thus permitting multiple devices of this type to be used. The core_scr_read/write() functions are replaced with equivalent calls to the existing sata_dwc_scr_read/write(). Tested-by: Christian

[PATCH v2 05/23] ata: sata_dwc_460ex: DMA is always a flow controller

2016-04-26 Thread Andy Shevchenko
In the original code the DMA is always a flow controller. Set this accordingly in updated code. Tested-by: Christian Lamparter <chunk...@googlemail.com> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/sata_dwc_460ex.c | 2 +- 1 file changed, 1 ins

[PATCH v2 14/23] ata: sata_dwc_460ex: get rid of some pointless casts

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard Casting a pointer to unsigned long only to immediately cast it back to a pointer makes no sense. Fix this. Tested-by: Christian Lamparter Signed-off-by: Mans Rullgard --- drivers/ata/sata_dwc_460ex.c | 30

[PATCH v2 16/23] ata: sata_dwc_460ex: add __iomem to register base pointer

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard The pointer to the mmio register base is missing the __iomem annotation. Fix this. Tested-by: Christian Lamparter Signed-off-by: Mans Rullgard --- drivers/ata/sata_dwc_460ex.c | 2 +- 1 file changed, 1

[PATCH v2 08/23] ata: sata_dwc_460ex: don't call ata_sff_qc_issue() on DMA commands

2016-04-26 Thread Andy Shevchenko
ata_sff_qc_issue() can't handle DMA commands and thus we have to avoid it for them. Do call ata_bmdma_qc_issue() instead for this case. Note that the former one distinguishes PIO and DMA mode and behaves accordingly. Suggested-by: Christian Lamparter <chunk...@googlemail.com> Signed-off-by

[PATCH v2 06/23] ata: sata_dwc_460ex: select only core part of DMA driver

2016-04-26 Thread Andy Shevchenko
There is no need to have a platform driver compiled since the DMA driver is used as a library. Tested-by: Christian Lamparter <chunk...@googlemail.com> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- drivers/ata/Kconfig | 2 +- 1 file changed, 1 insertion(+)

[PATCH v2 13/23] ata: sata_dwc_460ex: remove empty libata callback

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard The sata_dwc_qc_prep() does nothing. Use the default ata_noop_qc_prep instead. Tested-by: Christian Lamparter Signed-off-by: Mans Rullgard --- drivers/ata/sata_dwc_460ex.c | 22 -- 1 file

[PATCH v2 02/23] ata: sata_dwc_460ex: fix crash on offline links without an attached drive

2016-04-26 Thread Andy Shevchenko
From: Christian Lamparter This patch fixes Machine Check "Data Write PLB Error" which happens when libata-sff's ata_sff_dev_select is trying to write into the device_addr in order to select a drive. However, SATA has no master or slave devices like the old ATA Bus,

[PATCH v2 17/23] ata: sata_dwc_460ex: supply physical address of FIFO to DMA

2016-04-26 Thread Andy Shevchenko
DMA operates with physical addresses which is not exactly the same as ioremap() returns. Introduce variable to keep physical address of the SATA FIFO register and supply it when prepare DMA channel. Tested-by: Christian Lamparter <chunk...@googlemail.com> Signed-off-by: Andy Shev

[PATCH v2 23/23] powerpc/4xx: Device tree update for the 460ex DWC SATA

2016-04-26 Thread Andy Shevchenko
Device tree update for the Applied micro processor 460ex on-chip SATA to use "dmas" property. Acked-by: Rob Herring <r...@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com> --- arch/powerpc/boot/dts/canyonlands.dts | 15 --- 1 file

[PATCH v2 01/23] ata: sata_dwc_460ex: remove incorrect locking

2016-04-26 Thread Andy Shevchenko
From: Mans Rullgard This lock is already taken in ata_scsi_queuecmd() a few levels up the call stack so attempting to take it here is an error. Moreover, it is pointless in the first place since it only protects a single, atomic assignment. Enabling lock debugging gives the

Re: [PATCH v2 00/23] ata: sata_dwc_460ex: make it working again

2016-05-04 Thread Andy Shevchenko
On Tue, Apr 26, 2016 at 12:03 PM, Andy Shevchenko <andriy.shevche...@linux.intel.com> wrote: > The last approach in the commit 8b3444852a2b ("sata_dwc_460ex: move to generic > DMA driver") to switch to generic DMA engine API wasn't tested on bare metal. > Besides th

Re: [PATCH v2 00/23] ata: sata_dwc_460ex: make it working again

2016-05-10 Thread Andy Shevchenko
immutable. Vinod? > > Please use branch topic/dw. I will not rebase this before sending to > > Linus. > Okay, pulled topic/dw into libata/for-4.7-dw and applied 1-22 on top. Thanks! > Please let me know how patch 23 should be routed. Since Rob Acked you may take it as well. --

  1   2   3   4   5   >