mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@rock-chips.com>
To: "ping.gao" <ping.gao@samsung.com>
Cc: shawn.lin@rock-chips.com, jh80.chung@samsung.com,
	linux-mmc@vger.kernel.org, ulf.hansson@linaro.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: dw_mmc: Use pre_request & post_request_end helper
Date: Tue, 9 Dec 2025 15:03:34 +0800	[thread overview]
Message-ID: <1eb94100-32eb-45fa-9dd9-6c5c96d9c0e4@rock-chips.com> (raw)
In-Reply-To: <20251209064910.3643039-1-ping.gao@samsung.com>

On 2025/12/09 Tuesday 14:49, ping.gao wrote:
> Use vendor drv function to let other vendor can add some vendor function
> before and after request
> 

Without a real user, these are dead code.
Please add a driver using it, and explain how the variant driver use it.

> Signed-off-by: ping.gao <ping.gao@samsung.com>
> ---
>   drivers/mmc/host/dw_mmc.c | 7 ++++++-
>   drivers/mmc/host/dw_mmc.h | 2 ++
>   2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index c5db92bbb094..5f1353b7f8d6 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1416,6 +1416,7 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>   {
>   	struct dw_mci_slot *slot = mmc_priv(mmc);
>   	struct dw_mci *host = slot->host;
> +	const struct dw_mci_drv_data *drv_data = host->drv_data;
>   
>   	WARN_ON(slot->mrq);
>   
> @@ -1430,7 +1431,8 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>   		mmc_request_done(mmc, mrq);
>   		return;
>   	}
> -
> +	if (drv_data && drv_data->pre_request)
> +		drv_data->pre_request(host);
>   	spin_lock_bh(&host->lock);
>   
>   	dw_mci_queue_request(host, slot, mrq);
> @@ -1897,6 +1899,7 @@ static void dw_mci_request_end(struct dw_mci *host, struct mmc_request *mrq)
>   {
>   	struct dw_mci_slot *slot;
>   	struct mmc_host	*prev_mmc = host->slot->mmc;
> +	const struct dw_mci_drv_data *drv_data = host->drv_dat
>   
>   	WARN_ON(host->cmd || host->data);
>   
> @@ -1921,6 +1924,8 @@ static void dw_mci_request_end(struct dw_mci *host, struct mmc_request *mrq)
>   
>   	spin_unlock(&host->lock);
>   	mmc_request_done(prev_mmc, mrq);
> +	if (drv_data && drv_data->post_request_end)
> +		drv_data->post_request_end(host);
>   	spin_lock(&host->lock);
>   }
>   
> diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
> index 648b4a5641bf..6c258e0865e7 100644
> --- a/drivers/mmc/host/dw_mmc.h
> +++ b/drivers/mmc/host/dw_mmc.h
> @@ -618,5 +618,7 @@ struct dw_mci_drv_data {
>   					  unsigned int timeout_ns);
>   	u32		(*get_drto_clks)(struct dw_mci *host);
>   	void		(*hw_reset)(struct dw_mci *host);
> +	void		(*pre_request)(struct dw_mci *host);
> +	void		(*post_request_end)(struct dw_mci *host);
>   };
>   #endif /* _DW_MMC_H_ */


  reply	other threads:[~2025-12-09  9:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20251209064525epcas5p4904259a2a7fb971c077bfa03acce8c79@epcas5p4.samsung.com>
2025-12-09  6:49 ` ping.gao
2025-12-09  7:03   ` Shawn Lin [this message]
2025-12-09  9:46   ` Christoph Hellwig
2025-12-09 18:05   ` kernel test robot
2025-12-09 18:57   ` kernel test robot
     [not found] <CGME20251210022622epcas5p3faca823fc4bf50267e4b660d4776cb1d@epcas5p3.samsung.com>
2025-12-10  2:30 ` ping.gao
2025-12-10 10:45   ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1eb94100-32eb-45fa-9dd9-6c5c96d9c0e4@rock-chips.com \
    --to=shawn.lin@rock-chips.com \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ping.gao@samsung.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®