From patchwork Thu Oct 3 15:52:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175172 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp607550ill; Thu, 3 Oct 2019 10:10:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbJAPkd7fOmpQ9QoYjk95vVAb1fkLOMbVpRtwzVsTuN8APcXlB3UvNO9PaCpDIuuoJ4px8 X-Received: by 2002:a17:906:5109:: with SMTP id w9mr8522611ejk.282.1570122643555; Thu, 03 Oct 2019 10:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122643; cv=none; d=google.com; s=arc-20160816; b=wbw10kHkosAgAcmSkBy6L52P+mCdyOMEPFKOJXvGFEq33+33xZa4xZQMrvZP+SKI3X XIR7ZVVr7AVre80kmYYinkDOqAXg0Z8fRgg/+sEAQUPPH53btyqfd5879eIZIlyy1jot bw5tsCZST2CDbsNc+vEmn7499Q4aWKgbjwLKSmY89VrUJFsRKrBdgnXRiq2F4rBr9Co2 Y5SVaZKwUc1cs4ySi/xAgs8UmoTVkT+CpgLbeUSIttKq+JQ2ZJk66/11SC4WtE9Qyj1E KLwZgngrLr9DG3x8NhQg0YPSwYhd6XzP/IxZTbFKzRtX1sovIyWS+hakEDhKwRcQqg25 ok8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7xusYlWhFKzzWiCXxRIOQvSBsEVKu1kjtnfarMQ9cYQ=; b=m6Kaos7kIbW85GT06HkgH7kbUOMzy+yPKYab5kDIjxZ9wZAzJiHfRurthM+MNpkE3u tWgO6uNqySlpi27Dpmz3phPA7zRs0GE3VzJZvRgOrUymEV0QTY2YCwVzO+3Q6iAxDj/e ASs5fVyJLogZYyFKNJDMaQprCIzgao/1gDUotRqP9YATWDazDIQs4cObYjg1xIrou7J0 Un6eaSMI+wr19I0caIWxzr/eS28zrSBXTA/IBCuA8zNdPBTA4WpMf3hqmXr85Cm0loQA 3LC4xX/brl7tQaqJYqAVOcbKv6f1hP0Ldy7IRsqxLuKI5x0CWwSpiyhc3U3Y0RCbKe04 IYQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="eUA/a6j3"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k23si1884809ede.274.2019.10.03.10.10.43; Thu, 03 Oct 2019 10:10:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="eUA/a6j3"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391957AbfJCQct (ORCPT + 14 others); Thu, 3 Oct 2019 12:32:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:40570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391132AbfJCQct (ORCPT ); Thu, 3 Oct 2019 12:32:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 97A662133F; Thu, 3 Oct 2019 16:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120368; bh=dWZQeEXELj4oPCyvPKatzqbyZkyD3e/BEQa+Mm6YXN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eUA/a6j3qT3l/QoSqU5tPdI//iQhN6/YLBRaUA4qzpM+ZHBUWHecjJGMHJzZkJu+F CqGgKip6LiXmjPP8sHEGQZik8r++W/spBWrK6IodxuAxorXEOHgl+lfafat0D1DK0n JrUDDnAAKNfGx3mvBu9SJGj0j3yfH8UlHvIqIWK0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ulf Hansson , Sasha Levin Subject: [PATCH 5.2 195/313] mmc: mtk-sd: Re-store SDIO IRQs mask at system resume Date: Thu, 3 Oct 2019 17:52:53 +0200 Message-Id: <20191003154552.181623706@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ulf Hansson [ Upstream commit 1c81d69d4c98aab56c5a7d5a810f84aefdb37e9b ] 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 Signed-off-by: Sasha Levin --- drivers/mmc/host/mtk-sd.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1 diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 33f4b6387ef71..978c8ccce7e31 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2421,6 +2421,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)