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

2015-05-04 Thread Andy Shevchenko
obe' > > > sata_dwc_460ex.c:(.text+0xa1954): undefined reference to `dw_dma_remove' > > > make: *** [vmlinux] Error 1 > > > > Looks like it was caused by: > > > > commit 8b3444852a2b58129ee68a8dd69fef81ceb902a1 > > Author: Andy Shevchenko >

[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 --- drivers/ata/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ata

[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 Cc: Li Yang Cc: Zhang Wei Cc: linuxppc-dev@lists.ozlabs.org --- drivers/dma/fsldma.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/dma/fsldma.c b

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 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 m

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

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. > > Ap

[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 --- arch/powerpc/platforms/pseries/of_helpers.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[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 --- arch/powerpc/platforms/pseries/Makefile | 1 + arch/powerpc/platforms/pseries/of_helpers.c | 38 + arch/powerpc/platforms/pseries

[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 --- arch/powerpc/platforms/pseries/dlpar.c | 31

[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 --- 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/platforms/pseries/of_helpers.c

[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 --- arch/powerpc/platforms/pseries/of_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

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

[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 --- arch/powerpc/platforms/pseries/dlpar.c | 31

[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 --- arch/powerpc/platforms/pseries/Makefile | 1 + arch/powerpc/platforms/pseries/of_helpers.c | 38 + arch/powerpc/platforms/pseries

[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 --- arch/powerpc/platforms/pseries/of_helpers.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[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 --- 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/platforms/pseries/of_helpers.c

[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 Signed-off-by: Andy Shevchenko --- arch/powerpc/platforms/pseries/of_helpers.c | 6 +++-

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

2013-04-22 Thread Andy Shevchenko
Signed-off-by: Andy Shevchenko --- 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 --- a/drivers/macintosh/smu.c +++ b

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

2014-02-24 Thread Andy Shevchenko
olution how to keep devm_*_irq usability. > + irq_dispose_mapping(mdma->irq); > return retval; > } > > @@ -1031,6 +1044,8 @@ static int mpc_dma_remove(struct platform_device *op) > struct device *dev = &op->dev; > struct mpc_dma *m

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

2014-02-24 Thread Andy Shevchenko
mchan->tcd_nunits = cfg->src_maxburst; > + } else { > + mchan->per_paddr = cfg->dst_addr; > + mchan->tcd_nunits = cfg->dst_maxburst; > + } > + > + if (!IS_ALIGNED(mchan->per_paddr, 4)) { > + spin_unlock_irqrestore(&mchan->lock, flags); > + return -EINVAL; > + } > + > + if (mchan->tcd_nunits == 0) > + mchan->tcd_nunits = 1; /* apply default */ > + > + spin_unlock_irqrestore(&mchan->lock, flags); > + > + return 0; > + default: > + return -ENOSYS; Use break here. > + } > + > + return -EINVAL; > +} > + > static int mpc_dma_probe(struct platform_device *op) > { > struct device_node *dn = op->dev.of_node; > @@ -727,9 +949,12 @@ static int mpc_dma_probe(struct platform_device *op) > dma->device_issue_pending = mpc_dma_issue_pending; > dma->device_tx_status = mpc_dma_tx_status; > dma->device_prep_dma_memcpy = mpc_dma_prep_memcpy; > + dma->device_prep_slave_sg = mpc_dma_prep_slave_sg; > + 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 Intel Finland Oy ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

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

2014-03-14 Thread Andy Shevchenko
&mchan->lock, flags); > + > + if (cfg->direction == DMA_DEV_TO_MEM) { > + mchan->per_paddr = cfg->src_addr; > + mchan->tcd_nunits = cfg->src_maxburst; > + } else { > + mchan->per_paddr = cfg->dst_addr; > + mchan->tcd_nunits = cfg->dst_maxburst; > + } Ditto. -- Andy Shevchenko 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
irq, mdma); > irq_dispose_mapping(mdma->irq); > } > > @@ -1033,7 +1032,7 @@ static int mpc_dma_remove(struct platform_device *op) > struct mpc_dma *mdma = dev_get_drvdata(dev); > > dma_async_device_u

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

2014-04-10 Thread Andy Shevchenko
*chan, > dma_run_dependencies(txd); > > dma_descriptor_unmap(txd); > - chan_dbg(chan, "LD %p free\n", desc); > - dma_pool_free(chan->desc_pool, desc, txd->phys); > + fsl_dma_free_descriptor(chan, desc); Here is no list_del() call since it's been called in dma_do_tasklet(). What will be the result of double list_del() against the same node? > } > > /** -- Andy Shevchenko 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
mp;chan->desc_lock); > INIT_LIST_HEAD(&chan->ld_pending); > INIT_LIST_HEAD(&chan->ld_running); > + INIT_LIST_HEAD(&chan->ld_completed); > chan->idle = true; > > chan->common.device = &fdev->common; > diff

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

2014-04-10 Thread Andy Shevchenko
USE_EXT 0x1000 > #define FSL_DMA_CHAN_START_EXT 0x2000 > > +#ifdef CONFIG_PM > +struct fsldma_chan_regs_save { > + u32 mr; > +}; > + > +enum fsldma_pm_state { > + RUNNING = 0, > + SUSPENDING, > + SUSPENDED, > +}; > +#endif > + &

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 >

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

2014-04-14 Thread Andy Shevchenko
r to keep style in your patches. Better if it commonly used style in the driver. But comment against comments is really minor thing. -- Andy Shevchenko Intel Finland Oy ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

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

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

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

2015-03-03 Thread Andy Shevchenko
OMPILE_TEST 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:

[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 --- drivers/ata/sata_dwc_460ex.

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; \ > __typeof__(*(ptr)) __user *__gu_addr = (p

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

2016-03-16 Thread Andy Shevchenko
erge window. I 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
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 I/O %x\n", &res, >

[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, therefore selecting a different

[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 --- drivers/ata/sata_dwc_460ex.c | 6 +++--- 1 file changed

[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 Signed-off-by: Andy Shevchenko --- drivers/ata/sata_dwc_460ex.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/ata/sata_dwc_460ex.c b

[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 following output: =

[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 only do the dma

[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 --- drivers/ata/sata_dwc_460ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index

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

2016-04-21 Thread Andy Shevchenko
3g) boards. 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_4

[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 --- drivers/ata/sata_dwc_460ex.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff

[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 --- drivers/ata/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index cfa936a..7c6e43a 100644 --- a

[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 falling back on t

[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(+), 15 deletions(-) diff --git a/dr

[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 a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex

[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 Signed-off-by: Andy Shevchenko --- drivers/ata/sata_dwc_460ex.c | 6 -- 1 file changed, 4 insertions(+), 2 dele

[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 a/drivers/ata/sata_dwc_460ex.c b/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 deletions(-) diff --git a/drivers/ata/sata

[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 --- drivers/ata/sata_dwc_460ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c

[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 Rullgard --- drivers/a

[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(+) diff --git a/drivers/ata/Kconfig

[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 deletions(-) diff --git a/drivers/ata/sa

[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 --- arch/powerpc/boot/dts/canyonlands.dts | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/canyonla

[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 --- drivers/ata/sata_dwc_460ex.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ata/sata_dwc_460ex.c b

[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 b/drivers/ata/sata_dwc_4

[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 ifdefs. However, thos

[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 --- drivers/ata/sata_dwc_460ex.c | 13 +++-- 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, therefore selecting a different

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

2016-04-26 Thread Andy Shevchenko
e/msg09250.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 at

[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 Tested-by: Christian Lamparter Signed-off-by: Andy Shevchenko --- drivers/ata/sata_dwc_460ex.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a

[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 Signed-off-by: Andy Shevchenko --- drivers/ata/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig

[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 Signed-off-by: Andy Shevchenko --- dr

[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 Signed-off-by: Andy Shevchenko --- drivers/ata/sata_dwc_460ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/sata_dwc_460ex.c b

[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 falling back on t

[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 ++ 2 files changed, 23 insertions(+) d

[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 Signed-off-by: Andy Shevchenko --- drivers/ata/sata_dwc_460ex.c | 17 ++--- 1 file changed, 6

[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 --- drivers/ata/sata_dwc_460ex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-

[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 +++--- 1 file changed, 15 insertions(+), 1

[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 changed, 22 deletions(-) diff --git a/drivers/ata/sata_dwc_460e

[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 ++ 1 file changed, 6 insertions(+), 8 deletions

[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 Signed-off-by: Andy Shevchenko --- drivers/ata/sata_dwc_460ex.c

[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 ifdefs. However, thos

[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 Lamparter Signed-off-b

[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 insertion(+), 1 deletion(-) diff --git a/drivers/ata/sata_dwc_460ex.c

[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 Signed-off-by: Andy Shevchenko --- drivers/ata/sata_dwc_460ex.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a

[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 Signed-off-by: Andy Shevchenko --- drivers/ata

[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 only do the dma

[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 Signed-off-by: Andy Shevchenko --- arch/powerpc/boot/dts/canyonlands.dts | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/po

[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 following output: =

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

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

[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 Signed-off-by: Andy Shevchenko --- drivers/ata/sata_dwc_460ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/sata_dwc_460ex.c b

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

2015-08-27 Thread Andy Shevchenko
; - debug_dma_mapping_error(dev, dma_addr); > - if (ops->mapping_error) > - return ops->mapping_error(dev, dma_addr); > - > - return (dma_addr == DMA_ERROR_CODE); > -} > - > extern int dma_supported(struct device *hwdev, u64 mask); > extern int d

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: [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 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 Tue, 2015-11-08 at 11:23

[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 --- 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/platforms/pseries/of_helpers.c

[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 --- arch/powerpc/platforms/pseries/Makefile | 1 + arch/powerpc/platforms/pseries/of_helpers.c | 38 + arch/powerpc/platforms/pseries

[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 --- arch/powerpc/platforms/pseries/dlpar.c | 31

[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 --- arch/powerpc/platforms/pseries/of_helpers.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[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 Signed-off-by: Andy Shevchenko --- arch/powerpc/platforms/pseries/of_helpers.c | 6 +++-

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

2015-10-27 Thread Andy Shevchenko
ivalent 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); >   } > -- Andy Shevchenko Intel Finland Oy ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

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

2015-10-27 Thread Andy Shevchenko
27;/' character 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 Reviewed-by: Andy Shevchenko > --- > > Upd

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 writes: > > > The SATA implementation based on two actually different devices, > > i.e. SATA and > > DMA controllers. > > > > For Synopsys DesignWare DMA we have already a generic

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

2016-02-01 Thread Andy Shevchenko
eEnabled = true; > unsigned int global_secflags = CIFSSEC_DEF; > /* unsigned int ntlmv2_support = 0; */ > unsigned int sign_CIFS_PDUs = 1; > diff --git a/fs/cifs/cifsglob.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 */ > -GLOBAL_EXTERN unsigned int lookupCacheEnabled; > +GLOBAL_EXTERN bool lookupCacheEnabled; > GLOBAL_EXTERN unsigned int global_secflags;/* if on, session setup sent > with more secure ntlmssp2 challenge/resp */ > GLOBAL_EXTERN unsigned int sign_CIFS_PDUs; /* enable smb packet signing */ > -GLOBAL_EXTERN unsigned int linuxExtEnabled;/*enable Linux/Unix CIFS > extensions*/ > +GLOBAL_EXTERN bool linuxExtEnabled;/*enable Linux/Unix CIFS extensions*/ > GLOBAL_EXTERN unsigned int CIFSMaxBufSize; /* max size not including hdr */ > GLOBAL_EXTERN unsigned int cifs_min_rcv;/* min size of big ntwrk buf > pool */ > GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */ > -- > 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 1/4] lib: move strtobool to kstrtobool

2016-02-04 Thread Andy Shevchenko
'Yy1Nn0'. > - * Otherwise it will return -EINVAL. Value pointed to by res is > - * updated upon finding a match. > - */ > -int strtobool(const char *s, bool *res) > -{ > - switch (s[0]) { > - case 'y': >

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

2016-02-04 Thread Andy Shevchenko
secflags = CIFSSEC_DEF; > /* unsigned int ntlmv2_support = 0; */ > unsigned int sign_CIFS_PDUs = 1; > diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h > index a25b2513f146..d21da9f05bae 100644 > --- a/fs/cifs/cifsglob.h > +++ b/fs/cifs/cifsglob.h >

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

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

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

2016-02-04 Thread Andy Shevchenko
else > - return 0; > - return 1; > + return kstrtobool(str, 0, &hrtimer_hres_enabled); > } > > __setup("highres=", setup_hrtimer_hres); > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c > index

Re: [PATCH v2 02/45] drivers: tty: serial: 8250_dw: use devm_ioremap_resource()

2019-03-15 Thread Andy Shevchenko
ioremap(dev, regs->start, resource_size(regs)); > + p->membase = devm_ioremap_resource(dev, regs); > if (!p->membase) And how did you test this? devm_ioremap_resource() returns error pointer in case of error. > return -ENOMEM; -- With Best Regards, Andy Shevchenko

  1   2   3   4   5   >