Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4162337pxk; Tue, 8 Sep 2020 12:16:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWuTS77jNDmnRbgBJhST/cZERaxuTnLXkBJKm3uUnH0AkiNOFi0ne9FcE6G9SXDBm00ynn X-Received: by 2002:a17:906:1b04:: with SMTP id o4mr28820848ejg.332.1599592582844; Tue, 08 Sep 2020 12:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599592582; cv=none; d=google.com; s=arc-20160816; b=xQ+tj5mu0nbKwuRMr2zyncHq06tITm95jBUu2FSR9GBDlWGxcsUwrtKWpFQrfZa3Iy /cIZokl/l6ylljRVmIDitte9XCc9y5syGakUS6neqkKm7HKylyDzq7UxC51jNdgFz8Yl p7YA6MWOeKKYx6A/TGg4TwUmpJu7Te78PUkXvN4egnankiaaQbRAEcU0F4mBkAqRslsn fKTydvObAvR5pkEEJyK7u/khyg/+doBRYJ6q7UMJtzUyOtz/fMmFFaLynJMp5Xryqj9T TBZ4M+gu9eaABPuoIvmyglRXMVE+t+iyA+BNL8z6egyYmBXhTm0eRWKOAVseQ0SYIvFT cdIg== 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=V5evIq6udN9C9FLMlab9OmTkfY322y1s4V9U1iewGeg=; b=fIExeqsAYb5U2D5AyhJze8wXu3dvyHv7igsUYHqY7QBf19cntS65x+EZUx6REM3cZ7 48o2TN0f75RX6sAUdeOaubT2jz8lvziS+71QOTOvrpSnT/pdll3DmGv2U1/8/zktUsqz evBB31fdl10ne9pU107B3zQHN1tH5fOkbWtS/w/xfLst8Mv2K4YyiA0KVgpAiWHsIjIl w77ItQjaYPhUIlmor96KCWx/pvNYj2R+VnFdtGkTBqxw1w0FipXHgQZYAC/lxaeoxcVt 4Zhx+Ku/gyRI9xeur4wQ/rS3kyCrg89lt/u/MTCDXY/cIecwAGKHy8TRP8C/7koDjA7Q ErVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LlbG6Ltm; 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=fail (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 ga23si12249064ejb.691.2020.09.08.12.16.00; Tue, 08 Sep 2020 12:16:22 -0700 (PDT) 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=@kernel.org header.s=default header.b=LlbG6Ltm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731234AbgIHTLy (ORCPT + 99 others); Tue, 8 Sep 2020 15:11:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:53538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731223AbgIHQFW (ORCPT ); Tue, 8 Sep 2020 12:05:22 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 F046722583; Tue, 8 Sep 2020 15:45:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599579959; bh=iPx38k3mMcCJ+riztXVJPgkP4xb3An7I8mthAfHsqDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LlbG6LtmsmMQ+fBxhQ0XNZ5OXK2/lbT5BDJ72HpdyUz2TYkGPELoNB2mFRk3Ev6Ka DcqiUCFKjv+E2v9U3WhklD8UR5SM3mKByN688TQT1Mhf/uIEG1MQkxWCyVLMyICgnW Ij8zZafaUg+vn4JmQbH1e8YPKkSYY/AaK1vpxkyY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Veerabhadrarao Badiganti , Ulf Hansson Subject: [PATCH 5.4 102/129] mmc: cqhci: Add cqhci_deactivate() Date: Tue, 8 Sep 2020 17:25:43 +0200 Message-Id: <20200908152234.933730101@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152229.689878733@linuxfoundation.org> References: <20200908152229.689878733@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Hunter commit 0ffa6cfbd94982e6c028a8924b06a96c1b91bed8 upstream. Host controllers can reset CQHCI either directly or as a consequence of host controller reset. Add cqhci_deactivate() which puts the CQHCI driver into a state that is consistent with that. Signed-off-by: Adrian Hunter Signed-off-by: Veerabhadrarao Badiganti Link: https://lore.kernel.org/r/1583503724-13943-2-git-send-email-vbadigan@codeaurora.org Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/cqhci.c | 6 +++--- drivers/mmc/host/cqhci.h | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) --- a/drivers/mmc/host/cqhci.c +++ b/drivers/mmc/host/cqhci.c @@ -299,16 +299,16 @@ static void __cqhci_disable(struct cqhci cq_host->activated = false; } -int cqhci_suspend(struct mmc_host *mmc) +int cqhci_deactivate(struct mmc_host *mmc) { struct cqhci_host *cq_host = mmc->cqe_private; - if (cq_host->enabled) + if (cq_host->enabled && cq_host->activated) __cqhci_disable(cq_host); return 0; } -EXPORT_SYMBOL(cqhci_suspend); +EXPORT_SYMBOL(cqhci_deactivate); int cqhci_resume(struct mmc_host *mmc) { --- a/drivers/mmc/host/cqhci.h +++ b/drivers/mmc/host/cqhci.h @@ -230,7 +230,11 @@ irqreturn_t cqhci_irq(struct mmc_host *m int data_error); int cqhci_init(struct cqhci_host *cq_host, struct mmc_host *mmc, bool dma64); struct cqhci_host *cqhci_pltfm_init(struct platform_device *pdev); -int cqhci_suspend(struct mmc_host *mmc); +int cqhci_deactivate(struct mmc_host *mmc); +static inline int cqhci_suspend(struct mmc_host *mmc) +{ + return cqhci_deactivate(mmc); +} int cqhci_resume(struct mmc_host *mmc); #endif