From 4792f29f831efe0bfcb9194526b7ef2f7e7e2795 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 5 Jan 2010 03:32:25 +0100 Subject: [PATCH] jz4740-mmc: Request irq with IRQF_DISABLED. This fixes a race problem with the ks7010 sdio wireless card. --- .../xburst/files-2.6.31/drivers/mmc/host/jz_mmc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/xburst/files-2.6.31/drivers/mmc/host/jz_mmc.c b/target/linux/xburst/files-2.6.31/drivers/mmc/host/jz_mmc.c index 4758d66ab..e4bdde063 100644 --- a/target/linux/xburst/files-2.6.31/drivers/mmc/host/jz_mmc.c +++ b/target/linux/xburst/files-2.6.31/drivers/mmc/host/jz_mmc.c @@ -27,6 +27,7 @@ #include #include #include +#include #define JZ_REG_MMC_STRPCL 0x00 #define JZ_REG_MMC_STATUS 0x04 @@ -100,7 +101,6 @@ #define JZ_MMC_CLK_RATE 24000000 - struct jz4740_mmc_host { struct mmc_host *mmc; struct platform_device *pdev; @@ -124,7 +124,6 @@ struct jz4740_mmc_host { struct timer_list clock_timer; struct timer_list timeout_timer; unsigned waiting:1; - }; static void jz4740_mmc_cmd_done(struct jz4740_mmc_host *host); @@ -205,7 +204,6 @@ static void jz4740_mmc_write_data(struct jz4740_mmc_host *host, struct mmc_data uint32_t *sg_pointer; int status; size_t i, j; - uint16_t snob; for (sg = data->sg; sg; sg = sg_next(sg)) { sg_pointer = sg_virt(sg); @@ -288,7 +286,7 @@ static void jz4740_mmc_read_data(struct jz4740_mmc_host *host, struct mmc_data * struct scatterlist *sg; uint32_t *sg_pointer; uint32_t d; - int status = 0; + uint16_t status = 0; size_t i, j; for (sg = data->sg; sg; sg = sg_next(sg)) { @@ -333,6 +331,7 @@ static void jz4740_mmc_read_data(struct jz4740_mmc_host *host, struct mmc_data * flush_dcache_page(sg_page(sg)); } + status = readl(host->base + JZ_REG_MMC_STATUS); if (status & JZ_MMC_STATUS_READ_ERROR_MASK) goto err; @@ -411,7 +410,7 @@ static irqreturn_t jz_mmc_irq(int irq, void *devid) host->cmd->data->error = -EIO; } else if(status & (JZ_MMC_STATUS_CRC_READ_ERROR | JZ_MMC_STATUS_CRC_WRITE_ERROR)) { - host->cmd->data->error = -ETIMEDOUT; + host->cmd->data->error = -EIO; } if (irq_reg & JZ_MMC_IRQ_END_CMD_RES) { @@ -422,6 +421,7 @@ static irqreturn_t jz_mmc_irq(int irq, void *devid) return ret; handled: + writew(0xff, host->base + JZ_REG_MMC_IREG); return IRQ_HANDLED; } @@ -809,7 +809,7 @@ static int __devinit jz4740_mmc_probe(struct platform_device* pdev) } } - ret = request_threaded_irq(host->irq, jz_mmc_irq, jz_mmc_irq_worker, 0, "MMC/SD", host); + ret = request_threaded_irq(host->irq, jz_mmc_irq, jz_mmc_irq_worker, IRQF_DISABLED, "MMC/SD", host); if (ret) { dev_err(&pdev->dev, "Failed to request irq: %d\n", ret); goto err_free_card_detect_irq;