]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
phy: renesas: rcar-gen3-usb2: Set timing registers only once
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Wed, 7 May 2025 12:50:32 +0000 (15:50 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:36:57 +0000 (14:36 +0200)
commit 86e70849f4b2b4597ac9f7c7931f2a363774be25 upstream.

phy-rcar-gen3-usb2 driver exports 4 PHYs. The timing registers are common
to all PHYs. There is no need to set them every time a PHY is initialized.
Set timing register only when the 1st PHY is initialized.

Fixes: f3b5a8d9b50d ("phy: rcar-gen3-usb2: Add R-Car Gen3 USB2 PHY driver")
Cc: stable@vger.kernel.org
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://lore.kernel.org/r/20250507125032.565017-6-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/phy/renesas/phy-rcar-gen3-usb2.c

index c0802152f30bc4c306c4bac9a3b7f1af2a02e8a6..ea01a121b8fc51b14e133727403216c012f9f5a7 100644 (file)
@@ -429,8 +429,11 @@ static int rcar_gen3_phy_usb2_init(struct phy *p)
        val = readl(usb2_base + USB2_INT_ENABLE);
        val |= USB2_INT_ENABLE_UCOM_INTEN | rphy->int_enable_bits;
        writel(val, usb2_base + USB2_INT_ENABLE);
-       writel(USB2_SPD_RSM_TIMSET_INIT, usb2_base + USB2_SPD_RSM_TIMSET);
-       writel(USB2_OC_TIMSET_INIT, usb2_base + USB2_OC_TIMSET);
+
+       if (!rcar_gen3_is_any_rphy_initialized(channel)) {
+               writel(USB2_SPD_RSM_TIMSET_INIT, usb2_base + USB2_SPD_RSM_TIMSET);
+               writel(USB2_OC_TIMSET_INIT, usb2_base + USB2_OC_TIMSET);
+       }
 
        /* Initialize otg part */
        if (channel->is_otg_channel) {