[PATCH 02/51] DMA-API: net: brocade/bna/bnad.c: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
mask if we failed to set a 32-bit DMA mask, and only if both fail do we fail the driver. Adjust this so that if either setting fails, we fail the driver - and thereby end up properly setting both the DMA mask and the coherent DMA mask in the fallback case. Signed-off-by: Russell King rmk+ker

[PATCH 03/51] DMA-API: net: intel/e1000e: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
it to set the coherent DMA mask only if dma_set_mask() succeeded, and to error out if either fails. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/intel/e1000e/netdev.c | 18 ++ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git

[PATCH 04/51] DMA-API: net: intel/igb: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
it to set the coherent DMA mask only if dma_set_mask() succeeded, and to error out if either fails. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/intel/igb/igb_main.c | 18 ++ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers

[PATCH 05/51] DMA-API: net: intel/igbvf: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
it to set the coherent DMA mask only if dma_set_mask() succeeded, and to error out if either fails. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/intel/igbvf/netdev.c | 18 ++ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers

[PATCH 06/51] DMA-API: net: intel/ixgb: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
if dma_set_mask() succeeded, and to error out if either fails. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/intel/ixgb/ixgb_main.c | 16 +--- 1 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b

[PATCH 07/51] DMA-API: net: intel/ixgbe: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
mask only if dma_set_mask() succeeded, and to error out if either fails. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 15 +-- 1 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe

[PATCH 01/51] DMA-API: provide a helper to set both DMA and coherent DMA masks

2013-09-19 Thread Russell King
Provide a helper to set both the DMA and coherent DMA masks to the same value - this avoids duplicated code in a number of drivers, sometimes with buggy error handling, and also allows us identify which drivers do things differently. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk

[PATCH 08/51] DMA-API: net: intel/ixgbevf: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
mask only if dma_set_mask() succeeded, and to error out if either fails. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 15 +-- 1 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel

[PATCH 17/51] DMA-API: block: nvme-core: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-19 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/block/nvme-core.c | 10 -- 1 files changed, 4

[PATCH 35/51] DMA-API: parport: parport_pc.c: use dma_coerce_mask_and_coherent()

2013-09-19 Thread Russell King
The code sequence: dev-coherent_dma_mask = DMA_BIT_MASK(24); dev-dma_mask = dev-coherent_dma_mask; bypasses the architectures check on the DMA mask. It can be replaced with dma_coerce_mask_and_coherent(), avoiding the direct initialization of this mask. Signed-off-by: Russell

[PATCH 50/51] ARM: 7797/1: mmc: Use dma_max_pfn(dev) helper for bounce_limit calculations

2013-09-19 Thread Russell King
architectures. So make use of dma_max_pfn() which is expected to return the DMAable maximum pfn value across architectures. Signed-off-by: Santosh Shilimkar santosh.shilim...@ti.com Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/mmc/card/queue.c |3 ++- 1 files changed, 2

[PATCH 43/51] DMA-API: dma: edma.c: no need to explicitly initialize DMA masks

2013-09-19 Thread Russell King
register_platform_device_full() can setup the DMA mask provided the appropriate member is set in struct platform_device_info. So lets make that be the case. This avoids a direct reference to the DMA masks by this driver. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma

[PATCH 44/51] DMA-API: dcdbas: update DMA mask handing

2013-09-19 Thread Russell King
the platform_device_register_full() avoids some of this explicit initialization. Convert the driver to use platform_device_register_full(), and as it makes use of coherent DMA, also call dma_set_coherent_mask() to ensure that the architecture gets to check the mask. Signed-off-by: Russell King rmk+ker

[PATCH 40/51] DMA-API: crypto: fix ixp4xx crypto platform device support

2013-09-19 Thread Russell King
-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/crypto/ixp4xx_crypto.c | 37 + 1 files changed, 17 insertions(+), 20 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 21180d6..8306185 100644 --- a/drivers

[PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks

2013-09-19 Thread Russell King
-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/usb/musb/am35x.c| 50 ++ drivers/usb/musb/da8xx.c| 49 ++--- drivers/usb/musb/davinci.c | 48 ++-- drivers/usb/musb

[PATCH 51/51] ARM: 7805/1: mm: change max*pfn to include the physical offset of memory

2013-09-20 Thread Russell King
...@ti.com Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/include/asm/dma-mapping.h |8 arch/arm/mm/init.c | 10 -- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm

[PATCH 49/51] ARM: 7796/1: scsi: Use dma_max_pfn(dev) helper for bounce_limit calculations

2013-09-20 Thread Russell King
architectures. So make use of dma_max_pfn() which is expected to return the DMAable maximum pfn value across architectures. Signed-off-by: Santosh Shilimkar santosh.shilim...@ti.com Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/scsi/scsi_lib.c |2 +- 1 files changed, 1 insertions

[PATCH 48/51] ARM: 7795/1: mm: dma-mapping: Add dma_max_pfn(dev) helper function

2013-09-20 Thread Russell King
...@ti.com Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- include/linux/dma-mapping.h |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 27d1421..fd4aee2 100644 --- a/include/linux/dma-mapping.h

[PATCH 47/51] ARM: 7794/1: block: Rename parameter dma_mask to max_addr for blk_queue_bounce_limit()

2013-09-20 Thread Russell King
assumptions about dma_mask wherever it could be miss-interpreted. Signed-off-by: Santosh Shilimkar santosh.shilim...@ti.com Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- block/blk-settings.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/blk

[PATCH 45/51] DMA-API: firmware/google/gsmi.c: avoid direct access to DMA masks

2013-09-20 Thread Russell King
This driver doesn't need to directly access DMA masks if it uses the platform_device_register_full() API rather than platform_device_register_simple() - the former function can initialize the DMA mask appropriately. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/firmware

[PATCH 46/51] ARM: DMA-API: better handing of DMA masks for coherent allocations

2013-09-20 Thread Russell King
the DMA mask to a PFN using the device specific dma_to_pfn() macro. This is the reverse of the pfn_to_dma() macro which is used to get the DMA address for the device. This gives us a PFN mask, which we can then check against the PFN limit of the DMA zone. Signed-off-by: Russell King rmk+ker

[PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Russell King
-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/ata/pata_ixp4xx_cf.c |5 - drivers/gpu/drm/exynos/exynos_drm_drv.c |6 +- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c |5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/ata/pata_ixp4xx_cf.c

[PATCH 22/51] DMA-API: amba: get rid of separate dma_mask

2013-09-20 Thread Russell King
AMBA Primecell devices always treat streaming and coherent DMA exactly the same, so there's no point in having the masks separated. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/amba/bus.c |6 +- drivers/of/platform.c|3 --- include/linux/amba/bus.h

[PATCH 24/51] DMA-API: dma: pl330: add dma_set_mask_and_coherent() call

2013-09-20 Thread Russell King
The DMA API requires drivers to call the appropriate dma_set_mask() functions before doing any DMA mapping. Add this required call to the AMBA PL08x driver. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/pl330.c |4 1 files changed, 4 insertions(+), 0 deletions

[PATCH 11/51] DMA-API: net: emulex/benet: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/emulex/benet/be_main.c | 12 ++-- 1

[PATCH 13/51] DMA-API: net: sfc/efx.c: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/sfc/efx.c | 12 +--- 1 files changed

[PATCH 18/51] DMA-API: staging: et131x: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/staging/et131x/et131x.c | 17 ++--- 1 files

[PATCH 12/51] DMA-API: net: intel/e1000: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/intel/e1000/e1000_main.c |9 ++--- 1

[PATCH 15/51] DMA-API: net: b43legacy: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/wireless/b43legacy/dma.c |9 +++-- 1 files

[PATCH 20/51] DMA-API: usb: bcma: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/usb/host/bcma-hcd.c |3 +-- 1 files changed, 1

[PATCH 25/51] DMA-API: video: clcd: add dma_set_mask_and_coherent() call

2013-09-20 Thread Russell King
The DMA API requires drivers to call the appropriate dma_set_mask() functions before doing any DMA mapping. Add this required call to the AMBA PL08x driver. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/video/amba-clcd.c |5 + 1 files changed, 5 insertions(+), 0

[PATCH 21/51] DMA-API: usb: ssb-hcd: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/usb/host/ssb-hcd.c |3 +-- 1 files changed, 1 insertions

[PATCH 27/51] DMA-API: provide a helper to setup DMA masks

2013-09-20 Thread Russell King
with via dma_set_mask()/ dma_is_supported(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- include/linux/dma-mapping.h | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index ec951f9..27d1421

[PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers

2013-09-20 Thread Russell King
dma_coerce_coherent_and_mask() function. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- sound/arm/pxa2xx-pcm.c |9 +++-- sound/soc/atmel/atmel-pcm.c | 11 --- sound/soc/blackfin/bf5xx-ac97-pcm.c | 11 --- sound/soc/blackfin/bf5xx-i2s-pcm.c | 10

[PATCH 26/51] DMA-API: usb: ohci-sa1111: add a note about DMA masks

2013-09-20 Thread Russell King
Add a comment to explain why this driver doesn't call any of the DMA API dma_set_mask() functions. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/usb/host/ohci-sa.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/ohci-sa

[PATCH 29/51] DMA-API: ata: pata_octeon_cf: convert to use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
Convert this code sequence: pdev-dev.coherent_dma_mask = DMA_BIT_MASK(64); pdev-dev.dma_mask = pdev-dev.coherent_dma_mask; to use dma_coerce_mask_and_coherent() to avoid bypassing the architecture check on the DMA mask. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk

[PATCH 30/51] DMA-API: dma: dw_dmac.c: convert to use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
(), avoiding the direct initialization of this mask. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/dw/platform.c |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index e35d975..453822c 100644

[PATCH 31/51] DMA-API: media: omap3isp: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
initialization of this mask. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/media/platform/omap3isp/isp.c |6 +++--- drivers/media/platform/omap3isp/isp.h |3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers

[PATCH 14/51] DMA-API: net: b43: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/wireless/b43/dma.c |9 +++-- 1 files changed, 3

[PATCH 32/51] DMA-API: mmc: sdhci-acpi: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
The code sequence: dev-dma_mask = dev-coherent_dma_mask; dev-coherent_dma_mask = dma_mask; bypasses the architectures check on the DMA mask. It can be replaced with dma_coerce_mask_and_coherent(), avoiding the direct initialization of this mask. Signed-off-by: Russell King rmk

[PATCH 33/51] DMA-API: net: nxp/lpc_eth: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/nxp/lpc_eth.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index a061b93..ba3ca18 100644 --- a/drivers/net

[PATCH 36/51] DMA-API: usb: use dma_set_coherent_mask()

2013-09-20 Thread Russell King
-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/usb/chipidea/ci_hdrc_imx.c |5 +++-- drivers/usb/dwc3/dwc3-exynos.c |5 +++-- drivers/usb/gadget/lpc32xx_udc.c |4 +++- drivers/usb/host/ehci-atmel.c |5 +++-- drivers/usb/host/ehci-octeon.c |4 +++- drivers/usb/host

[PATCH 34/51] DMA-API: net: octeon: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/octeon/octeon_mgmt.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c index 622aa75..2006a07 100644 --- a/drivers

[PATCH 37/51] DMA-API: usb: use new dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/usb/chipidea/ci_hdrc_imx.c |4 +--- drivers/usb/dwc3/dwc3-exynos.c |4 +--- drivers/usb/host/ehci-atmel.c |4 +--- drivers/usb/host/ehci-omap.c |4 +--- drivers/usb/host/ehci-orion.c |4

[PATCH 38/51] DMA-API: staging: use dma_set_coherent_mask()

2013-09-20 Thread Russell King
-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/staging/dwc2/platform.c|5 +++-- drivers/staging/imx-drm/imx-drm-core.c |8 ++-- drivers/staging/imx-drm/ipuv3-crtc.c |4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/staging/dwc2/platform.c b

[PATCH 09/51] DMA-API: net: broadcom/b44: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/net/ethernet/broadcom/b44.c |3 +-- 1 files changed, 1

[PATCH 23/51] DMA-API: dma: pl08x: add dma_set_mask_and_coherent() call

2013-09-20 Thread Russell King
The DMA API requires drivers to call the appropriate dma_set_mask() functions before doing any DMA mapping. Add this required call to the AMBA PL08x driver. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/dma/amba-pl08x.c |5 + 1 files changed, 5 insertions(+), 0

[PATCH 16/51] DMA-API: ppc: vio.c: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/powerpc/kernel/vio.c |3 +-- 1 files changed, 1 insertions

[PATCH RFC] CRYPTO: Fix more AES build errors:

2014-01-02 Thread Russell King
is already runtime-conditional on NEON being supported, so there's no point compiling it out depending on the minimum build architecture. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- This is more a request for acks since I'd like to keep it/push it through my tree to reduce the autobuilder

[PATCH] ARM: convert all mov.* pc, reg to bx reg for ARMv6+ (part2)

2014-07-01 Thread Russell King
--- a/arch/arm/mm/proc-arm926.S +++ b/arch/arm/mm/proc-arm926.S @@ -55,7 +55,7 @@ * cpu_arm926_proc_init() */ ENTRY(cpu_arm926_proc_init) - mov pc, lr + ret lr /* * cpu_arm926_proc_fin() @@ -65,7 +65,7 @@ ENTRY(cpu_arm926_proc_fin) bic r0, r0, #0x1000

[PATCH 08/18] crypto: marvell: factor out adding an operation and launching it

2015-10-18 Thread Russell King
be harmless as the only thing which matters is to have all the data loaded into SRAM prior to launching the operation. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 74 +-- 1 file changed, 36 insertions(

[PATCH 12/18] crypto: marvell: ensure iter.base.op_len is the full op length

2015-10-18 Thread Russell King
che-but-no-user-data case to make the next change clearer. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c index c46

[PATCH 10/18] crypto: marvell: move mv_cesa_dma_add_frag() calls

2015-10-18 Thread Russell King
Move the calls to mv_cesa_dma_add_frag() into the parent function, mv_cesa_ahash_dma_req_init(). This is in preparation to changing when we generate the operation blocks, as we need to avoid generating a block for a partial hash block at the end of the user data. Signed-off-by: Russell King <

[PATCH 14/18] crypto: marvell: rearrange last request handling

2015-10-18 Thread Russell King
Move the test for the last request out of mv_cesa_ahash_dma_last_req() to its caller, and move the mv_cesa_dma_add_frag() down into this function. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 30 +++--- 1 file chang

[PATCH 04/18] crypto: marvell: fix the bit length endianness

2015-10-18 Thread Russell King
The endianness of the bit length used in the final stage depends on the endianness of the algorithm - md5 hashes need it to be in little endian format, whereas SHA hashes need it in big endian format. Use the previously added algorithm endianness flag to control this. Signed-off-by: Russell King

[PATCH 03/18] crypto: marvell: add flag to determine algorithm endianness

2015-10-18 Thread Russell King
Rather than determining whether we're using a MD5 hash by looking at the digest size, switch to a cleaner solution using a per-request flag initialised by the method type. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/cesa.h | 1 + drivers/crypto/m

[PATCH 02/18] crypto: marvell: keep creq->state in CPU endian format at all times

2015-10-18 Thread Russell King
ash to the result. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/cesa.h | 2 +- drivers/crypto/marvell/hash.c | 25 ++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/crypto/marvell/cesa.h b/drivers/crypt

[PATCH 05/18] crypto: marvell: ensure template operation is initialised

2015-10-18 Thread Russell King
Ensure that the template operation is fully initialised, otherwise we end up loading data from the kernel stack into the engines, which can upset the hash results. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 12 ++-- 1 file chan

[PATCH 09/18] crypto: marvell: always ensure mid-fragments after first-fragment

2015-10-18 Thread Russell King
-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c index 8111e73ca848..f567243da005 100644 --- a/drivers/crypto/m

[PATCH 13/18] crypto: marvell: avoid adding final operation within loop

2015-10-18 Thread Russell King
Avoid adding the final operation within the loop, but instead add it outside. We combine this with the handling for the no-data case. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 24 +--- 1 file changed, 17 insertions

[PATCH 07/18] crypto: marvell: factor out first fragment decisions to helper

2015-10-18 Thread Russell King
Multiple locations in the driver test the operation context fragment type, checking whether it is a first fragment or not. Introduce a mv_cesa_mac_op_is_first_frag() helper, which returns true if the fragment operation is for a first fragment. Signed-off-by: Russell King <rmk+

[PATCH 17/18] crypto: marvell: fix first-fragment handling in mv_cesa_ahash_dma_last_req()

2015-10-18 Thread Russell King
When adding the software padding, this must be done using the first/mid fragment mode, and any subsequent operation needs to be a mid-fragment. Fix this. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 8 1 file changed, 8 deletions(-)

[PATCH 06/18] crypto: marvell: const-ify argument to mv_cesa_get_op_cfg()

2015-10-18 Thread Russell King
mv_cesa_get_op_cfg() does not write to its argument, it only reads. So, let's make it const. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/cesa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/marvell/cesa.h b/d

[PATCH 11/18] crypto: marvell: use presence of scatterlist to determine data load

2015-10-18 Thread Russell King
makes the loop operation more obvious and understandable. 2. move the operation generation for the cache-only case. This prepares the code for the next step in its transformation, and also uncovers a bug that will be fixed in the next patch. Signed-off-by: Russell King <rmk+ker...@arm.linux.org

[PATCH 15/18] crypto: marvell: rearrange handling for hw finished hashes

2015-10-18 Thread Russell King
these parts. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 35 --- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c index b8ed04

[PATCH 18/18] crypto: marvell/cesa: fix memory leak

2015-10-18 Thread Russell King
s.com> Reported-by: Thomas Petazzoni <thomas.petazz...@free-electrons.com> Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/crypto/marvell/hash.c

[PATCH 16/18] crypto: marvell: rearrange handling for sw padded hashes

2015-10-18 Thread Russell King
as a separate operation. This ensures that the hardware only ever sees multiples of the hash block size to be operated on for software padded hashes, thus ensuring that the engine always indicates that it has finished the calculation. Signed-off-by: Russell King <rmk+ker...@arm.linux.org

[PATCH 1/6] crypto: caam: print errno code when hash registration fails

2015-10-18 Thread Russell King
Print the errno code when hash registration fails, so we know why the failure occurred. This aids debugging. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/

[PATCH 3/6] crypto: caam: fix non-block aligned hash calculation

2015-10-18 Thread Russell King
g that bad behaviour by CAAM. Fixes: 7d5196aba3c8 ("crypto: caam - Correct DMA unmap size in ahash_update_ctx()") Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cry

[PATCH 2/6] crypto: caam: avoid needlessly saving and restoring caam_hash_ctx

2015-10-18 Thread Russell King
waste of resources. So, remove this code. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index

[PATCH 5/6] crypto: caam: fix indentation of close braces

2015-10-18 Thread Russell King
The kernel's coding style suggests that closing braces for initialisers should not be aligned to the open brace column. The CodingStyle doc shows how this should be done. Remove the additional tab. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caam

[PATCH 4/6] crypto: caam: only export the state we really need to export

2015-10-18 Thread Russell King
-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 44 ++ 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index dcee360065f3..7dd80b

[PATCH 6/6] crypto: caam: fix DMA API leak

2015-10-18 Thread Russell King
olution here - we replace sg_count() with __sg_count(), so src_nents now contains the real number of scatterlist entries, and we then change the test for using the hardware scatterlist to src_nents > 1 rather than just non-zero. This change passes my sshd, openssl tests hashing /bin and tcryp

[PATCH 5/6] crypto: marvell: fix missing cpu_to_le32() in mv_cesa_dma_add_op()

2015-10-18 Thread Russell King
When tdma->src is freed in mv_cesa_dma_cleanup(), we convert the DMA address from a little-endian value prior to calling dma_pool_free(). However, mv_cesa_dma_add_op() assigns tdma->src without first converting the DMA address to little endian. Fix this. Signed-off-by: Russell King &l

[PATCH 6/6] crypto: marvell: use __le32 for hardware descriptors

2015-10-18 Thread Russell King
Much of the driver uses cpu_to_le32() to convert values for descriptors to little endian before writing. Use __le32 to define the hardware- accessed parts of the descriptors, and ensure most places where it's reasonable to do so use cpu_to_le32() when assigning to these. Signed-off-by: Russell

[PATCH 2/6] crypto: marvell: use dma_addr_t for cur_dma

2015-10-18 Thread Russell King
cur_dma is part of the software state, not read by the hardware. Storing it in LE32 format is wrong, use dma_addr_t for this. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/cesa.h | 4 +++- drivers/crypto/marvell/tdma.c | 6 +++--- 2 files chan

[PATCH 4/6] crypto: marvell: use memcpy_fromio()/memcpy_toio()

2015-10-18 Thread Russell King
Use the IO memcpy() functions when copying from/to MMIO memory. These locations were found via sparse. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/cipher.c | 11 ++- drivers/crypto/marvell/hash.c | 16 2 files chang

[PATCH 3/6] crypto: marvell: use gfp_t for gfp flags

2015-10-18 Thread Russell King
Use gfp_t not u32 for the GFP flags. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/cesa.h | 6 ++ drivers/crypto/marvell/tdma.c | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/marvell/cesa.h b/drivers/

[PATCH 1/6] crypto: marvell: use readl_relaxed()/writel_relaxed()

2015-10-18 Thread Russell King
Use relaxed IO accessors where appropriate. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/cesa.h | 2 +- drivers/crypto/marvell/cipher.c | 2 +- drivers/crypto/marvell/hash.c | 7 +++ drivers/crypto/marvell/tdma.c | 20 ++---

[PATCH 1/5] crypto: caam: print errno code when hash registration fails

2015-10-17 Thread Russell King
Print the errno code when hash registration fails, so we know why the failure occurred. This aids debugging. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/

[PATCH 4/5] crypto: caam: only export the state we really need to export

2015-10-17 Thread Russell King
-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 44 ++ 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index dcee360065f3..7dd80b

[PATCH 3/5] crypto: caam: fix non-block aligned hash calculation

2015-10-17 Thread Russell King
: 3d03d100 0026 sg@892: ed03d958: 7e8aa700 4020 which replaces the 0x06 length with the correct 0x26 bytes of previously unhashed data. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 2 +- 1 file chan

[PATCH 2/5] crypto: caam: avoid needlessly saving and restoring caam_hash_ctx

2015-10-17 Thread Russell King
waste of resources. So, remove this code. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index

[PATCH 3/3] crypto: marvell: initialise struct mv_cesa_ahash_req

2015-10-09 Thread Russell King
ort function only partially initialises this structure, we end up with a lot of members which are left with whatever data was in memory prior to sock_kmalloc(). Add zero-initialisation of this structure. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/h

[PATCH 1/3] crypto: ensure algif_hash does not pass a zero-sized state

2015-10-09 Thread Russell King
-by: Russell King <rmk+ker...@arm.linux.org.uk> --- crypto/algif_hash.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index 1396ad0787fc..f450584cb940 100644 --- a/crypto/algif_hash.c +++ b/crypto/algif_hash.c @@ -177,12 +

[PATCH 2/3] crypto: marvell: fix stack smashing in marvell/hash.c

2015-10-09 Thread Russell King
this to: err = crypto_ahash_export(req, state); which proceeds to write to 'state' as if it was a "struct md5_state", "struct sha1_state" etc. Add the necessary initialisers for the .statesize member. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers

[PATCH v2 3/3] crypto: marvell: initialise struct mv_cesa_ahash_req

2015-10-09 Thread Russell King
ort function only partially initialises this structure, we end up with a lot of members which are left with whatever data was in memory prior to sock_kmalloc(). Add zero-initialisation of this structure. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/h

[PATCH v2 2/3] crypto: marvell: fix stack smashing in marvell/hash.c

2015-10-09 Thread Russell King
this to: err = crypto_ahash_export(req, state); which proceeds to write to 'state' as if it was a "struct md5_state", "struct sha1_state" etc. Add the necessary initialisers for the .statesize member. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers

[PATCH v2 1/3] crypto: ensure algif_hash does not pass a zero-sized state

2015-10-09 Thread Russell King
-by: Russell King <rmk+ker...@arm.linux.org.uk> --- crypto/ahash.c | 3 ++- crypto/shash.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto/ahash.c b/crypto/ahash.c index 8acb886032ae..9c1dc8d6106a 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -544,7

[PATCH v3 3/5] crypto: marvell: initialise struct mv_cesa_ahash_req

2015-10-09 Thread Russell King
ort function only partially initialises this structure, we end up with a lot of members which are left with whatever data was in memory prior to sock_kmalloc(). Add zero-initialisation of this structure. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/ha

[PATCH v3 1/5] crypto: ensure algif_hash does not pass a zero-sized state

2015-10-09 Thread Russell King
-by: Russell King <rmk+ker...@arm.linux.org.uk> --- crypto/ahash.c | 3 ++- crypto/shash.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto/ahash.c b/crypto/ahash.c index 8acb886032ae..9c1dc8d6106a 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -544,7

[PATCH v3 2/5] crypto: marvell: fix stack smashing in marvell/hash.c

2015-10-09 Thread Russell King
this to: err = crypto_ahash_export(req, state); which proceeds to write to 'state' as if it was a "struct md5_state", "struct sha1_state" etc. Add the necessary initialisers for the .statesize member. Acked-by: Boris Brezillon <boris.brezil...@free-electrons.com> Signed-off

[PATCH v3 5/5] crypto: marvell: factor out common import functions

2015-10-09 Thread Russell King
to use the expensive 64-bit by 64-bit modulus operation. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 88 +++ 1 file changed, 21 insertions(+), 67 deletions(-) diff --git a/drivers/crypto/marvell/hash.c b/d

[PATCH v3 4/5] crypto: marvell: fix wrong hash results

2015-10-09 Thread Russell King
e, whereas we may be past the first fragment of data to be hashed. Arrange for the operation code to avoid the initialisation of the state, thereby preserving the imported state. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/marvell/hash.c | 15 +++

[PATCH v3b 5/5] crypto: marvell: factor out common import/export functions

2015-10-09 Thread Russell King
to switch a % const operation to do_div() in the common import function to avoid provoking gcc to use the expensive 64-bit by 64-bit modulus operation. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- Replacement to patch 5, going a little further, as requested by Boris. d

[PATCH RFC 07/11] crypto: caam: check and use dma_map_sg() return code

2015-12-07 Thread Russell King
entries to allocate, and then fill them in. This allows us to keep relatively simple error cleanup paths. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 109 - 1 file changed, 74 insertions(+), 35 del

[PATCH RFC 02/11] crypto: caam: ensure descriptor buffers are cacheline aligned

2015-12-07 Thread Russell King
Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index eccde7207f92..6a6d74f38300 100644 --- a/d

[PATCH RFC 04/11] crypto: caam: mark the hardware descriptor as cache line aligned

2015-12-07 Thread Russell King
Mark the hardware descriptor as being cache line aligned; on DMA incoherent architectures, the hardware descriptor should sit in a separate cache line from the CPU accessed data to avoid polluting the caches. Signed-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypt

[PATCH RFC 05/11] crypto: caam: replace sec4_sg pointer with array

2015-12-07 Thread Russell King
-off-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/caamhash.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 0a9665140d26..d48974d1897d 100644 --- a/drivers/crypt

[PATCH RFC 11/11] crypto: caam: get rid of tasklet

2015-12-07 Thread Russell King
-by: Russell King <rmk+ker...@arm.linux.org.uk> --- drivers/crypto/caam/intern.h | 1 - drivers/crypto/caam/jr.c | 25 + 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/crypto/caam/intern.h b/drivers/crypto/caam/intern.h index e2bcacc1a921..5d4c05

  1   2   >