From patchwork Sun Sep 8 10:12:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 173342 Delivered-To: patches@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3003104ilq; Sun, 8 Sep 2019 03:12:51 -0700 (PDT) X-Received: by 2002:a19:8c1d:: with SMTP id o29mr12981460lfd.73.1567937571524; Sun, 08 Sep 2019 03:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567937571; cv=none; d=google.com; s=arc-20160816; b=OzVUB5sGg+sHkg8C0im/jxOvXJLDttJ1fvHFUXCKx4/DPX29r3V+zV+WhqY1OJ/pIY hWJPyCUprjZTQ7zx5CbKFsq7l0NmWpVXKuLyXj1pzF/dxnL7K7X5gAknmvI1WOHUybmv pyZa9xmpTBUE44B9ICgGUiPxu3ZdI2Q6Ef5hcwgFObwRJ+uKNSPylKseFAf71zpDmizE RGwBSReQspWSbdUn6gKo+WDHrOwlV1v/KHJv/y/tVfRsmC2FB/yRIPb6IgE+Th4Ta/K+ YWGGuzGFHg5km9YSi1m6J51I6P4rIKI217r0+Ms61A7vKj+spKOCYON0Jy52XC5eU6LU qtSg== 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=UID+ZGhCw2nacez8i2dJLwbGqoz8PrG/hBN9ucQUcBM=; b=Xtye8hy6oCKT3GIqU6ycrBnxDkqaGkDdesHzW6nG23U10wQs1Ym0GAmcYjITR4mX4s +qZjt76ld6fzSNZPGLBh4r4ksjz4A3MOwi6ZVs+Ib0nMpCRmzZdrfBCHNeO/7ObDy7xF njC8HHkiuLharEhT5TPuGogIEiLaRW1iyL7G860+bLDvhICzYmd6hpPbHc2TTbG60kyR ofuWIj67bQLvjqDUVL4hWjFoM2Mmr/f98xwacCsBc6w3nly6Rth/nXLwg/gHI+wdDqY3 /tYMfK3I4/KKutS3HkyzsKOdvWlTwAWpegKX8T23ncU6Nw23VeHmWArxDPRgJfvG9qgk j1ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JWKbtRyO; 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 v14sor5609668ljd.44.2019.09.08.03.12.51 for (Google Transport Security); Sun, 08 Sep 2019 03:12:51 -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=JWKbtRyO; 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=UID+ZGhCw2nacez8i2dJLwbGqoz8PrG/hBN9ucQUcBM=; b=JWKbtRyO0r3UuwtokOdSoGl+Qf/PvjY0KfogNnlWS4LqEPt+bQ4pkFFt9NpCar4TDq W1r8Fe8rk49pFBluMRr1txg9wAIB49kpZODvn0Mnilqv8bsUcf7ZTbMf6YW8PJBpX7Ex 3Xw6tuU/X3GNLeHcEs0bIW1qDFZjE1eIHpkqNdxy2jEn8miLTHs6EgPGlfBVqDGcMB/u uWihWHGjsi7HHCXw/LYUooLZBAIDrzLsDLdcE2uC+KHRK+rvtJxkXVKXoygNCSbCAoe7 60tdgjYPNwKx08Cw/FmtwpUMuZinuyZ7Aiq6w5r6wjMlldyIkK+g/tn0wqRskNnoNMxO z5WQ== 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=UID+ZGhCw2nacez8i2dJLwbGqoz8PrG/hBN9ucQUcBM=; b=IXCIdzNGZALsqWMl+xMrSqSSigfEQr0JLFNRIAHjMmqGB3CvHbufTAqVKcNowWQXgP g6qVlT7P4OHWqwRQjIhlY8S1Ay/JuEbz/Dl8dztJt5osXIM694XeOFLal/9dS5mC2kh9 V/+OFLWT5KiL7WZKDWRZKveMVl+/VVCmfbL0JbQMt98g19y9kL8Fydh7LW9JE7kehDzH IW+2YZrI5zPEex+OCOJP483MoPktM7vOBeDkHKN9io+73I1YR4mblDhAn7Mu//34TyeM ozqd/Gyl+YpT37JQQllbD9UAwbUdMGzfmmAeTqmp7xav1MYlhu1izTz9+JGoFqUc8qXY 7wbw== X-Gm-Message-State: APjAAAULckNXotMOrVn+XY1hq63BypnJ5sg4fc1nFKAtXKOKA1f6Mbrg J6oYOUSNR0DGOBXvIRj9lNgyXMYL X-Google-Smtp-Source: APXvYqxN5OLcZWms4eihOTuBGpXa6p5URvzKGYMW1aNgnfvEAUegHDBj6ZcMriUHcGTZYMRYr+R5GQ== X-Received: by 2002:a2e:5714:: with SMTP id l20mr12019190ljb.122.1567937571210; Sun, 08 Sep 2019 03:12:51 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([185.122.190.73]) by smtp.gmail.com with ESMTPSA id h25sm2444849lfj.81.2019.09.08.03.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2019 03:12:50 -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 v2 07/11] mmc: core: WARN if SDIO IRQs are enabled for non-powered card in suspend Date: Sun, 8 Sep 2019 12:12:32 +0200 Message-Id: <20190908101236.2802-8-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190908101236.2802-1-ulf.hansson@linaro.org> References: <20190908101236.2802-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. Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke 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);