Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp955284pxk; Mon, 31 Aug 2020 06:10:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCU/d6JimnAlhricDbUxT87zDiv3LWeittB6YRLMm+KusKYO1WUIp7E7SBNqtP8hufWSh2 X-Received: by 2002:a17:906:2356:: with SMTP id m22mr1074721eja.452.1598879419252; Mon, 31 Aug 2020 06:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598879419; cv=none; d=google.com; s=arc-20160816; b=lg8g7WYklRbNOKxXI1F6yhaOO1klfb+P7Q5iTiR7bg0fXQZodGX+TDf+aU1j3nPm30 7tmY1SPRe3ZUaRwlcfYFlkQI/3kvbiO0M5nBULTD9oBq0l+SOjz2xGIljh2HFZ20RdkE eDXToviHm8rIb1XaJK46Kr6dmzBIJcUhd2dLEEVjPuq/CqnQyP6RsiumgW6IVdbh5RPr qtjVFRB9J3HSd1uiiHzUvvlQsN0tDKg28YYXHW/Xt0729ZR+SfXmEeLi3/dbqDTZdGoc +jCEm1u4DxJA6A7b+Jr9+xmt/QXN+nbFh/atPcljO+iB1J/VCKFM9W4MQ8oqs5ZT0E2u Q/IA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=o8M6PYIvEE959GXAP6/tF386/mTp2XQdpp3nAPwlb3I=; b=q9XRNzREL0NETx2cqUy9Bk9vzQoDdHzYZz2nn314DwtBu/PJB5nQ0u01Sj6cKSZ3Mm ywszkCaRvgb4bLbC2sDGl5F82XXhh2a69xrIlRCNq4DRb4gZ3OO0hHP8YUZd3+nLQsjX XrWyeF2xqHERbeG7LSJrn2QJn9m+NvGo6micmrCU11ptASZ5523dDgr1WZsjzk1FvFHh oFPCu4KOdsr0Giu+ZgSjRCua7eDcIa236clrMWOBHZU84ZEKb949zWnct3N0L3lp61oh 3mcZgNSxmoN7PWWwrbjJIryUANhHDKyWk+xqsMkbCjXZE4nE+rH/FvdPw6PLFrkZhm/K BEww== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si4830656edt.479.2020.08.31.06.09.55; Mon, 31 Aug 2020 06:10:19 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727799AbgHaNJK (ORCPT + 99 others); Mon, 31 Aug 2020 09:09:10 -0400 Received: from mga18.intel.com ([134.134.136.126]:21885 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726984AbgHaNIn (ORCPT ); Mon, 31 Aug 2020 09:08:43 -0400 IronPort-SDR: epgQ2NisbhrzCux6S+AsxqKKo0r2JuYgVrgHJoA52YXrxBLO+RTr2BoGjUcU63+LBM75XG59qL 3rYMPH2nMGzA== X-IronPort-AV: E=McAfee;i="6000,8403,9729"; a="144643457" X-IronPort-AV: E=Sophos;i="5.76,375,1592895600"; d="scan'208";a="144643457" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2020 06:08:34 -0700 IronPort-SDR: EohOby+7M8jiGk+t8vzztTtibrfD4QbKSTQq1hGxL18iqul7w31+Wm23G0lKBK+P+i0d3SJVq3 VWCHzD9m0qhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,375,1592895600"; d="scan'208";a="501331763" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.73]) ([10.237.72.73]) by fmsmga006.fm.intel.com with ESMTP; 31 Aug 2020 06:08:20 -0700 Subject: Re: [PATCH v1 1/2] mmc: cqhci: add new cqhci_host_ops pre_enable() and post_disable() To: Chun-Hung Wu , mirq-linux@rere.qmqm.pl, Jonathan Hunter , Al Cooper , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Andy Gross , Bjorn Andersson , Michal Simek , Thierry Reding , Chaotian Jing , Mao Yong , Ulf Hansson , Rob Herring , Mark Rutland , Matthias Brugger , Linus Walleij , Pavel Machek , Kate Stewart , Greg Kroah-Hartman , Martin Blumenstingl , Pan Bian , Thomas Gleixner , Allison Randal , Mathieu Malaterre , Asutosh Das , Ritesh Harjani , Stanley Chu , Kuohong Wang Cc: kernel-team@android.com, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, wsd_upstream@mediatek.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org References: <1598520783-25250-1-git-send-email-chun-hung.wu@mediatek.com> <1598520783-25250-2-git-send-email-chun-hung.wu@mediatek.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <9c0dd5b4-5d9e-e559-81f5-fbf6024b67bb@intel.com> Date: Mon, 31 Aug 2020 16:07:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1598520783-25250-2-git-send-email-chun-hung.wu@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/08/20 12:33 pm, Chun-Hung Wu wrote: > Add pre_enable() and post_disable() for cqhci_host_ops. > Add hook functions before cqhci enable and > after cqhci disable for platforms need them. > > Signed-off-by: Chun-Hung Wu Acked-by: Adrian Hunter > --- > drivers/mmc/host/cqhci.c | 6 ++++++ > drivers/mmc/host/cqhci.h | 2 ++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/mmc/host/cqhci.c b/drivers/mmc/host/cqhci.c > index cfa87df..697fe40 100644 > --- a/drivers/mmc/host/cqhci.c > +++ b/drivers/mmc/host/cqhci.c > @@ -376,6 +376,9 @@ static void cqhci_off(struct mmc_host *mmc) > else > pr_debug("%s: cqhci: CQE off\n", mmc_hostname(mmc)); > > + if (cq_host->ops->post_disable) > + cq_host->ops->post_disable(mmc); > + > mmc->cqe_on = false; > } > > @@ -580,6 +583,9 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq) > __cqhci_enable(cq_host); > > if (!mmc->cqe_on) { > + if (cq_host->ops->pre_enable) > + cq_host->ops->pre_enable(mmc); > + > cqhci_writel(cq_host, 0, CQHCI_CTL); > mmc->cqe_on = true; > pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc)); > diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h > index 4377001..89bf6ad 100644 > --- a/drivers/mmc/host/cqhci.h > +++ b/drivers/mmc/host/cqhci.h > @@ -206,6 +206,8 @@ struct cqhci_host_ops { > void (*disable)(struct mmc_host *mmc, bool recovery); > void (*update_dcmd_desc)(struct mmc_host *mmc, struct mmc_request *mrq, > u64 *data); > + void (*pre_enable)(struct mmc_host *mmc); > + void (*post_disable)(struct mmc_host *mmc); > }; > > static inline void cqhci_writel(struct cqhci_host *host, u32 val, int reg) >