From patchwork Tue Apr 14 16:13:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 185403 Delivered-To: patches@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp1601416ilf; Tue, 14 Apr 2020 09:14:20 -0700 (PDT) X-Received: by 2002:a2e:85c4:: with SMTP id h4mr596892ljj.112.1586880860089; Tue, 14 Apr 2020 09:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586880860; cv=none; d=google.com; s=arc-20160816; b=cQkaV9f+3mbQDWR0NstOIP66DAIniHokYaN3oc2ERYnPpeyYj0oI3vBK6LUZHOBWI4 eaBXRejT16Nm/IyMYT6Blhw9lmEIUNGROwAVrpG+eIV2hQsLjGAe4lKq8gM6Ygc3YqD3 o1qv3DJiYBQe8VBubUQJCw/rpNYfbPAS5ejK6PqUmRE8JJjbwGSE5s0LTl7dBOjmeU8a cn2Cqhx5su5VZz9vq0arx/OWVZwU/1jryIrqwy1e9moUhOaiYMhNmApPf6+s/A+fT06i ZpB7xu4EnjBIL1x+BmlBydePBYVILXm9rWB4E9EDc7CiRYoMgK91DjtpT4ILJIyUrTTh 1vTA== 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=fwu9S7UAM+VTYbloegyIHMb4QE63ILc3ZmogPOBkYSU=; b=FquD7oLacZkF0Tu4ToGrdfdgImci9FQa2MXB6Nf3plthkdKZ+UnCgHHepZcVY5inrU hoi6Sk0MLjmVkeKt3YjqsyYFG6UifGP02tQ9O+JXURzWUKHIypfMrM+6xdd1Tn8ODiC3 AjgtwCULmUWTig6CbjdoYpFlhGbsDnyKZkvAmm8i1gGETPueJIElASool1bSc0yCCchy IQslcXEWZ4T16EIpulzSuJ6KT9C3mRol8Yq8Y5K/LQrxPA3qdcIRVbI0298h76f+FN1F DjZWfBxiuqzEJX/v8vT6OaxKRydPJnB3BBgyzVcn3sHGURUUllLoMbNUJuer76vSat/p qR+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TEUP/ysJ"; 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 h6sor7887396ljl.36.2020.04.14.09.14.19 for (Google Transport Security); Tue, 14 Apr 2020 09:14:20 -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="TEUP/ysJ"; 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=fwu9S7UAM+VTYbloegyIHMb4QE63ILc3ZmogPOBkYSU=; b=TEUP/ysJDXAn4KxMntEmfuWp7e1ntkd972BMMHUAMu5RSVy9NFcLzJ/MNbN2sAhr9K z68Bs0twoY/mOuLSNUVJzJ6T3O897odoityS+fUX07CGspTf0xdXFoQRV/Rdg+sU1bAK XpT/snLZrvR1mU33DD9m0MZSoEBCsJ37ao2b0JENZmJOFWI74Lb5IDTYWSD3ECBwQpmX eta9GEbIYs9lcYyoJjvV/HTmqbjvRJiG3iYhgCJ2CuKykyA5KbvAHaojHmINJL/0hlJc XvzMZPk3tFXppWXMn6J1hPvgYoFDtmsZfURKfoZcFhtTNg4RYPJnzs1/vtHVyPTZeUrJ OkkA== 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=fwu9S7UAM+VTYbloegyIHMb4QE63ILc3ZmogPOBkYSU=; b=Rlp5R5Ygg0r2eOXuvON4KoTSjRVuqTDVJRcKHVxd5GPBCmN6jEb9qBqmWB5l9HiLBP obLbZyKf4cZvquCKVvflN1wY72fb7+smPT5pSvGoeeRgdxyh3h20bTG5hYihMjwLQx/o yNR2nTfBGwdunpupSUJUYbFPIiguh/w5ItaSwa5GqzFhvq+orhFiC76NbEYOE0WkHLQh A/GvfPzUNIg7LIGMzwYwvVt24WSxfsBgT481agR9l/dkamlTq3/4OGGfvVzMY+L2IJC/ MxoklsrhEu19XzPB9QZFypgsyfmZTc2RtgBharxk+5dwP6hxc+zDsKXdOpbZ92asCJBW m1gA== X-Gm-Message-State: AGi0PubFsO+KdMAjLWfdk8SdxYXt5aE18iAX8uI2UUap0AB9o0jZrvq/ bMYHK5yvA6+WvitFmfQXuUgghx8I X-Google-Smtp-Source: APiQypJM/eUdzwtHvKRnjzHusrgxtMlGcKRC7NKmQ0OWpE9gTPFZ6P//cvxf2cOs7EDedBN2qOKVPw== X-Received: by 2002:a2e:9713:: with SMTP id r19mr553910lji.89.1586880859671; Tue, 14 Apr 2020 09:14:19 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 09:14:19 -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 01/19] mmc: atmel-mci: Keep timer enabled when queuing a next request Date: Tue, 14 Apr 2020 18:13:55 +0200 Message-Id: <20200414161413.3036-2-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 When atmci_request_end() is about to finish a request for one slot, there is a possibility that there is new request queued for another slot. If this turns out to be the case, the new request is started and the timer is re-programmed for it. Although, a few lines below in atmci_request_end(), this timer becomes deleted, likely corresponding to the other recently completed request. This looks wrong, so let's fix it. Cc: Ludovic Desroches Cc: Nicolas Ferre Signed-off-by: Ulf Hansson --- drivers/mmc/host/atmel-mci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 Acked-by: Ludovic Desroches diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index aeaaa5314924..0472df8391b5 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -1557,6 +1557,8 @@ static void atmci_request_end(struct atmel_mci *host, struct mmc_request *mrq) WARN_ON(host->cmd || host->data); + del_timer(&host->timer); + /* * Update the MMC clock rate if necessary. This may be * necessary if set_ios() is called when a different slot is @@ -1583,8 +1585,6 @@ static void atmci_request_end(struct atmel_mci *host, struct mmc_request *mrq) host->state = STATE_IDLE; } - del_timer(&host->timer); - spin_unlock(&host->lock); mmc_request_done(prev_mmc, mrq); spin_lock(&host->lock);