From patchwork Wed Sep 11 12:09:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 173610 Delivered-To: patches@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp653487ilq; Wed, 11 Sep 2019 05:09:26 -0700 (PDT) X-Received: by 2002:adf:ea8f:: with SMTP id s15mr29461227wrm.222.1568203766752; Wed, 11 Sep 2019 05:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568203766; cv=none; d=google.com; s=arc-20160816; b=mZRBhGRneYw4aD1Ybu/4ll/+yiSRISi71bg/CPUF/iLh+cNyViC51ZgWw+enIUsgQ0 h5Mrzh8VjqtvgvxcMMcoJtCotOo9VsZJufIIo1XoknQoNKs398CY6ek3phzy9mzZ/jCb bXqKuXZ6laPIxJhItNmT0AjVNMyB41i/n9h1tyKZbIGnnbPx6hi1T8fYzwa5VFoyo5ks rQukRQfJuOyRB+WlEP05FuD7kv2FRiPLrO8NuFh3ymeRn85+EBxmoFn5mnqIth4zX9Ho UBwfp1MpdfCdLGIdFH4Q+Ty0Kb+Qttou7Bxmn+nTO5AuQBWe2tkRwlYJ9/IMvbQ7qetf qeZg== 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=o7ho9r/iGAZKzQvAqY97r1IQvfNPAaA5ba/IicHvJwY=; b=MiY2OjzASwJR2rFFcnZwIAIP/aQsYt69lj+uVkhFxyVRkjMSnKjV+K8JrhRUnQkkXf 3PyI7kucf38yXy//rYCFLIT5wZ2Lg9faDlHq1KzA2O06OaHWLtUQD+e+nQJfvjVw8B35 NzlvY7ZK9wsgfypmeugFTns6DSnjMV+n9/hXXUhUpakMQXUxAxvBIkzhwUSW1BvVyXQ6 JlUzzRTRNgiJ7P6ZWolPGOg8nDrFr2Sz27TobxJSJ7XgH0afQYYDfkKveCh6k60uz7QY fLvQDj9JH088kXziElv07GvJLef1QgUa3psVqIJbkA5c70P53QIhhaCMYJe/X8DbtoqG W3zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hbCKQv4p; 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 w15sor17239085wrc.37.2019.09.11.05.09.26 for (Google Transport Security); Wed, 11 Sep 2019 05:09:26 -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=hbCKQv4p; 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=o7ho9r/iGAZKzQvAqY97r1IQvfNPAaA5ba/IicHvJwY=; b=hbCKQv4py8zWlw03EKgXl+QThGu53cVPGc8fO4vQ7/CX0yf/KLp4ExowJzXLbBZ/e/ 3xOS8KJIrctJKezc458qBgahXgbvhMyQnRXNIpBUKyUdLhST6KaTmUh4vduaWSHtc4By Y9T+uW8NUp8MAFRXVroJkKRzzUSJ23TigHPCU1AEL3SUguyPLsVOsY1p8gLGUeRteVC3 ceDfFRVmplx7J/u6kv9utEj0K3xVPVGjZwaQ3PoKUDSZ3GSYgJnclMVPhICpzOzARL9N gu42UYqMYWmM76Ea1iecVl6+IjbYNQ9CBPCvPKgefKrsecEmcqqvseRF8qM8sNSkhuIr tZOA== 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=o7ho9r/iGAZKzQvAqY97r1IQvfNPAaA5ba/IicHvJwY=; b=YFq/0CxlDV6PaSQPrc2rGuwVAPUHBkCqbOWJzfr/cEpO7ghoGtR3GPRgYxqExiEMhm LHDCqgj5qafWUudoiPpjRW84+ISwmPvar7lYWXHL5MBqUzAO+Xdj69HmnXm9xYWUfoCK HTr6F58IHaMeXcbAEHpakqPRg5ouhKQoupjD5ZqwsGb3PrpBvJ/JlMMKOfb12OYYSm4y SSiVDmvO719H15pFt5gWYcSjtt4WIuTg0YUc+LJNx7zsagani6Zv5soH3yi+7cki403G oazdfS7I9OC/GHIYzTrxq3oCX+xHQG110oi6GHZo9KDSWl97eqNSA9C2cju5lCa3//KG 0WAQ== X-Gm-Message-State: APjAAAUqGVk0L0WbRLWehasrm4H14zlSMBO7lVGe9I1gQ9BVlU8hSYmX NILQmGdP2I2jmsQCR3Nq2O5z3/IX X-Google-Smtp-Source: APXvYqxe6ABFSX/fr9kAyogvKjvlUZiuw+kj/+U6iGNWVgjD3zHmuy8L8HzR76Xsw3m0waD0JpWu5w== X-Received: by 2002:a5d:4709:: with SMTP id y9mr29734798wrq.129.1568203766000; Wed, 11 Sep 2019 05:09:26 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([148.69.85.38]) by smtp.gmail.com with ESMTPSA id n7sm20135743wrx.42.2019.09.11.05.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2019 05:09:25 -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 v3 03/11] mmc: mtk-sd: Re-store SDIO IRQs mask at system resume Date: Wed, 11 Sep 2019 14:09:20 +0200 Message-Id: <20190911120920.9026-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 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 --- Changes in v3: - Fix the code to do the restore in msdc_restore_reg(). --- 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..189e42674d85 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2435,6 +2435,9 @@ static void msdc_restore_reg(struct msdc_host *host) } else { writel(host->save_para.pad_tune, host->base + tune_reg); } + + if (sdio_irq_claimed(host->mmc)) + __msdc_enable_sdio_irq(host, 1); } static int msdc_runtime_suspend(struct device *dev)