Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: atmel-mci: Set the timer per command rather than per request

Setting the timer on a per request basis, is rather limiting as the timer
really depends on what commands that is to be sent as part of the request.

Therefore improve the behaviour by programming the timer per command basis
instead.

Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Link: https://lore.kernel.org/r/20200414161413.3036-3-ulf.hansson@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

+4 -2
+4 -2
drivers/mmc/host/atmel-mci.c
··· 169 169 #define atmci_writel(port, reg, value) \ 170 170 __raw_writel((value), (port)->regs + reg) 171 171 172 + #define ATMCI_CMD_TIMEOUT_MS 2000 172 173 #define AUTOSUSPEND_DELAY 50 173 174 174 175 #define ATMCI_DATA_ERROR_FLAGS (ATMCI_DCRCE | ATMCI_DTOE | ATMCI_OVRE | ATMCI_UNRE) ··· 818 817 819 818 atmci_writel(host, ATMCI_ARGR, cmd->arg); 820 819 atmci_writel(host, ATMCI_CMDR, cmd_flags); 820 + 821 + mod_timer(&host->timer, 822 + jiffies + msecs_to_jiffies(ATMCI_CMD_TIMEOUT_MS)); 821 823 } 822 824 823 825 static void atmci_send_stop_cmd(struct atmel_mci *host, struct mmc_data *data) ··· 1318 1314 * prepared yet.) 1319 1315 */ 1320 1316 atmci_writel(host, ATMCI_IER, iflags); 1321 - 1322 - mod_timer(&host->timer, jiffies + msecs_to_jiffies(2000)); 1323 1317 } 1324 1318 1325 1319 static void atmci_queue_request(struct atmel_mci *host,