Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@nabladev.com>
To: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: stable@vger.kernel.org, gregkh@linuxfoundation.org,
	cip-dev@lists.cip-project.org,
	Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>,
	Sasha Levin <sashal@kernel.org>
Subject: Re: [cip-dev] [PATCH for 5.10.y] phy: renesas: rcar-gen3-usb2: Fix the use of msleep during spinlock
Date: Mon, 4 May 2026 11:18:23 +0200	[thread overview]
Message-ID: <afhkX2Ys2BG1gnqy@duo.ucw.cz> (raw)
In-Reply-To: <20260501225859.504868-1-nobuhiro.iwamatsu.x90@mail.toshiba>

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

Hi!

> From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
> 
> This fixes an issue caused by the use of msleep during spinlock.
> In the original commit, msleep was changed to mdelay, but this fix was not
> carried over during the backport to 5.10.y tree.

Doing this as a quick fix is probably okay, but this should not be
final version.

You are right that msleep inside spinlock will blow up immediately:

> ```
> [   62.677594] BUG: scheduling while atomic: kworker/1:2/126/0x00000002
> [   62.683957] Modules linked in:

But mdelay for 20 msec inside irqsave spinlock is borderline
unacceptable, too.

I believe we'll need Renesas to analyze/fix this properly after the
CVE emergency is done.

This fix is good for now, but better fix is needed.

Claudiu, are you right person for this, or should we cc someone else?

Best regards,
								Pavel


> index 5166a115879ea..90f2a0e5b2aa0 100644
> --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
> +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
> @@ -386,7 +386,7 @@ static void rcar_gen3_init_otg(struct rcar_gen3_chan *ch)
>  	val = readl(usb2_base + USB2_ADPCTRL);
>  	writel(val | USB2_ADPCTRL_IDPULLUP, usb2_base + USB2_ADPCTRL);
>  
> -	msleep(20);
> +	mdelay(20);
>  
>  	writel(0xffffffff, usb2_base + USB2_OBINTSTA);
>  	writel(USB2_OBINT_BITS, usb2_base + USB2_OBINTEN);


-- 

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

  reply	other threads:[~2026-05-04  9:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 22:58 [PATCH for 5.10.y] phy: renesas: rcar-gen3-usb2: Fix the use of msleep during spinlock Nobuhiro Iwamatsu
2026-05-04  9:18 ` Pavel Machek [this message]
2026-05-04 11:13   ` [cip-dev] " Nobuhiro Iwamatsu
2026-05-05  8:40   ` Claudiu Beznea
2026-05-05  8:49     ` Claudiu Beznea
2026-05-05  8:53       ` Greg KH
2026-05-05 21:01         ` Pavel Machek

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=afhkX2Ys2BG1gnqy@duo.ucw.cz \
    --to=pavel@nabladev.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=iwamatsu@nigauri.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.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