From patchwork Sun Sep 8 10:12:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 173338 Delivered-To: patches@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3003002ilq; Sun, 8 Sep 2019 03:12:46 -0700 (PDT) X-Received: by 2002:ac2:4352:: with SMTP id o18mr12877979lfl.164.1567937566221; Sun, 08 Sep 2019 03:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567937566; cv=none; d=google.com; s=arc-20160816; b=hDFg4A9CcEoG3Ko1Q4SwziObTYh/YuQWUvLrO5+eYpCV17vS6Zth2YY0qM8nyumlMu 2Bwp1tJLGqQBxX7bcHvJAO2hZ7Fer2a65NbjKf8oosuDTACDrYkexWLyGKRpVgvSJV9D gaHxHgZymXlEDmXO+Akk1OyjrBEBUYcKGPFucPreWdJ4vucKe9zoTGt+ZN/X9NqhRfkC pz0celrm1JJBkTXxnlxySTlo9MuoAHeUTT5zcIv5ZK6FiUz0hSdHrJ2pCE509vNI8lry ZJ2M35onrafotQyLsd3u+oygxDnOVYQcjUzcs/nG24pTSneH3OFPX/xVtUfg3fcCT3+q tsXw== 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=xyicSoe6hBPX50Bq7X1NmDZdoCyXZNomcUNAFE37PKY=; b=jh6C+dX6ji2wnfk+eUxIfLlePTsVpGQYb9AOAOcV8GBndkR1dwwyLw8iiGVxHD3YgR x2MTDWtlIpKSzabxxM8W1Q0mR0bbNXVvemhztEN9ygPFtBzEn4q8txawjYPYwcojXFlI Qkd/ZusESSmJ4fdHCgDLC7garf7SvPHNkcC+tHaNPK/uOorIclROGdsCt84GaYY/723f FHueOGM7FbCwVW8tdfzX+YE+Km5NbgPfjSRDZJNlIvN5oLLlrbPktOn6t0p7DJThz5Pw VvU5Ob43RGwEiqzolFgPq/K94pQBvC0qOtZkChl3o5u6MA1fywKrGs+rycV/4EGXu4Hu fcbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Edn66P4S; 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 z22sor3119079lfb.26.2019.09.08.03.12.46 for (Google Transport Security); Sun, 08 Sep 2019 03:12:46 -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=Edn66P4S; 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=xyicSoe6hBPX50Bq7X1NmDZdoCyXZNomcUNAFE37PKY=; b=Edn66P4SYLLch2VlatADxUAdLd0tfPrivUo4T6tVpdrp6UL1oMk62JvZ/hUJkvl87r Y4Rm76XwOcNH2VYEBygULdW5dVpM0jJkgDrgRJ3tLHe0DbyD+VC17UKw8QcWIoEhLW6g UxzARtbao3FE7GweeUr4Qonq+zdqyH5yT9dMcyQ1L2uBx0oU/N8x9O8wa1/WcKH5sb9d 9/HHhGHe1Lb5zmI73R/bjlpLVEaAc/mzChuooMB7S9eV3mxlP4d21X0xNbO8k6ssorLY I6whMaBA6Wswcg0rkCzfsWxj+NH2NnWVUScQXOlFfJOwxwNbJgeZyOXxMOyxOgKhTBsk GmQw== 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=xyicSoe6hBPX50Bq7X1NmDZdoCyXZNomcUNAFE37PKY=; b=RBgwW0m4rY54cvNpzUz3NMlEJF10Q7NxS+cBXxv36iKiier0Ot07nml++4vQRtk1RO /ZC0k8cx6gIFXcUGKxP8F6uHl8WAza1wZdwkCrcCljg3MQNxIWi/CW6di19lA6UP3hS+ UnoPPGIY+Xtc6PUM/MGIbndTqV2zNW6tnptBnm4HJQ6bhXsHDApCfXUZiqX4OJfMeIvP n4YLE9a7mQw5Zp7Z6t1j1XqW7YAcofdWVqd10ID2KXrCJP8EGCWbMlCsrAx4k1thkBG7 aOOLcJriDU/HVIr1K8c6z2kQU21DYCFPpUS8kuYyES/CD7fCurqlDBrwYAUDhTbVNCMB aJpA== X-Gm-Message-State: APjAAAU/xAUQzNacN+vjIsO2rlOB6/E0ut2gcvQQ8IToBJZGwx7LzPGQ I/Fe6Rd6wnAKwIrzkx50X9tp+Xa7 X-Google-Smtp-Source: APXvYqx9rsoHVDfNzT1ZVdZm1qIiEGkOqHceJPLVcgXZDKXrF+hMW6kC9XtCo2PmnIfoI33u7rdyTA== X-Received: by 2002:ac2:508b:: with SMTP id f11mr12898573lfm.153.1567937565846; Sun, 08 Sep 2019 03:12:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2019 03:12:45 -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 03/11] mmc: mtk-sd: Re-store SDIO IRQs mask at system resume Date: Sun, 8 Sep 2019 12:12:28 +0200 Message-Id: <20190908101236.2802-4-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> In cases when SDIO IRQs have been enabled, runtime suspend is prevented by the driver. However, this still means msdc_runtime_suspend|resume() gets called during system suspend/resume, via pm_runtime_force_suspend|resume(). This means during system suspend/resume, the register context of the mtk-sd device most likely loses its register context, even in cases when SDIO IRQs have been enabled. To re-enable the SDIO IRQs during system resume, the mtk-sd driver currently relies on the mmc core to re-enable the SDIO IRQs when it resumes the SDIO card, but this isn't the recommended solution. Instead, it's better to deal with this locally in the mtk-sd driver, so let's do that. Signed-off-by: Ulf Hansson --- drivers/mmc/host/mtk-sd.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 6946bb040a28..ae7688098b7b 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2408,6 +2408,9 @@ static void msdc_save_reg(struct msdc_host *host) } else { host->save_para.pad_tune = readl(host->base + tune_reg); } + + if (sdio_irq_claimed(host->mmc)) + __msdc_enable_sdio_irq(host, 1); } static void msdc_restore_reg(struct msdc_host *host)