Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: host: ehci-platform: Call reset assert/deassert on suspend/resume

The Renesas RZ/G3S SoC supports a power-saving mode in which power to most
of the SoC components is turned off, including the USB blocks. On the
resume path, the reset signal must be de-asserted before applying any
settings to the USB registers. To handle this properly, call
reset_control_assert() and reset_control_deassert() during suspend and
resume, respectively.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20251106143625.3050119-3-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Claudiu Beznea and committed by
Greg Kroah-Hartman
c31a401f a7d5fe02

+20 -2
+20 -2
drivers/usb/host/ehci-platform.c
··· 454 454 if (pdata->power_suspend) 455 455 pdata->power_suspend(pdev); 456 456 457 + ret = reset_control_assert(priv->rsts); 458 + if (ret) { 459 + if (pdata->power_on) 460 + pdata->power_on(pdev); 461 + 462 + ehci_resume(hcd, false); 463 + 464 + if (priv->quirk_poll) 465 + quirk_poll_init(priv); 466 + } 467 + 457 468 return ret; 458 469 } 459 470 ··· 475 464 struct platform_device *pdev = to_platform_device(dev); 476 465 struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd); 477 466 struct device *companion_dev; 467 + int err; 468 + 469 + err = reset_control_deassert(priv->rsts); 470 + if (err) 471 + return err; 478 472 479 473 if (pdata->power_on) { 480 - int err = pdata->power_on(pdev); 481 - if (err < 0) 474 + err = pdata->power_on(pdev); 475 + if (err < 0) { 476 + reset_control_assert(priv->rsts); 482 477 return err; 478 + } 483 479 } 484 480 485 481 companion_dev = usb_of_get_companion_dev(hcd->self.controller);