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

Configure Feed

Select the types of activity you want to include in your feed.

slimbus: core: fix runtime PM imbalance on report present

Make sure to balance the runtime PM usage count in case slimbus device
or address allocation fails on report present, which would otherwise
prevent the controller from suspending.

Fixes: 4b14e62ad3c9 ("slimbus: Add support for 'clock-pause' feature")
Cc: stable@vger.kernel.org # 4.16
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251126145329.5022-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
0eb4ff65 0b52edae

+9 -7
+9 -7
drivers/slimbus/core.c
··· 489 489 if (ctrl->sched.clk_state != SLIM_CLK_ACTIVE) { 490 490 dev_err(ctrl->dev, "slim ctrl not active,state:%d, ret:%d\n", 491 491 ctrl->sched.clk_state, ret); 492 - goto slimbus_not_active; 492 + goto out_put_rpm; 493 493 } 494 494 495 495 sbdev = slim_get_device(ctrl, e_addr); 496 - if (IS_ERR(sbdev)) 497 - return -ENODEV; 496 + if (IS_ERR(sbdev)) { 497 + ret = -ENODEV; 498 + goto out_put_rpm; 499 + } 498 500 499 501 if (sbdev->is_laddr_valid) { 500 502 *laddr = sbdev->laddr; 501 - return 0; 503 + ret = 0; 504 + } else { 505 + ret = slim_device_alloc_laddr(sbdev, true); 502 506 } 503 507 504 - ret = slim_device_alloc_laddr(sbdev, true); 505 - 506 - slimbus_not_active: 508 + out_put_rpm: 507 509 pm_runtime_mark_last_busy(ctrl->dev); 508 510 pm_runtime_put_autosuspend(ctrl->dev); 509 511 return ret;