Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3675482pxb; Mon, 24 Jan 2022 15:05:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/I25XaSIMzE0aG6vtbOUqwge+ByqNcOfEq1jaw2Q9PiJpeu5bjx3kExBsFP7fYf5CdpOr X-Received: by 2002:a17:902:9a4b:b0:14a:b17e:b2a5 with SMTP id x11-20020a1709029a4b00b0014ab17eb2a5mr16309562plv.105.1643065509125; Mon, 24 Jan 2022 15:05:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643065509; cv=none; d=google.com; s=arc-20160816; b=aOB8uPCjdwsVTpo6o6gzkOYbkFy8xP3Xbz1U0X6bqpDRd+chvHlAaVF+Nyqn4YQ5vS sLafTHUzO+WyyqMufY270RApxmVVisUkHI4ltJ7PrSsiZhcMTxS4Q9K5sOI8HcAUPHKP Gm034QuYi2F6sB/ORZDPrOpdhf9r0A7iO4IrkMrOvwN1nCyW4WtDFm4DIL3bxkx9SstH NmxxOLuhve+vlc8aSvvfHAX1dbUpJMdWguDPV5Uec85TIBGD02/5U6EX+RZg4J7rvenV Dnm0kJ6nmJdpp0r2GuNoqcDb1/LRHok1Z5qGhPcpjHl8RRHgeygOMuwufhaJ3Jzqtf0A gBEg== 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=cgNCCw/+e61vYUIgXtJ46MtniykXwktuWb00Ha7Nn/JLzXUMuiK9bSSRwXQB8FN1Wh XKw4xfSERoT2brwQfHeR+yhWewAG8ibPJ0g3MbZryFZ3D23Fd840aade+da7TrDx7DD4 2cY6DimUGLPTj3plOkBCzuxpEosMeyc+5olKEniu3EEJg5ld12sK5gyDXxEFw7EbUOIT uL5WNcXSFoOQTXowDEk6uX5hhcyJpp2P3UsbHVFhjSvY0O7CrZJMWy0FF0rRhxs3faev 2GIFL+9rqE35gjoIvUoNXqBpnGfI0zBpJklZhWX8if8YqsIKQFBB0q2PDDr/UZK66nZo Ggfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SQGFqabC; 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 i10si15122793pgp.867.2022.01.24.15.04.56; Mon, 24 Jan 2022 15:05:09 -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=SQGFqabC; 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 S1842327AbiAXXBl (ORCPT + 99 others); Mon, 24 Jan 2022 18:01:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1458123AbiAXVzI (ORCPT ); Mon, 24 Jan 2022 16:55:08 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 642F7C07E2AD; Mon, 24 Jan 2022 12:37:30 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 0232A61550; Mon, 24 Jan 2022 20:37:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA80EC340E7; Mon, 24 Jan 2022 20:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056649; bh=VugHGI8+6S85HjqW94JyGeLrIidA8ZW1E+7xFGmNbvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQGFqabCOeYAgfuEu0BnHnje+wd8P6kKfXz+r4Fhsraw573iBayvtSPlAxCF6Bq+1 Pf7XHKaQLgK88ZJugI0YY7RYNr/5M6wlfUtC83b+ayVBBTF+bDTHTwVvDYY08qkdVG 1kJeYzdhXWHl8wXehxZ6QVjIWOSC27fdLyC4wSK8= 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.15 555/846] mmc: tmio: reinit card irqs in reset routine Date: Mon, 24 Jan 2022 19:41:12 +0100 Message-Id: <20220124184120.169660765@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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