Commit 91ab252a authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Chris Ball

mmc: sh-mmcif: avoid oops on spurious interrupts (second try)

On some systems, e.g., kzm9g, MMCIF interfaces can produce spurious
interrupts without any active request. To prevent the Oops, that results
in such cases, don't dereference the mmc request pointer until we make
sure, that we are indeed processing such a request.
Reported-by: default avatarTetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Tested-by: default avatarTetsuyuki Kobayashi <koba@kmckk.co.jp>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 6984f3c3
...@@ -1104,7 +1104,6 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id) ...@@ -1104,7 +1104,6 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
{ {
struct sh_mmcif_host *host = dev_id; struct sh_mmcif_host *host = dev_id;
struct mmc_request *mrq = host->mrq; struct mmc_request *mrq = host->mrq;
struct mmc_data *data = mrq->data;
cancel_delayed_work_sync(&host->timeout_work); cancel_delayed_work_sync(&host->timeout_work);
...@@ -1152,13 +1151,14 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id) ...@@ -1152,13 +1151,14 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
case MMCIF_WAIT_FOR_READ_END: case MMCIF_WAIT_FOR_READ_END:
case MMCIF_WAIT_FOR_WRITE_END: case MMCIF_WAIT_FOR_WRITE_END:
if (host->sd_error) if (host->sd_error)
data->error = sh_mmcif_error_manage(host); mrq->data->error = sh_mmcif_error_manage(host);
break; break;
default: default:
BUG(); BUG();
} }
if (host->wait_for != MMCIF_WAIT_FOR_STOP) { if (host->wait_for != MMCIF_WAIT_FOR_STOP) {
struct mmc_data *data = mrq->data;
if (!mrq->cmd->error && data && !data->error) if (!mrq->cmd->error && data && !data->error)
data->bytes_xfered = data->bytes_xfered =
data->blocks * data->blksz; data->blocks * data->blksz;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment