serial: qcom_geni: Fix BT failure regression on RB2 platform

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>

authored by Praveen Talari and committed by Greg Kroah-Hartman fb47423d f8f9c1f4

+6 -7
+6 -7
drivers/tty/serial/qcom_geni_serial.c
··· 1888 if (ret) 1889 goto error; 1890 1891 - devm_pm_runtime_enable(port->se.dev); 1892 - 1893 - ret = uart_add_one_port(drv, uport); 1894 - if (ret) 1895 - goto error; 1896 - 1897 if (port->wakeup_irq > 0) { 1898 device_init_wakeup(&pdev->dev, true); 1899 ret = dev_pm_set_dedicated_wake_irq(&pdev->dev, ··· 1895 if (ret) { 1896 device_init_wakeup(&pdev->dev, false); 1897 ida_free(&port_ida, uport->line); 1898 - uart_remove_one_port(drv, uport); 1899 goto error; 1900 } 1901 } 1902 1903 return 0; 1904
··· 1888 if (ret) 1889 goto error; 1890 1891 if (port->wakeup_irq > 0) { 1892 device_init_wakeup(&pdev->dev, true); 1893 ret = dev_pm_set_dedicated_wake_irq(&pdev->dev, ··· 1901 if (ret) { 1902 device_init_wakeup(&pdev->dev, false); 1903 ida_free(&port_ida, uport->line); 1904 goto error; 1905 } 1906 } 1907 + 1908 + devm_pm_runtime_enable(port->se.dev); 1909 + 1910 + ret = uart_add_one_port(drv, uport); 1911 + if (ret) 1912 + goto error; 1913 1914 return 0; 1915