From: Marek Vasut <marek.vasut@mailbox.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Bjorn Helgaas" <helgaas@kernel.org>,
linux-pci@vger.kernel.org,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Magnus Damm" <magnus.damm@gmail.com>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] PCI: rcar-gen4: Fix inverted break condition in PHY initialization
Date: Wed, 17 Sep 2025 15:44:16 +0200 [thread overview]
Message-ID: <bf385367-bec7-432c-af2b-1c1bd269547e@mailbox.org> (raw)
In-Reply-To: <CAMuHMdXh0rxpLXW+3yCP7hZNwacVcuc3Wp5t8CiDJ2HE=P+OiQ@mail.gmail.com>
On 9/17/25 10:00 AM, Geert Uytterhoeven wrote:
Hello Geert,
>> --- a/drivers/clk/renesas/renesas-cpg-mssr.c
>> +++ b/drivers/clk/renesas/renesas-cpg-mssr.c
>> @@ -688,12 +688,14 @@ static int cpg_mssr_reset(struct
>> reset_controller_dev *rcdev,
>>
>> /* Reset module */
>> writel(bitmask, priv->pub.base0 + priv->reset_regs[reg]);
>> + readl(priv->pub.base0 + priv->reset_regs[reg]);
>>
>> /* Wait for at least one cycle of the RCLK clock (@ ca. 32 kHz) */
>> udelay(35);
>>
>> /* Release module from reset state */
>> writel(bitmask, priv->pub.base0 + priv->reset_clear_regs[reg]);
>> + readl(priv->pub.base0 + priv->reset_clear_regs[reg]);
>>
>> return 0;
>> }
>> @@ -708,6 +710,7 @@ static int cpg_mssr_assert(struct
>> reset_controller_dev *rcdev, unsigned long id)
>> dev_dbg(priv->dev, "assert %u%02u\n", reg, bit);
>>
>> writel(bitmask, priv->pub.base0 + priv->reset_regs[reg]);
>> + readl(priv->pub.base0 + priv->reset_regs[reg]);
>> return 0;
>> }
>>
>> @@ -722,6 +725,7 @@ static int cpg_mssr_deassert(struct
>> reset_controller_dev *rcdev,
>> dev_dbg(priv->dev, "deassert %u%02u\n", reg, bit);
>>
>> writel(bitmask, priv->pub.base0 + priv->reset_clear_regs[reg]);
>> + readl(priv->pub.base0 + priv->reset_clear_regs[reg]);
>> return 0;
>> }
>>
>
> Yes, reading the reset registers after writing works, too.
>
> I just noticed the module reset operation in the R-Car V4H Hardware
> User's Manual has changed from R-Car Gen2/Gen3, and is now more complex,
> with three different reset types, depending on the module to be reset
> (see Section 9.3 "Operation" subsection (2) "Software Reset").
> The most striking difference is that there is no more mention of
> a single delay of 1 RCLK cycle (cfr. the udelay(35) above), but of
> much longer delays of 1 ms.
>
> As drivers/pci/controller/dwc/pcie-rcar-gen4.c does not call the
> combined reset_control_reset() , but uses separate
> reset_control_assert() and reset_control_deassert() calls, the PCIe
> driver itself is responsible for enforcing this 1 ms delay.
Shouldn't we patch the reset driver and insert unconditional 1ms delay
into reset_assert() callback ?
> Which is exactly what your introduction of mdelay(1) (just after the
> out-of-context call to reset_control_deassert()) does, so I believe
> we're all set?
No, I do not think so. Figure 9.3.2 Software Reset flow (B) on page 585
does NOT describe 1ms delay after write into SRSTCLR register. It does
describe 1ms delay after write into SRCR register. That means, we need
1ms delay after reset_control_assert(), but it does NOT mean we need 1ms
delay after reset_control_deassert() . That means the issue remains
unexplained ?
next prev parent reply other threads:[~2025-09-17 13:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-15 23:58 [PATCH] PCI: rcar-gen4: Fix inverted break condition in PHY initialization Marek Vasut
2025-09-16 9:59 ` Geert Uytterhoeven
2025-09-16 13:39 ` Marek Vasut
2025-09-16 13:57 ` Geert Uytterhoeven
2025-09-16 16:31 ` Marek Vasut
2025-09-16 17:13 ` Bjorn Helgaas
2025-09-16 17:39 ` Marek Vasut
2025-09-16 18:15 ` Bjorn Helgaas
2025-09-16 22:09 ` Marek Vasut
2025-09-17 8:00 ` Geert Uytterhoeven
2025-09-17 13:44 ` Marek Vasut [this message]
2025-09-17 7:23 ` Geert Uytterhoeven
2025-09-18 3:16 ` Marek Vasut
2025-09-22 10:10 ` Geert Uytterhoeven
2025-09-22 15:17 ` Marek Vasut
2025-09-22 15:33 ` Geert Uytterhoeven
2025-09-22 15:49 ` Marek Vasut
2025-09-23 7:04 ` Geert Uytterhoeven
2025-09-25 16:36 ` Manivannan Sadhasivam
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=bf385367-bec7-432c-af2b-1c1bd269547e@mailbox.org \
--to=marek.vasut@mailbox.org \
--cc=bhelgaas@google.com \
--cc=geert@linux-m68k.org \
--cc=helgaas@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mani@kernel.org \
--cc=robh@kernel.org \
--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