Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3648800pxb; Mon, 24 Jan 2022 14:23:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/HLHdE2WsJ2QRREEaZWIgCsFdP+rSvSZsAkJ4eMDNEyLYGPh5X7x+M67vmqIjThQTFnDq X-Received: by 2002:a63:4e24:: with SMTP id c36mr12983904pgb.499.1643063020650; Mon, 24 Jan 2022 14:23:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063020; cv=none; d=google.com; s=arc-20160816; b=hvtuToUv1plE7ZaVZSxKzEBjrt0c0C7NBMjwWSFdWelxNbTX+a8AtO8SvSoHmhNE9Z v3fw22TorR/waCom8TWgYiiqBVDm0DKDKenAmDxFtl/+H5HMZqv1gN1UE1QfBPNsrzs5 fn/8qM6xB0hZg9vcKHFJXMrN5iPM/qlziazqd9wjxzVwaV743oR2W8sb238/EGsiKkEb 3dGvx044So32Eohr1yrAkYAfc2ihEo6fIQvlHwLuzVpAO2xLDtKM40+R6eUYQPfsfnUM 2QaynMhSxIx4asPmQqrv6L8rl44H+vTxzLkjo5J/vpXqysvd2Bfu+BTdOxmgjKlfP72D loGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5OUf9RhekKE6/ovoS6ldnwgJxj9QZjsw/njUGLEtVy8=; b=dw8DNJ4J8C6FpTUhzRo5xo2vDoFpyvdXJSQG9X5atJZ+65e5VAo/LnePDhvDQKgiyI SHyBqMLLAmfUhsS4NN1bHk2CaZv3sFWk/htBVXHa/F7ZpniaI4Ba++jtuUYUUkFWzXM6 X09w/cHcQcsQMdITixyjFGYMJXzhON71sE9o55ilXpk20xClyW+4Mx5rn7ydJKAcb6dC rTU+G6B1qWPYfS6XRnSuVreGQaXZcibGrjWjMPIqHkpCuNp/tnvbotCzRX9Bku9plQz3 +uJ3STiHxjV7mex4ianUAcUSbHKg06Y3R/4d9YPZqlRcwgGCckzxeoXaairGHisCjcFd nZtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HwknhRKk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l71si11858352pge.724.2022.01.24.14.23.28; Mon, 24 Jan 2022 14:23:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HwknhRKk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1580868AbiAXWPF (ORCPT + 99 others); Mon, 24 Jan 2022 17:15:05 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:42470 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1452896AbiAXV1X (ORCPT ); Mon, 24 Jan 2022 16:27:23 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F21D2B812A7; Mon, 24 Jan 2022 21:27:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25F9AC340E4; Mon, 24 Jan 2022 21:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059636; bh=VugHGI8+6S85HjqW94JyGeLrIidA8ZW1E+7xFGmNbvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HwknhRKko4gRgnqWGES8sS/o3XUOfF0FeWg/QLttp1YG+Dnl3kOUJyB0xmjkP5hnj EMAAvrceKAeQ62XG4sh3aJjhPAtKvaKkp0y/6zQ2fynfsl4fNTj5bF+ZR4MrxUx3yd V/shXpUso9Ocw/1MzOTd9iOZ3ksblXJnUQTMyf3o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wolfram Sang , Biju Das , Ulf Hansson , Sasha Levin Subject: [PATCH 5.16 0655/1039] mmc: tmio: reinit card irqs in reset routine Date: Mon, 24 Jan 2022 19:40:44 +0100 Message-Id: <20220124184147.379482173@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Biju Das [ Upstream commit e315b1f3a170f368da5618f8a598e68880302ed1 ] Refactor the code so that card detect irqs are always reenabled after a reset. This avoids doing it manually all over the code or forgetting to do this in the future. Reported-by: Wolfram Sang Signed-off-by: Biju Das [wsa: added a comment when 'native_hotplug' has to be set] Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20211103122646.64422-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/tmio_mmc_core.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index e2affa52ef469..a5850d83908be 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -960,14 +960,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) case MMC_POWER_OFF: tmio_mmc_power_off(host); /* For R-Car Gen2+, we need to reset SDHI specific SCC */ - if (host->pdata->flags & TMIO_MMC_MIN_RCAR2) { - host->reset(host); - - if (host->native_hotplug) - tmio_mmc_enable_mmc_irqs(host, - TMIO_STAT_CARD_REMOVE | - TMIO_STAT_CARD_INSERT); - } + if (host->pdata->flags & TMIO_MMC_MIN_RCAR2) + tmio_mmc_reset(host); host->set_clock(host, 0); break; @@ -1175,6 +1169,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host) if (mmc_can_gpio_cd(mmc)) _host->ops.get_cd = mmc_gpio_get_cd; + /* must be set before tmio_mmc_reset() */ _host->native_hotplug = !(mmc_can_gpio_cd(mmc) || mmc->caps & MMC_CAP_NEEDS_POLL || !mmc_card_is_removable(mmc)); @@ -1295,10 +1290,6 @@ int tmio_mmc_host_runtime_resume(struct device *dev) if (host->clk_cache) host->set_clock(host, host->clk_cache); - if (host->native_hotplug) - tmio_mmc_enable_mmc_irqs(host, - TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT); - tmio_mmc_enable_dma(host, true); return 0; -- 2.34.1