提交 ab5d94f7 编写于 作者: U Ulf Hansson

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: NUlf Hansson <ulf.hansson@linaro.org>
Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com>
Link: https://lore.kernel.org/r/20200414161413.3036-3-ulf.hansson@linaro.orgSigned-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 740e6499
...@@ -169,6 +169,7 @@ ...@@ -169,6 +169,7 @@
#define atmci_writel(port, reg, value) \ #define atmci_writel(port, reg, value) \
__raw_writel((value), (port)->regs + reg) __raw_writel((value), (port)->regs + reg)
#define ATMCI_CMD_TIMEOUT_MS 2000
#define AUTOSUSPEND_DELAY 50 #define AUTOSUSPEND_DELAY 50
#define ATMCI_DATA_ERROR_FLAGS (ATMCI_DCRCE | ATMCI_DTOE | ATMCI_OVRE | ATMCI_UNRE) #define ATMCI_DATA_ERROR_FLAGS (ATMCI_DCRCE | ATMCI_DTOE | ATMCI_OVRE | ATMCI_UNRE)
...@@ -817,6 +818,9 @@ static void atmci_send_command(struct atmel_mci *host, ...@@ -817,6 +818,9 @@ static void atmci_send_command(struct atmel_mci *host,
atmci_writel(host, ATMCI_ARGR, cmd->arg); atmci_writel(host, ATMCI_ARGR, cmd->arg);
atmci_writel(host, ATMCI_CMDR, cmd_flags); atmci_writel(host, ATMCI_CMDR, cmd_flags);
mod_timer(&host->timer,
jiffies + msecs_to_jiffies(ATMCI_CMD_TIMEOUT_MS));
} }
static void atmci_send_stop_cmd(struct atmel_mci *host, struct mmc_data *data) static void atmci_send_stop_cmd(struct atmel_mci *host, struct mmc_data *data)
...@@ -1314,8 +1318,6 @@ static void atmci_start_request(struct atmel_mci *host, ...@@ -1314,8 +1318,6 @@ static void atmci_start_request(struct atmel_mci *host,
* prepared yet.) * prepared yet.)
*/ */
atmci_writel(host, ATMCI_IER, iflags); atmci_writel(host, ATMCI_IER, iflags);
mod_timer(&host->timer, jiffies + msecs_to_jiffies(2000));
} }
static void atmci_queue_request(struct atmel_mci *host, static void atmci_queue_request(struct atmel_mci *host,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册