]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: qcom_geni: Fix BT failure regression on RB2 platform
authorPraveen Talari <praveen.talari@oss.qualcomm.com>
Thu, 8 Jan 2026 04:10:06 +0000 (09:40 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Jan 2026 13:28:49 +0000 (14:28 +0100)
Commit 10904d725f6e ("serial: qcom-geni: Enable PM runtime for serial
driver") caused BT init to fail during bootup on the RB2 platform,
preventing proper BT initialization. However, BT works correctly after
bootup completes.

The issue occurs when runtime PM is enabled and uart_add_one_port() is
called before wakeup IRQ setup. The uart_add_one_port() call activates
the device through runtime PM, which configures GPIOs to the "qup_x"
pinmux function during runtime resume. When wakeup IRQ registration
happens afterward using dev_pm_set_dedicated_wake_irq(), these GPIOs
are reset back to the "gpio" pinmux function, which impacts the RX GPIO
and leads to Bluetooth failures.

Fix this by ensuring wakeup IRQ setup is completed before calling
uart_add_one_port() to prevent the pinmux function conflict.

Fixes: 10904d725f6e ("serial: qcom-geni: Enable PM runtime for serial driver")
Reported-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Closes: https://lore.kernel.org/all/20251110101043.2108414-4-praveen.talari@oss.qualcomm.com/
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
Link: https://patch.msgid.link/20260108041006.1874757-1-praveen.talari@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/qcom_geni_serial.c

index 6ce6528f5c10145d7196b90d674f9660fe90e773..e6b0a55f0cfb2e581ef0f40e252631a934b04a65 100644 (file)
@@ -1888,12 +1888,6 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
        if (ret)
                goto error;
 
-       devm_pm_runtime_enable(port->se.dev);
-
-       ret = uart_add_one_port(drv, uport);
-       if (ret)
-               goto error;
-
        if (port->wakeup_irq > 0) {
                device_init_wakeup(&pdev->dev, true);
                ret = dev_pm_set_dedicated_wake_irq(&pdev->dev,
@@ -1901,11 +1895,16 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
                if (ret) {
                        device_init_wakeup(&pdev->dev, false);
                        ida_free(&port_ida, uport->line);
-                       uart_remove_one_port(drv, uport);
                        goto error;
                }
        }
 
+       devm_pm_runtime_enable(port->se.dev);
+
+       ret = uart_add_one_port(drv, uport);
+       if (ret)
+               goto error;
+
        return 0;
 
 error: