The patch titled spi: drain MXC SPI transfer buffer when probing device has been removed from the -mm tree. Its filename was spi-drain-mxc-spi-transfer-buffer-when-probing-device.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: spi: drain MXC SPI transfer buffer when probing device From: Daniel Mack <daniel@xxxxxxxx> On the MX31litekit, the bootloader seems to communicate with the MC13783 PMIC chip before booting Linux. However, it does not flush all the buffers properly after that, which makes the imx-spi driver read bogus data when probing the MC13783. Fix that by draining the SPI receive buffer on startup. Signed-off-by: Daniel Mack <daniel@xxxxxxxx> Cc: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx> Cc: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> Acked-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/spi/spi_imx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN drivers/spi/spi_imx.c~spi-drain-mxc-spi-transfer-buffer-when-probing-device drivers/spi/spi_imx.c --- a/drivers/spi/spi_imx.c~spi-drain-mxc-spi-transfer-buffer-when-probing-device +++ a/drivers/spi/spi_imx.c @@ -44,6 +44,9 @@ #define MXC_CSPIINT 0x0c #define MXC_RESET 0x1c +#define MX3_CSPISTAT 0x14 +#define MX3_CSPISTAT_RR (1 << 3) + /* generic defines to abstract from the different register layouts */ #define MXC_INT_RR (1 << 0) /* Receive data ready interrupt */ #define MXC_INT_TE (1 << 1) /* Transmit FIFO empty interrupt */ @@ -593,6 +596,11 @@ static int __init spi_imx_probe(struct p if (!cpu_is_mx31() || !cpu_is_mx35()) writel(1, spi_imx->base + MXC_RESET); + /* drain receive buffer */ + if (cpu_is_mx31() || cpu_is_mx35()) + while (readl(spi_imx->base + MX3_CSPISTAT) & MX3_CSPISTAT_RR) + readl(spi_imx->base + MXC_CSPIRXDATA); + spi_imx->intctrl(spi_imx, 0); ret = spi_bitbang_start(&spi_imx->bitbang); _ Patches currently in -mm which might be from daniel@xxxxxxxx are origin.patch linux-next.patch drivers-misc-add-driver-for-texas-instruments-dac7512.patch drivers-misc-add-driver-for-texas-instruments-dac7512-update.patch spi-imx-use-platform_driver_probe-as-probe-lives-in-inittext.patch spi-imx-correct-check-for-platform_get_irq-failing.patch spi-imx-use-positive-logic-to-distinguish-cpu-variants.patch spi-imx-add-mx25-support.patch spi-imx-dont-access-struct-device-directly-but-use-dev_get_platdata.patch vt-make-the-default-cursor-shape-configurable.patch drivers-video-move-dereference-after-null-test.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html