The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Judith Mendez <jm@ti.com>
Cc: Ulf Hansson <ulfh@kernel.org>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-mmc@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] mmc: core: Add mmc_delay_us() for microsecond precision delays
Date: Sat, 25 Jul 2026 00:17:10 +0200	[thread overview]
Message-ID: <amPkAhf_LiXGjzC3@venus> (raw)
In-Reply-To: <20260722205701.372789-3-jm@ti.com>

[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]

Hi,

On Wed, Jul 22, 2026 at 03:57:00PM -0500, Judith Mendez wrote:
> Add mmc_delay_us() to support microsecond-granularity delays needed
> in MMC framework. It uses 25% margin consistent with  mmc_delay() for
> timing flexibility.
> 
> Signed-off-by: Judith Mendez <jm@ti.com>
> ---
> Changes since v1:
> - add patch 2/3
> ---

Looks like you should just use fsleep() from <linux/delay.h>.

Greetings,

-- Sebastian

>  drivers/mmc/core/core.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
> index a028b48be1644..55e9fb3bab9f7 100644
> --- a/drivers/mmc/core/core.h
> +++ b/drivers/mmc/core/core.h
> @@ -73,6 +73,19 @@ static inline void mmc_delay(unsigned int ms)
>  		msleep(ms);
>  }
>  
> +static inline void mmc_delay_us(unsigned int us)
> +{
> +	if (us < 1000) {
> +		usleep_range(us, us + (us >> 2));
> +	} else {
> +		unsigned int rem_us = us % 1000;
> +
> +		msleep(us / 1000);
> +		if (rem_us)
> +			usleep_range(rem_us, rem_us + (rem_us >> 2));
> +	}
> +}
> +
>  void mmc_rescan(struct work_struct *work);
>  void mmc_start_host(struct mmc_host *host);
>  void __mmc_stop_host(struct mmc_host *host);
> -- 
> 2.54.0
> 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-07-24 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 20:56 [PATCH v2 0/3] mmc: Add power_off_delay_us support Judith Mendez
2026-07-22 20:56 ` [PATCH v2 1/3] dt-bindings: mmc: Add power-off-delay-us property Judith Mendez
2026-07-22 20:57 ` [PATCH v2 2/3] mmc: core: Add mmc_delay_us() for microsecond precision delays Judith Mendez
2026-07-24 22:17   ` Sebastian Reichel [this message]
2026-07-22 20:57 ` [PATCH v2 3/3] mmc: core: Add power-off-delay-us support Judith Mendez

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=amPkAhf_LiXGjzC3@venus \
    --to=sebastian.reichel@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jm@ti.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=ulfh@kernel.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