summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* serial: sprd: Fix DMA buffer leak issueChunyan Zhang2023-07-301-2/+3
| | | | | | | | | | Release DMA buffer when _probe() returns failure to avoid memory leak. Fixes: f4487db58eb7 ("serial: sprd: Add DMA mode support") Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Link: https://lore.kernel.org/r/20230725064053.235448-2-chunyan.zhang@unisoc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: sprd: Assign sprd_port after initialized to avoid wrong accessChunyan Zhang2023-07-301-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The global pointer 'sprd_port' may not zero when sprd_probe returns failure, that is a risk for sprd_port to be accessed afterward, and may lead to unexpected errors. For example: There are two UART ports, UART1 is used for console and configured in kernel command line, i.e. "console="; The UART1 probe failed and the memory allocated to sprd_port[1] was released, but sprd_port[1] was not set to NULL; In UART2 probe, the same virtual address was allocated to sprd_port[2], and UART2 probe process finally will go into sprd_console_setup() to register UART1 as console since it is configured as preferred console (filled to console_cmdline[]), but the console parameters (sprd_port[1]) belong to UART2. So move the sprd_port[] assignment to where the port already initialized can avoid the above issue. Fixes: b7396a38fb28 ("tty/serial: Add Spreadtrum sc9836-uart driver support") Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com> Link: https://lore.kernel.org/r/20230725064053.235448-1-chunyan.zhang@unisoc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: sc16is7xx: Put IOControl register into regmap_volatileHui Wang2023-07-301-0/+1
| | | | | | | | | | | | | | | | According to the IOControl register bits description in the page 31 of the product datasheet, we know the bit 3 of IOControl register is softreset, this bit will self-clearing once the reset finish. In the probe, the softreset bit is set, and when we read this register from debugfs/regmap interface, we found the softreset bit is still setting, this confused us for a while. Finally we found this register is cached, to read the real value from register, we could put it into the regmap_volatile(). Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20230724034727.17335-1-hui.wang@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers:tty: fix return value check in asc_init_portYuanjun Gong2023-07-301-1/+3
| | | | | | | | | in asc_init_port, clk_prepare_enable may fail, therefore, the return value of clk_prepare_enable should be checked. Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> Link: https://lore.kernel.org/r/20230717144733.24194-1-ruc_gongyuanjun@163.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: meson: refactor objects definition for different devnamesDmitry Rokosov2023-07-301-23/+16
| | | | | | | | | | | | | | | Macroses for name generation are not useful. They hide the real place for object declaration. Instead, use direct names such as 'meson_uart_driver_*' and 'meson_serial_console_*' for all objects. Additionally, rename 'MESON_SERIAL_CONSOLE_DEFINE()' to 'MESON_SERIAL_CONSOLE()', and 'MESON_UART_DRIVER_DEFINE()' to 'MESON_UART_DRIVER()' to simplify the code. Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> Suggested-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20230728071522.17503-1-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* 8250_men_mcb: fix error handling in read_uarts_available_from_reg()Yang Yingliang2023-07-301-1/+4
| | | | | | | | | | If ioremap() fails, it returns NULL pointer, not ERR_PTR(), fix the return value check and call release_mem_region() to release resource. Fixes: c563831ba879 ("8250_men_mcb: Make UART config auto configurable") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20230728085723.3195044-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: st-asc: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-2/+1
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-15-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: imx: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-2/+1
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-14-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: sifive: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-5/+2
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-13-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: mvebu-uart: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-8/+3
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-12-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: sccnxp: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-2/+2
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-11-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: sprd: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-2/+1
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-10-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: mps2-uart: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-2/+1
| | | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Link: https://lore.kernel.org/r/20230712062853.11007-9-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: vt8500: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-5/+1
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-8-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: fsl_lpuart: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-2/+1
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-7-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: omap: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-2/+1
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-6-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: tegra: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-7/+2
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-5-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: linflexuart: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-6/+2
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-4-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: clps711x: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-2/+1
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-3-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: bcm63xx-uart: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-6/+2
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-2-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: ar933x: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-251-2/+1
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712062853.11007-1-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: qcom-geni: clean up clock-rate debug printkJohan Hovold2023-07-251-1/+1
| | | | | | | | | | | | | Make the clock-rate debug printk more readable by using an equal sign instead of a dash as separator between names and values and adding some spaces: qcom_geni_serial 988000.serial: desired_rate = 1843200, clk_rate = 7372800, clk_div = 4 Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230714130214.14552-3-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: qcom-geni: fix opp vote on shutdownJohan Hovold2023-07-251-0/+5
| | | | | | | | | | | | | | | | The operating-performance-point vote needs to be dropped when shutting down the port to avoid wasting power by keeping resources like power domains in an unnecessarily high performance state (e.g. when a UART connected Bluetooth controller is not in use). Fixes: a5819b548af0 ("tty: serial: qcom_geni_serial: Use OPP API to set clk/perf state") Cc: stable@vger.kernel.org # 5.9 Cc: Rajendra Nayak <quic_rjendra@quicinc.com> Cc: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230714130214.14552-2-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: fsl_lpuart: add IDLE interrupt support for rx_dma on ↵Sherry Sun2023-07-251-2/+42
| | | | | | | | | | | | | | imx7ulp/imx8ulp/imx8qxp Add IDLE interrupt support for receive dma on imx7ulp/imx8ulp/imx8qxp platforms to replace the receive dma timer function, because the receive dma timer has bigger latency than idle interrupt triggering, which may cause the Bluetooth Firmware download timeout on Android platform(it has a limited FW download time window). Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Link: https://lore.kernel.org/r/20230710013857.7396-3-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: fsl_lpuart: move the lpuart32_int() belowSherry Sun2023-07-251-20/+19
| | | | | | | | | | Move the lpuart32_int() below lpuart_copy_rx_to_tty(), this is a preparation patch for the next patch to avoid the function declaration, no actual functional changes. Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Link: https://lore.kernel.org/r/20230710013857.7396-2-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* dt-bindings: serial: fsl-lpuart: correct imx93-lpuart dt-binding itemSherry Sun2023-07-251-1/+5
| | | | | | | | | | | Correct the fsl,imx93-lpuart dt-binding item, imx93/imx8ulp add some new features based on imx7ulp lpuart, so need to add "fsl,imx8ulp-lpuart" for imx93 to enable those new features. Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230705015602.29569-4-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: 8250: Define earlycon for mrvl,mmp-uartDuje Mihanović2023-07-251-0/+1
| | | | | | | | | | mrvl,pxa-uart already supports earlycon and both compatible strings use the same driver, so there's no reason for mmp-uart to not have earlycon as well. Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr> Link: https://lore.kernel.org/r/20230721210042.21535-2-duje.mihanovic@skole.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* arm64: dts: meson: a1: change uart compatible stringDmitry Rokosov2023-07-251-2/+2
| | | | | | | | | | | | | | In the current implementation, the meson-a1 configuration incorporates a unique compatibility tag "amlogic,meson-a1-uart' within the meson-uart driver due to its usage of the new console device name "ttyS". Consequently, the previous compatibility tag designated for the 'amlogic,meson-gx-uart' configuration has become obsolete and is no longer relevant to the current setup. Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20230705181833.16137-8-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* dt-bindings: serial: amlogic,meson-uart: support Amlogic A1Dmitry Rokosov2023-07-251-0/+2
| | | | | | | | | Introduce meson uart serial bindings for A1 SoC family. Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230705181833.16137-7-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: meson: add independent uart_data for A1 SoC familyDmitry Rokosov2023-07-251-0/+9
| | | | | | | | | | | Implement separate uart_data to ensure proper devname value for the A1 SoC family. Use 'ttyS' devname, as required by the A1 architecture, instead of the legacy gx architecture. Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20230705181833.16137-6-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: meson: introduce separate uart_data for S4 SoC familyDmitry Rokosov2023-07-251-1/+6
| | | | | | | | | | | | In order to use the correct devname value for the S4 SoC family, it is imperative that we implement separate uart_data. Unlike the legacy g12a architecture, the S4 architecture should employ the use of 'ttyS' devname. Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20230705181833.16137-5-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: meson: apply ttyS devname instead of ttyAML for new SoCsDmitry Rokosov2023-07-251-26/+56
| | | | | | | | | | | | | | | | | | It is worth noting that the devname ttyS is a widely recognized tty name and is commonly used by many uart device drivers. Given the established usage and compatibility concerns, it may not be feasible to change the devname for older SoCs. However, for new definitions, it is acceptable and even recommended to use a new devname to help ensure clarity and avoid any potential conflicts on lower or upper software levels. For more information please refer to IRC discussion at [1]. Links: [1]: https://libera.irclog.whitequark.org/linux-amlogic/2023-07-03 Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> Link: https://lore.kernel.org/r/20230705181833.16137-4-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: meson: redesign the module to platform_driverDmitry Rokosov2023-07-251-36/+15
| | | | | | | | | | | | | | | | | | Actually, the meson_uart module is already a platform_driver, but it is currently registered manually and the uart core registration is run outside the probe() scope, which results in some restrictions. For instance, it is not possible to communicate with the OF subsystem because it requires an initialized device object. To address this issue, apply module_platform_driver() instead of direct module init/exit routines. Additionally, move uart_register_driver() to the driver probe(), and destroy manual console registration because it's already run in the uart_register_driver() flow. Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20230705181833.16137-3-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: meson: use dev_err_probeDmitry Rokosov2023-07-251-2/+2
| | | | | | | | | | Use dev_err_probe() helper for error checking and standard logging. It makes the driver's probe() function a little bit shorter. Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20230705181833.16137-2-ddrokosov@sberdevices.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* 8250_men_mcb: Make UART config auto configurableRodríguez Barbarin, José Javier2023-07-251-19/+24
| | | | | | | | | | | | | | | | | | The UART ports created by this driver were not usable out of the box, so let the configuration be handled by the 8250 UART subsystem. This makes the implementation simpler and the UART port more usable. The 8250 UART subsystem will take care of requesting the memory resources, but the driver needs to first read the register where the num ports is set, so a request of the resource is needed before registering the UART port. Co-developed-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com> Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com> Signed-off-by: Javier Rodriguez <josejavier.rodriguez@duagon.com> Link: https://lore.kernel.org/r/20230705131423.30552-4-josejavier.rodriguez@duagon.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* 8250_men_mcb: Read num ports from register data.Rodríguez Barbarin, José Javier2023-07-251-50/+139
| | | | | | | | | | | | | | | | The IP Core Z025 and Z057 have a register where the amount of UART ports is specified. Such register is located at offset 0x40. This patch fixes the way the UART ports is calculated by reading the actual register. Additionally a refactor was needed to achieve this so we can keep track of the UART line and its offset which also improves the remove callback. Co-developed-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com> Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com> Signed-off-by: Javier Rodriguez <josejavier.rodriguez@duagon.com> Link: https://lore.kernel.org/r/20230705131423.30552-3-josejavier.rodriguez@duagon.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* 8250_men_mcb: Add clockrate speed for G215/F215 boardsRodríguez Barbarin, José Javier2023-07-251-2/+2
| | | | | | | | | | | | | Some F215 FPGA multifunction boards announce themselves as 215. This leads to a misconfigured clockrate. The F215 is the same board as G215 but with different cPCI interface so make them get the same configuration Co-developed-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com> Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com> Signed-off-by: Javier Rodriguez <josejavier.rodriguez@duagon.com> Link: https://lore.kernel.org/r/20230705131423.30552-2-josejavier.rodriguez@duagon.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: tegra: Don't print error on probe deferralJon Hunter2023-07-251-4/+2
| | | | | | | | | | | | | | | | If the Tegra serial driver is probe before clocks are available then the following error is seen on boot: serial-tegra 3100000.serial: Couldn't get the clock This has been observed on Jetson AGX Orin. Fix this by calling dev_err_probe() instead of dev_err() to avoid printing an error on probe deferral. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20230703113759.75608-1-jonathanh@nvidia.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: Explicitly include correct DT includesRob Herring2023-07-2528-36/+21
| | | | | | | | | | | | | | | | The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> # for imx Link: https://lore.kernel.org/r/20230724205440.767071-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: qcom-geni: use icc tag definesJohan Hovold2023-07-251-1/+1
| | | | | | | | | | Use the Qualcomm interconnect defines rather than magic numbers for the icc tags also in the restore() PM callback. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Georgi Djakov <djakov@kernel.org> Link: https://lore.kernel.org/r/20230711160516.30502-1-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: drivers: switch ch and flag to u8Jiri Slaby2023-07-2534-48/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the serial layer explicitly expects 'u8' for flags and characters, propagate this type to drivers' (RX) routines. Note that amba-pl011's, clps711x's and st-asc's 'ch' are left unchanged because 'ch' contains not only a character, but whole status. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Cc: Tobias Klauser <tklauser@distanz.ch> Cc: Russell King <linux@armlinux.org.uk> Cc: Vineet Gupta <vgupta@kernel.org> Cc: Richard Genoud <richard.genoud@gmail.com> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Claudiu Beznea <claudiu.beznea@microchip.com> Cc: Alexander Shiyan <shc_work@mail.ru> Cc: Baruch Siach <baruch@tkos.co.il> Cc: "Maciej W. Rozycki" <macro@orcam.me.uk> Cc: Taichi Sugaya <sugaya.taichi@socionext.com> Cc: Takao Orito <orito.takao@socionext.com> Cc: Shawn Guo <shawnguo@kernel.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Pengutronix Kernel Team <kernel@pengutronix.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: NXP Linux Team <linux-imx@nxp.com> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Cc: Alim Akhtar <alim.akhtar@samsung.com> Cc: Laxman Dewangan <ldewangan@nvidia.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Orson Zhai <orsonzhai@gmail.com> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Chunyan Zhang <zhang.lyra@gmail.com> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com> Cc: Hammer Hsieh <hammerh0314@gmail.com> Acked-by: Richard GENOUD <richard.genoud@gmail.com> Acked-by: Tobias Klauser <tklauser@distanz.ch> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Maciej W. Rozycki <macro@orcam.me.uk> Link: https://lore.kernel.org/r/20230712081811.29004-11-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: omap-serial: remove flag from serial_omap_rdi()Jiri Slaby2023-07-251-3/+1
| | | | | | | | | The local 'flag' variable carries only TTY_NORMAL. So use that constant directly and drop the variable. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230712081811.29004-10-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: arc_uart: simplify flags handling in arc_serial_rx_chars()Jiri Slaby2023-07-251-16/+13
| | | | | | | | | | | | | | | | | | | | | | | * move the declaration of flg (with the initializer) to the loop, so there is no need to reset it to TTY_NORMAL by an 'else' branch. * use TTY_NORMAL as initializer above, not a magic zero constant * remove the outer 'if' from this construct: if (S & (A | B)) { if (S & A) X; if (S & B) Y; } * drop unlikely() as I doubt it has any benefits here. If it does, provide numbers. All four make the code easier to read. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Cc: Vineet Gupta <vgupta@kernel.org> Acked-by: Vineet Gupta <vgupta@kernel.org> Link: https://lore.kernel.org/r/20230712081811.29004-9-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: pass state to __uart_start() directlyJiri Slaby2023-07-251-5/+4
| | | | | | | | | __uart_start() does not need a tty struct. It works only with uart_state. So pass the latter directly. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230712081811.29004-8-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: make uart_insert_char() accept u8sJiri Slaby2023-07-252-2/+2
| | | | | | | | | Both the character and flag are 8-bit values. So switch from unsigned ints to u8s. The drivers will be cleaned up in the next round. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230712081811.29004-7-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: convert uart sysrq handling to u8Jiri Slaby2023-07-252-10/+10
| | | | | | | | | Propagate u8 from the sysrq code further up to serial's uart_handle_sysrq_char() and friends. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230712081811.29004-6-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: sysrq: use switch in sysrq_key_table_key2index()Jiri Slaby2023-07-251-11/+10
| | | | | | | | | | Using switch with range cases makes the code more aligned and readable. Expand also that 36 as explicit addition of 10 + 26 to make the source of the constant more obvious. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230712081811.29004-5-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: sysrq: switch the rest of keys to u8Jiri Slaby2023-07-252-16/+16
| | | | | | | | | Propagate u8 more from the bottom to the interface, so that sysrq callers (usually drivers) see that u8 is expected. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230712081811.29004-4-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: sysrq: switch sysrq handlers from int to u8Jiri Slaby2023-07-2511-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The passed parameter to sysrq handlers is a key (a character). So change the type from 'int' to 'u8'. Let it specifically be 'u8' for two reasons: * unsigned: unsigned values come from the upper layers (devices) and the tty layer assumes unsigned on most places, and * 8-bit: as that what's supposed to be one day in all the layers built on the top of tty. (Currently, we use mostly 'unsigned char' and somewhere still only 'char'. (But that also translates to the former thanks to -funsigned-char.)) Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Cc: Richard Henderson <richard.henderson@linaro.org> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: WANG Xuerui <kernel@xen0n.name> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: David Airlie <airlied@gmail.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Daniel Thompson <daniel.thompson@linaro.org> Cc: Douglas Anderson <dianders@chromium.org> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Len Brown <len.brown@intel.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: "Paul E. McKenney" <paulmck@kernel.org> Cc: Frederic Weisbecker <frederic@kernel.org> Cc: Neeraj Upadhyay <quic_neeraju@quicinc.com> Cc: Joel Fernandes <joel@joelfernandes.org> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Cc: Zqiang <qiang.zhang1211@gmail.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> # DRM Acked-by: WANG Xuerui <git@xen0n.name> # loongarch Acked-by: Paul E. McKenney <paulmck@kernel.org> Acked-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20230712081811.29004-3-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: sysrq: rename and re-type i in sysrq_handle_loglevel()Jiri Slaby2023-07-251-4/+3
| | | | | | | | | | | | | 'i' is a too generic name for something which carries a 'loglevel'. Name it as such and make it 'u8', the same as key will become in the next patches. Note that we are not stripping any high bits away, 'key' is given only 8bit values. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230712081811.29004-2-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>