[PATCH v2 5/5] mmc: mxcmmc: fix race conditions for host->req and host->data access

2013-03-31 Thread Anatolij Gustschin
mxcmci_dma_callback() is invoked by DMA drivers in soft-irq context and can be interrupted by the mxcmci_irq() interrupt which can finish the mmc request or data transfer and set host->req or host->data pointers to NULL. Then mxcmci_data_done() crashes with a null pointer dereferences. Protect all

[PATCH v2 4/5] mmc: mxcmmc: enable DMA support on mpc512x

2013-03-31 Thread Anatolij Gustschin
Add SDHC DMA channel description to the mpc512x device tree to enable slave channel requesting in the mxcmmc driver. mpc512x DMA engine doesn't support endianness conversion when reading/writing data from peripheral's FIFO, so we have to swap data buffers before each DMA write and after each DMA r

[PATCH v2 3/5] mmc: mxcmmc: constify mxcmci_devtype

2013-03-31 Thread Anatolij Gustschin
mxcmci_devtype struct contains constant data, so constify this struct. Signed-off-by: Anatolij Gustschin --- v2: - remove build warning fix (already fixed elsewhere) and change commit log drivers/mmc/host/mxcmmc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dri

[PATCH v2 2/5] mmc: mxcmmc: use slot-gpio API for write-protect detection

2013-03-31 Thread Anatolij Gustschin
slot-gpio API suppors read-only detection when "wp-gpios" property is present in the device tree mmc node. Use this API for write-protect detection. Signed-off-by: Anatolij Gustschin --- v2: - no changes drivers/mmc/host/mxcmmc.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-

[PATCH v2 0/5] mmc: mxcmmc: add mpc512x support

2013-03-31 Thread Anatolij Gustschin
The SDHC controller on mpc512x is compatible with i.MX31 SDHC controller, the existing MMC host driver can be used on mpc512x with some modifications, the patch series extends the existing driver. It is based on the following v3 mxcmmc DT support patch: https://patchwork.kernel.org/patch/236863

[PATCH v2 1/5] mmc: mxcmmc: add mpc512x SDHC support

2013-03-31 Thread Anatolij Gustschin
The SDHC controller on mpc512x is compatible with i.MX31 SDHC, so the mxcmmc driver can be used on mpc512x, too. Extend the driver to support mpc512x as well. Signed-off-by: Anatolij Gustschin --- v2: - change to select register accessors at build time and use ioread32be() and iowrite32be() a

[PATCH v3] mmc: mxcmmc: DT support

2013-03-31 Thread Anatolij Gustschin
From: Markus Pargmann Adding devicetree support for imx21-mmc and imx31-mmc. Based on generic gpio helper functions by Guennadi and generic DMA devicetree bindings. Signed-off-by: Markus Pargmann Signed-off-by:: Anatolij Gustschin --- Notes: Changes in v3: - fix first argument of dma_