Commit d34227cd authored by Ulf Hansson's avatar Ulf Hansson Committed by Greg Kroah-Hartman

mmc: mmci: Remove redundant check of status for DATA irq

commit 1cb9da50 upstream.

We don't need to verify the content of the status register twice, while
we are about to handle a DATA irq. Instead let's leave all verification
to be handled by mmci_data_irq().

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>
Tested-by: default avatarKees Cook <keescook@chromium.org>
Tested-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9a35c3ef
...@@ -834,6 +834,10 @@ static void ...@@ -834,6 +834,10 @@ static void
mmci_data_irq(struct mmci_host *host, struct mmc_data *data, mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
unsigned int status) unsigned int status)
{ {
/* Make sure we have data to handle */
if (!data)
return;
/* First check for errors */ /* First check for errors */
if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR| if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR|
MCI_TXUNDERRUN|MCI_RXOVERRUN)) { MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
...@@ -1133,7 +1137,6 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) ...@@ -1133,7 +1137,6 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)
do { do {
struct mmc_command *cmd; struct mmc_command *cmd;
struct mmc_data *data;
status = readl(host->base + MMCISTATUS); status = readl(host->base + MMCISTATUS);
...@@ -1159,11 +1162,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) ...@@ -1159,11 +1162,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)
MCI_CMDSENT|MCI_CMDRESPEND) && cmd) MCI_CMDSENT|MCI_CMDRESPEND) && cmd)
mmci_cmd_irq(host, cmd, status); mmci_cmd_irq(host, cmd, status);
data = host->data; mmci_data_irq(host, host->data, status);
if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR|
MCI_TXUNDERRUN|MCI_RXOVERRUN|MCI_DATAEND|
MCI_DATABLOCKEND) && data)
mmci_data_irq(host, data, status);
/* Don't poll for busy completion in irq context. */ /* Don't poll for busy completion in irq context. */
if (host->busy_status) if (host->busy_status)
......
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