summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
Commit message (Collapse)AuthorAgeFilesLines
...
| * | serial: core: Call device_set_awake_path() for console portClaudiu Beznea2024-05-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case the UART port is used as a console, no_console_suspend is available in bootargs and UART port is part of a software-controlled power domain we need to call device_set_awake_path(). This lets the power domain core code know that this domain should not be powered off during system suspend. Otherwise, the UART port power domain is turned off, nothing is printed while suspending and the suspend/resume process is blocked. This was detected on the Renesas RZ/G3S SoC while adding support for power domains. Based on code investigation (on v6.9-rc5), this issue is present on other SoCs (e.g., Renesas R-Mobile A1 [1], IMX8QXP [2]) and different SoCs have particular implementation to handle it. Due to this the patch added the call of device_set_awake_path() in uart_suspend_port() instead of having it in the platform specific UART driver. [1] drivers/pmdomain/renesas/rmobile-sysc.c:116 [2] drivers/pmdomain/imx/scu-pd.c:357 Suggested-by: Ulf Hansson <ulf.hansson@linaro.org> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Tony Lindgren <tony.lindgren@linux.intel.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Link: https://lore.kernel.org/r/20240430095930.2806067-1-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: serial: uartps: Add support for uartps controller resetManikanta Guntupalli2024-05-041-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for an optional reset for the uartps controller using the reset driver. If the uartps node contains the "resets" property, then cdns_uart_startup performs uartps controller non-pulse out of reset and reset in exit path. Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> Link: https://lore.kernel.org/r/20240425062358.1347684-4-manikanta.guntupalli@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_pnp: Switch to DEFINE_SIMPLE_DEV_PM_OPS()Andy Shevchenko2024-05-041-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SIMPLE_DEV_PM_OPS() is deprecated, replace it with the DEFINE_SIMPLE_DEV_PM_OPS() and use pm_sleep_ptr() for setting the driver's PM routines. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240422083237.207447-1-andy.shevchenko@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Keep the includes sortedAndy Shevchenko2024-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Keep the includes sorted. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-14-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Make type of bit the same in exar_ee_*_bit()Andy Shevchenko2024-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make type of bit parameter and returned one the same in exar_ee_*_bit(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-13-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Use BIT() in exar_ee_read()Andy Shevchenko2024-05-041-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use BIT() in exar_ee_read() like other functions do. While at it, explain the EEPROM type and the dummy bit requirement. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-12-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Switch to use dev_err_probe()Andy Shevchenko2024-05-041-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to use dev_err_probe() to simplify the error path and unify a message template. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-11-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Return directly from switch-casesAndy Shevchenko2024-05-041-52/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two similar switch-cases which use different style. Unify them and one more to return from the cases directly. While at it, add missing default in another switch-case. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-10-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Decrease indentation levelAndy Shevchenko2024-05-041-50/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decrease indentation level in some places. No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-9-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Kill unneeded ->board_init()Andy Shevchenko2024-05-041-90/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | We may reuse ->setup() for the same purpose as it was done before. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-8-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Extract cti_board_init_osc_freq() helperAndy Shevchenko2024-05-041-29/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Extract cti_board_init_osc_freq() helper to avoid code duplication. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-7-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Trivia typo fixesAndy Shevchenko2024-05-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Trivia typo fixes: interupts --> interrupts and others. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-6-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Use PCI_SUBVENDOR_ID_IBM for subvendor IDAndy Shevchenko2024-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use PCI_SUBVENDOR_ID_IBM for subvendor ID instead of vendor one. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-5-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Kill CTI_PCI_DEVICE()Andy Shevchenko2024-05-041-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The CTI_PCI_DEVICE() duplicates EXAR_DEVICE(). Kill the former. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Describe all parameters in kernel docAndy Shevchenko2024-05-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel doc validator is not happy: warning: Function parameter or struct member 'pcidev' not described in 'cti_get_port_type_xr17c15x_xr17v25x' warning: Function parameter or struct member 'pcidev' not described in 'cti_get_port_type_fpga' warning: Function parameter or struct member 'pcidev' not described in 'cti_get_port_type_xr17v35x' Add missed descriptions. Fixes: f7ce07062988 ("serial: exar: add CTI specific setup code") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_exar: Don't return positive values as error codesAndy Shevchenko2024-05-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PCI core may return positive codes for the specific errors. There is a special API to convert them to negative stanrard ones. Use that API to avoid returning positive values as error codes. Fixes: f7ce07062988 ("serial: exar: add CTI specific setup code") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/20240503171917.2921250-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | Merge 6.9-rc5 into tty-nextGreg Kroah-Hartman2024-04-239-32/+77
| |\| | | | | | | | | | | | | | | | | | | | | | | | | We want the tty fixes in here as well, and it resolves a merge conflict in: drivers/tty/serial/serial_core.c as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: msm: check dma_map_sg() return value properlyJiri Slaby (SUSE)2024-04-201-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -next commit f8fef2fa419f (tty: msm_serial: use dmaengine_prep_slave_sg()), switched to using dma_map_sg(). But the return value of dma_map_sg() is special: it returns number of elements mapped. And not a standard error value. The commit also forgot to reset dma->tx_sg in case of this failure. Fix both these mistakes. Thanks to Marek who helped debugging this. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/20240419080931.30949-1-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: exar: fix checkpach warningsParker Newman2024-04-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Fix several "missing identifier name" warnings from checkpatch in struct exar8250_platform and struct exar8250_board. Example: WARNING: function definition argument <arg> should also have an identifier name - Fix space before tab warning from checkpatch: WARNING: please, no space before tabs + * 0^I^I2 ^IMode bit 0$ Signed-off-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/f7fa6c16cb5f2c8c1c7cb7d29f80bc7be53f91ab.1713382717.git.pnewman@connecttech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: exar: add CTI specific setup codeParker Newman2024-04-181-0/+846
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a large patch but is only additions. All changes and removals are made in previous patches in this series. - Add CTI board_init and port setup functions for each UART type - Add CTI_EXAR_DEVICE() and CTI_PCI_DEVICE() macros - Add support for reading a word from the Exar EEPROM. - Add support for configuring and setting a single MPIO - Add various helper functions for CTI boards. - Add osc_freq to struct exar8250 Signed-off-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/ae4a66e7342b686cb8d4b15317585dfb37222cf4.1713382717.git.pnewman@connecttech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: exar: add CTI cards to exar_get_nr_portsParker Newman2024-04-181-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add code for getting number of ports of CTI cards to exar_get_nr_ports(). Signed-off-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/0c64bdf852f39aec966b38696695d951e485d7e6.1713382717.git.pnewman@connecttech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: exar: moved generic_rs485 further up in 8250_exar.cParker Newman2024-04-181-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preparatory patch moving generic_rs485_config and generic_rs485_supported higher in the file to allow for CTI setup functions to use them. Signed-off-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/a7bf2a42de759908c058246ec15f60bde9a5dc65.1713382717.git.pnewman@connecttech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: exar: add optional board_init functionParker Newman2024-04-181-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an optional "board_init()" function pointer to struct exar8250_board which is called once during probe prior to setting up the ports. It will be used in subsequent patches of this series. Signed-off-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/0e72a3154114c733283ff273bc1e31456ee101f4.1713382717.git.pnewman@connecttech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: exar: added a exar_get_nr_ports functionParker Newman2024-04-181-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moved code for getting number of ports from exar_pci_probe() to a separate exar_get_nr_ports() function. CTI specific code will be added in another patch in this series. Signed-off-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/33f2bf66bc334573c10cf670a299ecef0b7264bc.1713382717.git.pnewman@connecttech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: exar: remove old Connect Tech setupParker Newman2024-04-181-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preparatory patch removing existing Connect Tech setup code and CONNECT_DEVICE macro. Subsequent patches in this series will add in new UART family specific setup code and new device definition macros to allow for supporting CTI serial cards with Exar PCI IDs and CTI PCI IDs. Signed-off-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/06a04b6c683ca20c50646cc0836be869c2dacd87.1713382717.git.pnewman@connecttech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: exar: adding missing CTI and Exar PCI idsParker Newman2024-04-171-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | - Added Connect Tech and Exar IDs not already in pci_ids.h Signed-off-by: Parker Newman <pnewman@connecttech.com> Link: https://lore.kernel.org/r/7c3d8e795a864dd9b0a00353b722060dc27c4e09.1713270624.git.pnewman@connecttech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_pnp: Support configurable reg shift propertyGuanbing Huang2024-04-171-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 16550a serial port based on the ACPI table requires obtaining the reg-shift attribute. In the ACPI scenario, If the reg-shift property is not configured like in DTS, the 16550a serial driver cannot read or write controller registers properly during initialization. Signed-off-by: Guanbing Huang <albanhuang@tencent.com> Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Bing Fan <tombinfan@tencent.com> Tested-by: Linheng Du <dylanlhdu@tencent.com> Link: https://lore.kernel.org/r/4726ecea8f7bfbfe42501b4f6ad9fe5b38994574.1713234515.git.albanhuang@tencent.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: port: Add support of PNP IRQ to __uart_read_properties()Guanbing Huang2024-04-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function __uart_read_properties doesn't cover PNP devices, so add IRQ processing for PNP devices in the branch. Signed-off-by: Guanbing Huang <albanhuang@tencent.com> Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Bing Fan <tombinfan@tencent.com> Tested-by: Linheng Du <dylanlhdu@tencent.com> Link: https://lore.kernel.org/r/7f4ca31ef1cab4c6ecad22fafd82117686b696be.1713234515.git.albanhuang@tencent.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_dw: Hide a cast in dw8250_serial_inq()Andy Shevchenko2024-04-171-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dw8250_serial_inq() uses unsigned int variable to store 8-bit value. Due to that it needs a cast which can be avoided by switching to use u8 instead of unsigned int. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240412173937.187442-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_dw: Deduplicate LCR checksAndy Shevchenko2024-04-171-26/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | All callers of dw8250_check_lcr() perform the same check. Deduplicate it by moving them into respective call. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240412173931.187411-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: serial: fsl_lpuart: use dev_err_probe for clocksAlexander Stein2024-04-171-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Clocks might not be available yet when probing lpuart. Silence -517 errors by using dev_err_probe. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/20240411130449.1096090-1-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: imx: Introduce timeout when waiting on transmitter emptyEsben Haabendal2024-04-171-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By waiting at most 1 second for USR2_TXDC to be set, we avoid a potential deadlock. In case of the timeout, there is not much we can do, so we simply ignore the transmitter state and optimistically try to continue. Signed-off-by: Esben Haabendal <esben@geanix.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Link: https://lore.kernel.org/r/919647898c337a46604edcabaf13d42d80c0915d.1712837613.git.esben@geanix.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: core: Extract uart_alloc_xmit_buf() and uart_free_xmit_buf()Andy Shevchenko2024-04-171-44/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | After conversion to the kfifo, it becomes possible to extract two helper functions for better maintenance and code deduplication. Do it here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240409174057.1104262-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: drop debugging WARN_ON_ONCE() from uart_put_char()Jiri Slaby (SUSE)2024-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pengfei Xu reports, that the -next commit 1788cf6a91d9 (tty: serial: switch from circ_buf to kfifo) tries to emit a WARNING and that leads to lockdep errors. Obviously we cannot print anything from uart_put_char()! This WARN_ON_ONCE() was/is a debug aid to check if the condition in uart_put_char() can happen at all. Pengfei Xu confirmed it can. Unlike me and kbuild bot in my queue. Second, I completely forgot about it, so I did not remove it in the final version, nor mentioned it in the commit log. Drop it now as we are all good. And we even have stack traces (and a reproducer)! Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Reported-by: Pengfei Xu <pengfei.xu@intel.com> Link: https://lore.kernel.org/r/20240416071904.21440-1-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: meson+qcom: don't advance the kfifo twiceJiri Slaby (SUSE)2024-04-162-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Marek reports, that the -next commit 1788cf6a91d9 (tty: serial: switch from circ_buf to kfifo) broke meson_uart and qcom_geni_serial. The commit mistakenly advanced the kfifo twice: once by uart_fifo_get()/kfifo_out() and second time by uart_xmit_advance(). To advance the fifo only once, drop the superfluous uart_xmit_advance() from both. To count the TX statistics properly, use uart_fifo_out() in qcom_geni_serial (meson_uart_start_tx() already uses that). I checked all other uses of uart_xmit_advance() and they appear correct: either they are finishing DMA transfers or are after peek/linear_ptr (i.e. they do not advance fifo). Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Fixes: 1788cf6a91d9 ("tty: serial: switch from circ_buf to kfifo") Cc: Neil Armstrong <neil.armstrong@linaro.org> Cc: Kevin Hilman <khilman@baylibre.com> Cc: Jerome Brunet <jbrunet@baylibre.com> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Link: https://lore.kernel.org/r/20240416054825.6211-1-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: core: Fix ifdef for serial base console functionsTony Lindgren2024-04-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If CONFIG_SERIAL_CORE_CONSOLE is not set, we get build errors. Let's fix the issue by moving the endif after the serial base console functions. Fixes: 4547cd76f08a ("serial: 8250: Fix add preferred console for serial8250_isa_init_ports()") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202404131416.VJljwvkS-lkp@intel.com/ Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20240413103343.24231-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: max3100: Convert to_max3100_port() to be static inlineAndy Shevchenko2024-04-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Jiri rightfully pointed out the current to_max3100_port() macro implementation is fragile in a sense that it expects the variable name to be port, otherwise it blow up the build. Change this to be static inline to prevent bad compilation. Suggested-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240410141135.1378948-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: omap: remove redundant assignment to variable tmoutColin Ian King2024-04-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Variable tmout is being assigned a value that is never read, it is being re-assinged in the following for-loop statement. The assignment is redundant and can be removed. Cleans up clang scan warning: drivers/tty/serial/omap-serial.c:1096:3: warning: Value stored to 'tmout' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20240411085537.306020-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250: Fix add preferred console for serial8250_isa_init_ports()Tony Lindgren2024-04-112-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to inline serial_base_add_isa_preferred_console() based on CONFIG_SERIAL_8250_CONSOLE and not based on CONFIG_SERIAL_CORE_CONSOLE. Otherwise we can get the follwoing error as noted by Stephen: ERROR: modpost: "serial_base_add_isa_preferred_console" [drivers/tty/serial/8250/8250.ko] undefined! We also have a duplicate inlined serial_base_add_isa_preferred_console(), in serial_base_bus.c added by the same commit by accident, let's drop it. Fixes: a8b04cfe7dad ("serial: 8250: Add preferred console in serial8250_isa_init_ports()") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20240411080622.11929-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: sc16is7xx: split into core and I2C/SPI parts (sc16is7xx_regcfg)Hugo Villeneuve2024-04-114-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since each I2C/SPI probe function can modify sc16is7xx_regcfg at the same time, change structure to be constant and do the required modifications on a local copy. Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240409154253.3043822-6-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: sc16is7xx: split into core and I2C/SPI parts (sc16is7xx_lines)Hugo Villeneuve2024-04-111-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, sc16is7xx_lines was checked for a free (zero) bit first, and then later it was set only if UART port registration succeeded. Now that sc16is7xx_lines is shared for the I2C and SPI drivers, there is a possibility that the two drivers can simultaneously try to reserve the same line bit at the same time. To prevent this, make sure line allocation is reserved atomically, and use a new variable to hold the status of UART port registration. Now that we no longer need to search if a bit is set, it is now possible to simplify sc16is7xx_lines allocation by using the IDA framework. Link: https://lore.kernel.org/all/20231212150302.a9ec5d085a4ba65e89ca41af@hugovil.com/ Link: https://lore.kernel.org/all/CAHp75VebCZckUrNraYQj9k=Mrn2kbYs1Lx26f5-8rKJ3RXeh-w@mail.gmail.com/ Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20240409154253.3043822-5-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: sc16is7xx: split into core and I2C/SPI parts (core)Hugo Villeneuve2024-04-116-218/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split the common code from sc16is7xx driver and move the I2C and SPI bus parts into interface-specific source files. sc16is7xx becomes the core functions which can support multiple bus interfaces like I2C and SPI. No functional changes intended. Also simplify and improve Kconfig entries. - Capitalize SPI keyword for consistency - Display list of supported ICs each on a separate line (and aligned) to facilitate locating a specific IC model - Add Manufacturer name at start of description string - Add UART keyword to description string Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20240409154253.3043822-4-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: sc16is7xx: unconditionally clear line bit in sc16is7xx_remove()Hugo Villeneuve2024-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to check for previous port registration in sc16is7xx_remove() because if sc16is7xx_probe() succeeded, we are guaranteed to have successfully registered both ports. We can thus unconditionally clear the line allocation bit in sc16is7xx_lines. Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240409154253.3043822-3-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: sc16is7xx: add proper sched.h include for sched_set_fifo()Hugo Villeneuve2024-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace incorrect include with the proper one for sched_set_fifo() declaration. Fixes: 28d2f209cd16 ("sched,serial: Convert to sched_set_fifo()") Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20240409154253.3043822-2-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: ar933x: Remove unneeded static structureLino Sanfilippo2024-04-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case that no RTS GPIO is available do not use a dedicated nullified serial_rs485 struct to disable RS485 support, but simply delete the SER_RS485_ENABLED flag in the ports rs485_supported struct. This make the structure superfluous and it can be removed. Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> Link: https://lore.kernel.org/r/20240407002709.16224-5-l.sanfilippo@kunbus.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250: Remove superfluous sanity checkLino Sanfilippo2024-04-091-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The serial core already checks the RS485 RTS settings for sanity, so remove the superfluous check in serial8250_em485_config(). Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> Link: https://lore.kernel.org/r/20240407002709.16224-4-l.sanfilippo@kunbus.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: amba-pl011: move variable into CONFIG_DMA_ENGINE conditionalLino Sanfilippo2024-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Variable dmacr is only used if DMA is enabled, so move it into the CONFIG_DMA_ENGINE conditional. Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> Link: https://lore.kernel.org/r/20240407002709.16224-3-l.sanfilippo@kunbus.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: amba-pl011: get rid of useless wrapper pl011_get_rs485_mode()Lino Sanfilippo2024-04-091-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to earlier code changes function pl011_get_rs485_mode() is now merely a wrapper for uart_get_rs485_mode() which does not add any further functionality. So remove it and instead call uart_get_rs485_mode() directly. Reviewed-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> Link: https://lore.kernel.org/r/20240407002709.16224-2-l.sanfilippo@kunbus.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: max3100: Sort headersAndy Shevchenko2024-04-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Sort the headers in alphabetic order in order to ease the maintenance for this part. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240409144721.638326-9-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: max3100: Extract to_max3100_port() helper macroAndy Shevchenko2024-04-091-48/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using container_of() explicitly, introduce a helper macro. This saves a lot of lines of code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20240409144721.638326-8-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>