From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C654C27C856; Tue, 27 May 2025 16:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748364307; cv=none; b=boxR+LvDccB9HVfGH4gi7YNGK7eaMIvHIqecDfeySV7K+bVutJSIRCibgDpCqLyntT6w+79nKTxemD2WuT9ygnQ8knKijxKXpYN8ZXYvAZ00KB4PHb8Vci9XCn/V3tTg5TLUYhA+0v6mSIcznMOwdoxx6dLY7tZBe1PNkRenscQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748364307; c=relaxed/simple; bh=ngFOig9UvFi3TKhWMKAXtEheLy//BFeLUG94+efoEy8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZMBWAQFAfuY9kcKZpMmFbarL8JS8Pz69JBsOTuXWuxod6dNGwh9ZztQOh0YbmcXoAj/bArTeiCbSGf88SmPGR4VEdu3kIeUXMedL/5/IGzgKaamJ6ryXNJl8E5nCGCjRzsp0xAIAktLLtq3uXnzdJSWZc+1zIo29EAtRhF4MrWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DZ3BBr3x; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="DZ3BBr3x" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EAC5C4CEED; Tue, 27 May 2025 16:45:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748364307; bh=ngFOig9UvFi3TKhWMKAXtEheLy//BFeLUG94+efoEy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DZ3BBr3xOtaxVcOQatoiMiwXPsPI+psg5yCvb0zxJkJEjLSRhnIL6L94jvc9XvzN9 XWv5SL/3wCyIGzoIGquo0BJ2u68jYMxZWg189noy4gv+ur4iwdd3uGyfEfGIqIze/R tEiTddkf7Yyx9CMiZKdYmmNKRGtK9iNBNVJSdLBs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yoshihiro Shimoda , Lad Prabhakar , Claudiu Beznea , Vinod Koul , Sasha Levin Subject: [PATCH 6.12 009/626] phy: renesas: rcar-gen3-usb2: Assert PLL reset on PHY power off Date: Tue, 27 May 2025 18:18:22 +0200 Message-ID: <20250527162445.435641092@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162445.028718347@linuxfoundation.org> References: <20250527162445.028718347@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Claudiu Beznea [ Upstream commit 9ce71e85b29eb63e48e294479742e670513f03a0 ] Assert PLL reset on PHY power off. This saves power. Fixes: f3b5a8d9b50d ("phy: rcar-gen3-usb2: Add R-Car Gen3 USB2 PHY driver") Cc: stable@vger.kernel.org Reviewed-by: Yoshihiro Shimoda Tested-by: Yoshihiro Shimoda Reviewed-by: Lad Prabhakar Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20250507125032.565017-5-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c index 188e903445aeb..b45aee8f59644 100644 --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c @@ -540,9 +540,17 @@ static int rcar_gen3_phy_usb2_power_off(struct phy *p) struct rcar_gen3_chan *channel = rphy->ch; int ret = 0; - scoped_guard(spinlock_irqsave, &channel->lock) + scoped_guard(spinlock_irqsave, &channel->lock) { rphy->powered = false; + if (rcar_gen3_are_all_rphys_power_off(channel)) { + u32 val = readl(channel->base + USB2_USBCTR); + + val |= USB2_USBCTR_PLL_RST; + writel(val, channel->base + USB2_USBCTR); + } + } + if (channel->vbus) ret = regulator_disable(channel->vbus); -- 2.39.5