diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2014-06-12 08:42:23 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2014-08-11 04:16:16 -0400 |
commit | 1cb9da502835dad73dda772b20c1e792f4e71589 (patch) | |
tree | 58d8d4272975cf1e5dffcef16140bd33435216e6 /drivers/mmc | |
parent | 3a33a94ce27068c8fef63a4f9ab7cff1210e2a4e (diff) |
mmc: mmci: Remove redundant check of status for DATA irq
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: Kees Cook <keescook@chromium.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Cc: <stable@vger.kernel.org> # v3.15+
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/mmci.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 6483c5cc6735..a723ed2883f9 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -888,6 +888,10 @@ static void | |||
888 | mmci_data_irq(struct mmci_host *host, struct mmc_data *data, | 888 | mmci_data_irq(struct mmci_host *host, struct mmc_data *data, |
889 | unsigned int status) | 889 | unsigned int status) |
890 | { | 890 | { |
891 | /* Make sure we have data to handle */ | ||
892 | if (!data) | ||
893 | return; | ||
894 | |||
891 | /* First check for errors */ | 895 | /* First check for errors */ |
892 | if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR| | 896 | if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR| |
893 | MCI_TXUNDERRUN|MCI_RXOVERRUN)) { | 897 | MCI_TXUNDERRUN|MCI_RXOVERRUN)) { |
@@ -1206,7 +1210,6 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) | |||
1206 | 1210 | ||
1207 | do { | 1211 | do { |
1208 | struct mmc_command *cmd; | 1212 | struct mmc_command *cmd; |
1209 | struct mmc_data *data; | ||
1210 | 1213 | ||
1211 | status = readl(host->base + MMCISTATUS); | 1214 | status = readl(host->base + MMCISTATUS); |
1212 | 1215 | ||
@@ -1232,11 +1235,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) | |||
1232 | MCI_CMDSENT|MCI_CMDRESPEND) && cmd) | 1235 | MCI_CMDSENT|MCI_CMDRESPEND) && cmd) |
1233 | mmci_cmd_irq(host, cmd, status); | 1236 | mmci_cmd_irq(host, cmd, status); |
1234 | 1237 | ||
1235 | data = host->data; | 1238 | mmci_data_irq(host, host->data, status); |
1236 | if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR| | ||
1237 | MCI_TXUNDERRUN|MCI_RXOVERRUN|MCI_DATAEND| | ||
1238 | MCI_DATABLOCKEND) && data) | ||
1239 | mmci_data_irq(host, data, status); | ||
1240 | 1239 | ||
1241 | /* Don't poll for busy completion in irq context. */ | 1240 | /* Don't poll for busy completion in irq context. */ |
1242 | if (host->busy_status) | 1241 | if (host->busy_status) |