From patchwork Tue May 9 08:27:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 98883 Delivered-To: patches@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1708392qge; Tue, 9 May 2017 01:27:37 -0700 (PDT) X-Received: by 10.28.203.143 with SMTP id b137mr4623171wmg.115.1494318457359; Tue, 09 May 2017 01:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494318457; cv=none; d=google.com; s=arc-20160816; b=pjyw4LHkgtjcqD5v6UU6LoRdIM4I/OTZurWpyCiwBJB5IffNdJRAj1du1vCfGPp9JN w+HC12fUo1GUui1FajF2VNxq5paZ0lvNToyyoLD9H3Pza7mOxEwO3VRTfyMYEHci8Evv NU8tM3VuZNmVZW7Sc8WSBrKrnRziK7HiDoJMM3NRF8dgm6TJRme1AF6z90XmYERU32ux 32IHuz60Hg3ipsQFiFWJ7N6ZptRkp6uEoyNSrHwAsEtUPyayc1/QwcZ3jFFMvcqfbKsm pcQAROJtp+mTIF2WMb3OcSZjtNwcgm9UwGOIUYF2V4B/JwP8RnRVrunyiNai2i+PzQYd WPug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=30BbE8mQAd3tnjfHE9wXYlYo6qerrlS4WG++0HNhYOQ=; b=T2as/uWQCS9MfGdSAYvpvOahjJCrBxLUvYRjckhYDIhrUaDr2KMLstrEJGUc+9YLVc OYTiWGhBqgOxpj0dfxl7q8NBUzqxnUPCs/fxwqe30Vwf/OQw/nmdS6MNlYSeU+i+hCic k73SWAYEsR+H7EsRvqwRSWC1QB/FW6TaqJGkl7JG5d803vlh+aW85C2AdYGlHME86GPv jYuSBrc7cOuSRdheQ6vdZnImRJkj4Ims9Xf6Z8u53ilo7rBoz1o53rJzcjHfxrpNmOFR 7CAl4SOfMqzfuASJWUO+VyskFHAjKloPnqHtsgGO+v/A8rjkegxN2qLyZ0m3QycQ8iu9 RKIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c0c::234 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-wr0-x234.google.com (mail-wr0-x234.google.com. [2a00:1450:400c:c0c::234]) by mx.google.com with ESMTPS id 93si16406873wrq.153.2017.05.09.01.27.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 01:27:37 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c0c::234 as permitted sender) client-ip=2a00:1450:400c:c0c::234; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c0c::234 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-wr0-x234.google.com with SMTP id l9so63239075wre.1 for ; Tue, 09 May 2017 01:27:37 -0700 (PDT) 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; bh=30BbE8mQAd3tnjfHE9wXYlYo6qerrlS4WG++0HNhYOQ=; b=ACxLSsQbT7R3iFK6QRtdRVDdnUWN4cLtYq9q/9KK+Wk3jvkSi4RUTAQ+49b6A7TKJw vFL3hRA2kWmxSxSLvNKk23D1Lf2ufzA9EOy27gBfBbRg6rD7BW7AWoVWoni/qB7xj9zX cKX7PSZv/dcpi1Tr7DMW6go6++n322pR4nOIw= 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; bh=30BbE8mQAd3tnjfHE9wXYlYo6qerrlS4WG++0HNhYOQ=; b=SfUZtBU/uxJv8o/If+kJpwUdceKoISQGLvKlW/D7r0EkhdOHDLJQ8Wxtox2gdlaxzs c98Dh5q9ewTrq+Udib1kGufoyseeEUPyRIMpRTT07pSCVFUvISIc7cAcvNXLb+6R4mNp Rja3htnjFWRe3TmMUMWbY/8ldzE3Ska1eOqibxFOIoRQqGcTq+jP+AJmOPIdC326s1jx OUsDbWeHklbN0RYbG/YM4yUzgcbCmyJkocyny0nYd5PP/nhcXBDR7UDC0NtFcb1sdPFD jZmMKO4jHHVJn+eyHHQLOs43D6s2Eqjcs1bXKZgnzhQMVfSC8W/7khMljOzn0YWWo3jN qVtQ== X-Gm-Message-State: AODbwcAm1esMmoF5JjT4L/q6HE+0vkvjoNPoHHAgKSlW9XWnEma+zklR kEPFxdqIqIYUq4NQnOQ= X-Received: by 10.46.32.230 with SMTP id g99mr2979042lji.38.1494318457034; Tue, 09 May 2017 01:27:37 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-221-67.na.cust.bahnhof.se. [155.4.221.67]) by smtp.gmail.com with ESMTPSA id o21sm3151108lfo.34.2017.05.09.01.27.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 May 2017 01:27:36 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Jaehoon Chung , Adrian Hunter , Brian Norris , Shawn Lin , Doug Anderson Subject: [PATCH v3 1/5] mmc: core: Prevent processing SDIO IRQs when none is claimed Date: Tue, 9 May 2017 10:27:25 +0200 Message-Id: <1494318449-2591-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494318449-2591-1-git-send-email-ulf.hansson@linaro.org> References: <1494318449-2591-1-git-send-email-ulf.hansson@linaro.org> In cases when MMC_CAP2_SDIO_IRQ_NOTHREAD is set, there is a minor window for when the mmc host could call sdio_run_irqs(), while in fact an SDIO func driver could have decided to released the SDIO IRQ via a call to sdio_release_irq(). In this scenario, processing of the SDIO IRQs are done even if there is none IRQ claimed, which is not what we want. To prevent this from happen, close the window by validating that at least one SDIO IRQs is claimed, before deciding to process them. Signed-off-by: Ulf Hansson Tested-by: Douglas Anderson Reviewed-by: Douglas Anderson --- drivers/mmc/core/sdio_irq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index 6d4b720..44d9c86 100644 --- a/drivers/mmc/core/sdio_irq.c +++ b/drivers/mmc/core/sdio_irq.c @@ -95,8 +95,10 @@ static int process_sdio_pending_irqs(struct mmc_host *host) void sdio_run_irqs(struct mmc_host *host) { mmc_claim_host(host); - host->sdio_irq_pending = true; - process_sdio_pending_irqs(host); + if (host->sdio_irqs) { + host->sdio_irq_pending = true; + process_sdio_pending_irqs(host); + } mmc_release_host(host); } EXPORT_SYMBOL_GPL(sdio_run_irqs);