From patchwork Tue Sep 3 14:22:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 172799 Delivered-To: patches@linaro.org Received: by 2002:ac9:5c4b:0:0:0:0:0 with SMTP id r11csp5641493ocp; Tue, 3 Sep 2019 07:22:43 -0700 (PDT) X-Received: by 2002:ac2:4117:: with SMTP id b23mr5539162lfi.36.1567520563181; Tue, 03 Sep 2019 07:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567520563; cv=none; d=google.com; s=arc-20160816; b=baPTqo+dUJdsRSbCMG2zWingOU8MMm2HwIGu/jMe8Vm6f6fbHUAF72QaEKjYEbMtxQ VgvO6+HC5MfkCJFXTs1/0AKvZyoAddHmT6KvMQBAl6m2QHiCvg+mQWjltlGYpuYmB5gv W9vXy2NoaEXyXTsA8aQOuupo9DQ9l31nyH79fbX90mivwXum0EHIE1XiOpd8mH4NqGut c2o0ATkizcNMe64+4yHvr4fW/CbwzI2cPjAt1H7dkn18SdcEYsD/RFmxdeYaEEEEzod9 eORrXBPL3hg/PFND96HCIYbfAaVt2tMKeKNile9wWbTZ8SwFUbWO7aed9A97EV+4F68w Nzkw== 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; bh=bNF5KDT4NEO2S6l4e9LzOtvZky1MgilMfLbdgvOUK14=; b=h9Wc+tYKF3u2GS1lYkphf/iXqQenKKflPrl+PK33KeZmgsb7EunC2udVJoA26rxLzB /QWIgSkE18O/PRFKGe4nBW+oWWOxKYNb+NYpHLU1v57Rf4wecnuyuyjLtJNuX6Y9wTaf akVvTf/LW3mK4EwZ24S90SVc/nUiUT1l4VuoUmbnUk6eQPZsUXqVQIeeNBrO39gAuY7T WROkaDoYuNuy5rzxYJgx8KDL0QMCxdlfv4u7/6mZnyaXNXo4Y7m9vTmxVViFyp0mA4GK eaYA/LvWZO4HghRdZwkcqQYo+KhDe53uxoyNF9aHlcckdgvjm2+Mi6DNVH5rgg9KL6O6 pyuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BgIkoA6S; 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 j23sor4971550lfh.18.2019.09.03.07.22.43 for (Google Transport Security); Tue, 03 Sep 2019 07:22:43 -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=BgIkoA6S; 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; bh=bNF5KDT4NEO2S6l4e9LzOtvZky1MgilMfLbdgvOUK14=; b=BgIkoA6S9HEs9gXOS1K2J8v1hct1nLo6iRbl+eWQRpwvWRAnL1gvf+6nlbSL6YQA3L YP0IzSVlJneAEtl8OLa9/CxAxpo1o1UsJgnOMYY2+Zi4BENlVOUxJ1C4U9RQXv43lRDA Mz84ak/0jeQjZANy0DnEaYTuPY760zFCzRlpLRpdw40SCH9Llqye34JP95vSzumbnnZS Zl2imszSl55QYmDXEmgLQ9Dg/rJzzHYX38Ck6g9OKS68zEeA4dAh3UGChi8gTj+nVrn9 2zFV28zKr4MoIj3TQjSFs0sV4I1qy2pFogTq2GA7SqZOvrq66YCj9MZziPPTklnjOHlO Lb7A== 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=bNF5KDT4NEO2S6l4e9LzOtvZky1MgilMfLbdgvOUK14=; b=TH/EyZ7UFg51LTU+U4IQsx5EsqJK4+i/hLLQRbfmpWlvep6M0vSPutwylPuKDi4+rc 0hkneCh+vTzQM4MR0bjTFBhbD1+kSHWDlIJkL0YCkigFmjeHDdP22i8QjEhWTmulcWZl ZAMJdBFypnGAFz9qtZ9vSv5PSyRc3iEWnOUBAbY9I43aTjU7maDMsRpteIG9DdDRDT4O jCvoaFre6ABBicQqUY+IdHcUKtcXUFqpU2WQ6iwcfuEmKrzyzeXOPkcq9NYiu8L9o+Rh mK+EhJkUxTSmRKuJbcBSuzrjxe/Vktr9RoUTwTq7cBsL0xyB6AfIatbyIF3SQBLEOb0f xSew== X-Gm-Message-State: APjAAAXIFOf17jk7DbEF8V0U1xj/U7EYwxeehwX1FXIg3xm1QwhfASG7 ffBnRU7CIKgckXGxNi8MgZjrZVeq X-Google-Smtp-Source: APXvYqyEEebdpTgfyZ3xa8X0pagg//6S5aVso4T3Lot6sSeBRjWR2Wwn14JGYYaV9PjJ35e0VWgv9Q== X-Received: by 2002:ac2:4c2f:: with SMTP id u15mr20191218lfq.174.1567520562816; Tue, 03 Sep 2019 07:22:42 -0700 (PDT) Return-Path: Received: from uffe-XPS-13-9360.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v10sm2430862ljc.64.2019.09.03.07.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 07:22:42 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Douglas Anderson , Matthias Kaehlcke Cc: Shawn Lin , Jaehoon Chung , Yong Mao , Chaotian Jing , linux-kernel@vger.kernel.org Subject: [PATCH 07/11] mmc: core: WARN if SDIO IRQs are enabled for non-powered card in suspend Date: Tue, 3 Sep 2019 16:22:03 +0200 Message-Id: <20190903142207.5825-8-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190903142207.5825-1-ulf.hansson@linaro.org> References: <20190903142207.5825-1-ulf.hansson@linaro.org> To make sure SDIO func drivers behaves correctly during system suspend/resume, let add a WARN_ON in case the condition is a non-powered SDIO card and there are some SDIO IRQs still being claimed. Signed-off-by: Ulf Hansson --- drivers/mmc/core/sdio.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 8dd8fc32ecca..c557f1519b77 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -951,6 +951,8 @@ static int mmc_sdio_pre_suspend(struct mmc_host *host) */ static int mmc_sdio_suspend(struct mmc_host *host) { + WARN_ON(host->sdio_irqs && !mmc_card_keep_power(host)); + /* Prevent processing of SDIO IRQs in suspended state. */ mmc_card_set_suspended(host->card); cancel_delayed_work_sync(&host->sdio_irq_work);