From patchwork Mon Jul 15 16:42:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 169012 Delivered-To: patches@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4635345ilk; Mon, 15 Jul 2019 09:42:25 -0700 (PDT) X-Received: by 2002:a05:6512:146:: with SMTP id m6mr11842155lfo.90.1563208945331; Mon, 15 Jul 2019 09:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563208945; cv=none; d=google.com; s=arc-20160816; b=C1KXVLtGfW6vtyEGgPnxaBZLjqGzJ0sxwWv6/Oz0dg1HRVdptVm0sCTGhup/k+Gw3e TFWuUL17s2HitP9bqak/FePjY4TmnrpY0p/1Y45Ia+JDLlKDutgCALJSlEdpFNbuXKTm NcbmxoFA5+fxAUpoIJtZv/9pygidDhthqNEhuIuDBQy/Lk949twyocivOwTwZo4PiBZ5 brzdUKpH0GtUiA9UncbdW2LhQGKohnl+TIqu/gfA5xCJqnxWWBNwH9xSIszKUuXbcwjr BxNXuCaMuGjx8gCKUbut2ohgjGsx7fCufRaej23n3XH1oHie6sC6fSh6a6Cta21KPW7B nt0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=SvtIV/tcFCzqjGvQoWAOgEFc/3jodWDp36stdT3v0DM=; b=kW3HVHOMLNjtGK5/X7Q8j5JJUnvNaV1ab1ut/BihKVvdi4+v2PYBZ/MnvH025QfXd+ fxwd1bl9oTdRUPdAAeovC6zjIgNHTSJBzbXathl3wAY/tivskCmCAYCn5RSfRwUi/YWw jhUBIUFvvuL68QkcnqRmPpK4BcDFkeUwcP0l61tgEMXxJt6a61IlPamaHPib6wTW6BM2 FnKdVrnQvsXWo+VyWAqHspK7w9jMEAxo3N1i3InCIUuERJCOVvCRL94MvBuWM96msxid 1hV3eHjoGlaYOmpfs5xeH/Kz6IJrG4NlQ0wc2rW1EzT0qYhWCZNzGMgqAentnmjX+qzg VxqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZkttRZHX; 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 k19sor9658743ljj.5.2019.07.15.09.42.25 for (Google Transport Security); Mon, 15 Jul 2019 09:42:25 -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=ZkttRZHX; 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; bh=SvtIV/tcFCzqjGvQoWAOgEFc/3jodWDp36stdT3v0DM=; b=ZkttRZHXnWYK+dg6eqMWB6kba/LUdEL10AUe4S+FRr6cDRHK4V/3oQHGRS8aqAQLrO bCPdSwtZowZ/r4TJnbirgz5QlZSeLfPH/IAHdb+HBUppwIhAABc0gCi1sW91V+jEPAWF hZycY3GFOiMWqye01ss1gF7N8oOdACMvpCu7CXteezl+M9SItbGtxRJIIMWXHITdBsdx 2zrVj+EU6uB2GbAuwO6lgYHSQaT4WF7h7+hSxjHZaq+/Y+NCCNwCrFrhV4XaBbmnTB8t fQRvl5abEJhyNOgV8MwsAHJfGFMRG01t2/PqxhlZ4yYyTTZ9xflCnRtjd2iAwz9smWcH YNSg== 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; bh=SvtIV/tcFCzqjGvQoWAOgEFc/3jodWDp36stdT3v0DM=; b=toVJAu7fg6+XtuQmKi06Ca/QpbB5zqVHHlFFgw5crgflouY8XsSGMp3+81CeTrP47D HBfqWYDpwFVhynbIN6CwW+IP7I9/5xW13COBPt36QSHOgSC1wUMcGNOLpkv2QK6O5/22 /45yE4pcT3kkfJkn8w6RKbqd0m/HiFZuIoACESHO5ua3apiUrPZ7UI5jeuJFBe5/7FpA bV/UlZ8ZjRwvlNLAYmxv4bkcBPj3mxQoMx99Nop0K4wD9REAU5RP2Kwnero88wQQXW6t fqzJOb3gkqguc6eURkCr1qzCR1V8XGZQyKwzIkQJbUKhB0cmKUpiIxxW5Jy00PCcMrfn 0KBA== X-Gm-Message-State: APjAAAVdT/0cHfv67n36tLaZBWqEXWQrixnH/kDpg8mHa/FzyrF2BQe1 SJsm3QFI9XkXJhaF2eVXj/mKCF2g X-Google-Smtp-Source: APXvYqw7W4B9mR/OO+8nRc2tr8H7hfCum3oz0c/2jGi+Py3NC7e/7rhRe5luX2PSZY2c2X9usUxIvg== X-Received: by 2002:a2e:968e:: with SMTP id q14mr13744737lji.195.1563208944944; Mon, 15 Jul 2019 09:42:24 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id m25sm2388622lfc.83.2019.07.15.09.42.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 15 Jul 2019 09:42:24 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ludovic Barre Cc: Russell King , Linus Walleij , Jean-Nicolas Graux , Ulf Hansson Subject: [PATCH 1/2] mmc: mmci: Drop re-read of MMCISTATUS for busy status Date: Mon, 15 Jul 2019 18:42:17 +0200 Message-Id: <20190715164217.27297-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 The MMCISTATUS register is read from the IRQ handler, mmci_irq(). For processing, its value is then passed as an in-parameter to mmci_cmd_irq(). When dealing with busy detection, the MMCISTATUS register is being re-read, as to retrieve an updated value. However, this operation is likely costing more than it benefits, as the value was read only a few cycles ago. For this reason, let's simply drop the re-read and use the value from the in-parameter instead. Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 2.17.1 Reviewed-by: Linus Walleij diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 356833a606d5..5f35afc4dbf9 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1233,14 +1233,12 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, return; /* - * We were not busy, but we now got a busy response on - * something that was not an error, and we double-check - * that the special busy status bit is still set before - * proceeding. + * Before unmasking for the busy end IRQ, confirm that the + * command was sent successfully. */ if (!host->busy_status && !(status & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT)) && - (readl(base + MMCISTATUS) & host->variant->busy_detect_flag)) { + (status & host->variant->busy_detect_flag)) { /* Clear the busy start IRQ */ writel(host->variant->busy_detect_mask,