From patchwork Tue Apr 14 16:13:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 185404 Delivered-To: patches@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp1601456ilf; Tue, 14 Apr 2020 09:14:21 -0700 (PDT) X-Received: by 2002:a05:651c:215:: with SMTP id y21mr556660ljn.87.1586880861654; Tue, 14 Apr 2020 09:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586880861; cv=none; d=google.com; s=arc-20160816; b=qpwToer3pn14aYhkLCBirIhfpnxMqZax0U19RoHzwirIIBhDMUFW2NgPT4y6+mrTat 06njsBd1RT4Kdxn8y+3Vu+SxFlzKQgt+SRRYxqj8tMqvF6WbywTBo1p3FtkkNvxVAw2e AVp4D2SxigAQrLgzTVMNdDcwht1mUpCQzGuJMybRVROCjCANJv2VbsFrc0aT4fxHlg+f /zFOPsLMJMuOXoEidiI8EtdLNo+j6xEBIZihDe2nuJ10ydk1aldSBLBA567y+PchlkBd L9eM7xn3e95CoHXV5PubchVixVxFLyuUMEfepYjkw/M2eFaFIe6CSMTyulFHqBIYzWHe I7fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7LduVD2uZS35fq7b3rWpwMCdk3E6T3OQ5w3znT1sZ0o=; b=V2VrUlmKDMG0KHb1kQU0JnwWYwsmiTMN5HXSMX+N4dd435SOyqEk9C3UI/pj1Odg+E cuo07kW33nJm4HvcFWXJK9bh9hU3HyNgD3gf52Kg1G7bLfCJPmZctQkOBp+U0BGg3Spc GZgPxqw3Gt7jsxCERFGSxtZq5UWs/AlOioA22NmNVANT5Vw+Xerb8dR05A9iaiZ5rVnE eDMDo2+ftIJcqeSck2DlneJ+Tux7hmDNd2cPhl0+T5fonL2JIx5XVRB2UvAvuKuM0Tlz Gg3EQxoO54cyHnN81JXU2Io0SxxZqpU+FQ4jUE0z0QV7jzjuOLa/+ywAj5RqM0Grh2Sd O9Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ybNoaVLx; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id j18sor7953391lja.0.2020.04.14.09.14.21 for (Google Transport Security); Tue, 14 Apr 2020 09:14:21 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ybNoaVLx; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7LduVD2uZS35fq7b3rWpwMCdk3E6T3OQ5w3znT1sZ0o=; b=ybNoaVLxsmcOKKwqgU+D19pNdmFWVntSm7VVsTsiO3lwWfS4JurMrNdeAZ2GrbhEe1 QETjMX/gguWOx+2iYkbixlWIVdMgjqxCyOg0JJY2MvLsd4bTHEi0K2I2b9l03sxGrnSc z1nXqYtPsd5MFWYWB18Brf2T8MeAzmlZgUZvsaAwirI5Miua992hGKAJzW9drNqxPfXJ JOljET2+mk2U94PVMnCKfFBH9n85M7QU3Jxcm6PQsBPyco8rQJlcs7TPnLeNWz0L1ulv TaaVUoWMN71z3U1r2FJHqZvjqXm/b4p8IoBHy1zzqJaR1ESYhOu6brNolBo2xLlZxO4e rNYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7LduVD2uZS35fq7b3rWpwMCdk3E6T3OQ5w3znT1sZ0o=; b=Zo3sw/vi5dxqnmOadDqE8cPITeAY5GLHk3MGiyD9E+Jjc3bdyC1eQPAptuesSJIETZ qqxatIrWCDzSqUoXX+oP2n6CNePSJuGgoWq19WS/KEk/cYCZLueue6ZPPKAB4pjwcXdX hHPGgiFvbyoZ2tNFFTGybaEhVzaGZDtha7YmLRC3zUU028hmTS0OjRGhirWvfeq+ZRF9 KpXvAJBYnl13XtnDYQljBKSstH51KUlAa/LHN2Ya3+UtiUiAVyJb3Aid0sDc2SY41fkU sNbWAqTTuwGFGlg9PuLMgE4ryujGFyPRjp0jx2eXh5/pTlxKAOZLM9pML8JAwDuMS/gO 1E1A== X-Gm-Message-State: AGi0PuYKUNDJJar8YcgEWq7gAA2VdORJiCdrpEiyR2VHIyC4O7BV5rx1 I9Tg9qfP6pDsC0BVcTGUAYT9X57m X-Google-Smtp-Source: APiQypKCPWSEYnixJRTEMXCdwuSakasGvOelofBOLCza141ICejNMneeXisEP2I4gmISHO2Rr1Zcsw== X-Received: by 2002:a2e:8e3a:: with SMTP id r26mr534954ljk.171.1586880861230; Tue, 14 Apr 2020 09:14:21 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-98-128-181-131.NA.cust.bahnhof.se. [98.128.181.131]) by smtp.gmail.com with ESMTPSA id a26sm9330669ljn.22.2020.04.14.09.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 09:14:20 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Adrian Hunter , Linus Walleij , Rui Miguel Silva , Johan Hovold , Alex Elder , Greg Kroah-Hartman , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Bruce Chang , Harald Welte , Alex Dubov , Sascha Sommer , Manivannan Sadhasivam , mirq-linux@rere.qmqm.pl, Jesper Nilsson , Lars Persson , Paul Cercueil , Ludovic Desroches , Nicolas Ferre Subject: [PATCH 02/19] mmc: atmel-mci: Set the timer per command rather than per request Date: Tue, 14 Apr 2020 18:13:56 +0200 Message-Id: <20200414161413.3036-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200414161413.3036-1-ulf.hansson@linaro.org> References: <20200414161413.3036-1-ulf.hansson@linaro.org> MIME-Version: 1.0 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 Cc: Nicolas Ferre Signed-off-by: Ulf Hansson --- drivers/mmc/host/atmel-mci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 0472df8391b5..7292970065b6 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -169,6 +169,7 @@ #define atmci_writel(port, reg, value) \ __raw_writel((value), (port)->regs + reg) +#define ATMCI_CMD_TIMEOUT_MS 2000 #define AUTOSUSPEND_DELAY 50 #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, atmci_writel(host, ATMCI_ARGR, cmd->arg); 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) @@ -1314,8 +1318,6 @@ static void atmci_start_request(struct atmel_mci *host, * prepared yet.) */ atmci_writel(host, ATMCI_IER, iflags); - - mod_timer(&host->timer, jiffies + msecs_to_jiffies(2000)); } static void atmci_queue_request(struct atmel_mci *host,