From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
To: Xia Fukun <xiafukun@huawei.com>,
yoshihiro.shimoda.uh@renesas.com, vkoul@kernel.org,
kishon@kernel.org, geert+renesas@glider.be,
magnus.damm@gmail.com, horms+renesas@verge.net.au,
fabrizio.castro@bp.renesas.com,
Greg KH <gregkh@linuxfoundation.org>
Cc: linux-renesas-soc@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>,
stable@vger.kernel.org,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
"tanghui (C)" <tanghui20@huawei.com>
Subject: Re: [PATCH RESEND v3 3/5] phy: renesas: rcar-gen3-usb2: Lock around hardware registers and driver data
Date: Wed, 3 Jun 2026 16:38:31 +0300 [thread overview]
Message-ID: <2e62a5af-06f5-4a11-80f1-81c62f9b2311@tuxon.dev> (raw)
In-Reply-To: <e49fc109-41a2-449f-a232-d8beac2c5e08@huawei.com>
On 6/3/26 16:22, Xia Fukun wrote:
> On 5/7/2025 8:50 PM, Claudiu wrote:
>
>> @@ -348,6 +349,8 @@ static ssize_t role_store(struct device *dev, struct device_attribute *attr,
>> bool is_b_device;
>> enum phy_mode cur_mode, new_mode;
>>
>> + guard(spinlock_irqsave)(&ch->lock);
>> +
>> if (!ch->is_otg_channel || !rcar_gen3_is_any_otg_rphy_initialized(ch))
>> return -EIO;
>>
>> @@ -415,7 +418,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(ch->obint_enable_bits, usb2_base + USB2_OBINTEN);
> The fix for the rcar_gen3_init_otg function has not been backported to
> the 5.10-stable branch, which leads to a "scheduling while atomic" bug
> in that branch:
>
> rcar_gen3_phy_usb2_init() ← phy_init() callback
> → guard(spinlock_irqsave)(&ch->lock) ← acquires spinlock, disabling preemption + IRQs
> → rcar_gen3_init_otg(ch)
> → msleep(20) ← BUG: scheduling while atomic!
>
> The patch for 5.10 is available at the following link:
> https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?
> h=linux-5.10.y&id=0f86a559900fbe96af08a3a226a86fac27b02b8f
>
> Perhaps the stable patch for the 5.10 branch needs to be updated to
> fix this serious bug?
Sasha applied today the patch at [1] to solve this problem on v5.10.
Thank you,
Claudiu
[1]
https://lore.kernel.org/all/20260501225859.504868-1-nobuhiro.iwamatsu.x90@mail.toshiba/
next prev parent reply other threads:[~2026-06-03 13:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 12:50 [PATCH RESEND v3 0/5] phy: renesas: rcar-gen3-usb2: Fixes for Renesas RZ/G3S Claudiu
2025-05-07 12:50 ` [PATCH RESEND v3 1/5] phy: renesas: rcar-gen3-usb2: Fix role detection on unbind/bind Claudiu
2025-05-07 12:50 ` [PATCH RESEND v3 2/5] phy: renesas: rcar-gen3-usb2: Move IRQ request in probe Claudiu
2025-05-07 12:50 ` [PATCH RESEND v3 3/5] phy: renesas: rcar-gen3-usb2: Lock around hardware registers and driver data Claudiu
2026-06-03 13:22 ` Xia Fukun
2026-06-03 13:38 ` Claudiu Beznea [this message]
2025-05-07 12:50 ` [PATCH RESEND v3 4/5] phy: renesas: rcar-gen3-usb2: Assert PLL reset on PHY power off Claudiu
2025-05-07 12:50 ` [PATCH RESEND v3 5/5] phy: renesas: rcar-gen3-usb2: Set timing registers only once Claudiu
2025-05-14 11:31 ` [PATCH RESEND v3 0/5] phy: renesas: rcar-gen3-usb2: Fixes for Renesas RZ/G3S Vinod Koul
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=2e62a5af-06f5-4a11-80f1-81c62f9b2311@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=fabrizio.castro@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=horms+renesas@verge.net.au \
--cc=kishon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=stable@vger.kernel.org \
--cc=tanghui20@huawei.com \
--cc=vkoul@kernel.org \
--cc=xiafukun@huawei.com \
--cc=yoshihiro.shimoda.uh@renesas.com \
/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®