Jiri Slaby (SUSE)
18977909bf
tty: ttyprintk: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Link: https://lore.kernel.org/r/20231206073712.17776-26-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:38 +01:00
Jiri Slaby (SUSE)
14abfd0cb5
tty: srmcons: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
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: linux-alpha@vger.kernel.org
Link: https://lore.kernel.org/r/20231206073712.17776-25-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:38 +01:00
Jiri Slaby (SUSE)
475fc6e2de
tty: serdev: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
This patch converts struct serdev_device_ops hooks and its
instantiations.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Rob Herring <robh@kernel.org >
Acked-by: Johan Hovold <johan@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-24-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:38 +01:00
Jiri Slaby (SUSE)
f2470d2bc4
tty: serdev: convert to u8 and size_t in serdev_controller_ops
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
In this patch, only struct serdev_controller_ops hooks. The rest will
follow.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-23-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:38 +01:00
Jiri Slaby (SUSE)
5c99e2977f
tty: nozomi: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-22-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:38 +01:00
Jiri Slaby (SUSE)
5655b16ea5
tty: n_hdlc: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Note u8 is already both passed in and expected on output.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-21-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:38 +01:00
Jiri Slaby (SUSE)
eb7e45db2e
tty: n_gsm: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-20-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:38 +01:00
Jiri Slaby (SUSE)
59b943356b
tty: mxser: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-19-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:38 +01:00
Jiri Slaby (SUSE)
cb8566b9b3
tty: moxa: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-18-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:38 +01:00
Jiri Slaby (SUSE)
2573f7eac0
tty: mmc: sdio: use u8 for flag
...
Switch character types to u8. To conform to characters in the rest of
the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Ulf Hansson <ulf.hansson@linaro.org >
Cc: linux-mmc@vger.kernel.org
Link: https://lore.kernel.org/r/20231206073712.17776-17-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
ce7cbd9a6c
tty: mips_ejtag_fdc: use u8 for character pointers
...
mips_ejtag_fdc_encode() and mips_ejtag_fdc_put_chan() declare arrays of
pointers to characters. Switch their types from char to u8 to conform
to the current tty layer types for characters.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-16-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
b7a43d0c87
tty: m68k: nfcon: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: linux-m68k@lists.linux-m68k.org
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org >
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org >
Link: https://lore.kernel.org/r/20231206073712.17776-15-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
2f98231327
tty: ipoctal: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Vaibhav Gupta <vaibhavgupta40@gmail.com >
Cc: Jens Taprogge <jens.taprogge@taprogge.org >
Cc: industrypack-devel@lists.sourceforge.net
Link: https://lore.kernel.org/r/20231206073712.17776-14-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
f32fcbedbe
tty: hvc: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Nicholas Piggin <npiggin@gmail.com >
Cc: Christophe Leroy <christophe.leroy@csgroup.eu >
Cc: Amit Shah <amit@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Paul Walmsley <paul.walmsley@sifive.com >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: linuxppc-dev@lists.ozlabs.org
Cc: virtualization@lists.linux.dev
Cc: linux-riscv@lists.infradead.org
Link: https://lore.kernel.org/r/20231206073712.17776-13-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
f3fb7367af
tty: goldfish: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-12-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
0d08abb983
tty: ehv_bytechan: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com >
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20231206073712.17776-11-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
e17934c1bc
tty: con3270: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Heiko Carstens <hca@linux.ibm.com >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Alexander Gordeev <agordeev@linux.ibm.com >
Cc: Christian Borntraeger <borntraeger@linux.ibm.com >
Cc: Sven Schnelle <svens@linux.ibm.com >
Cc: linux-s390@vger.kernel.org
Link: https://lore.kernel.org/r/20231206073712.17776-10-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
359bbdc0cd
tty: con3215: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Heiko Carstens <hca@linux.ibm.com >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Alexander Gordeev <agordeev@linux.ibm.com >
Cc: Christian Borntraeger <borntraeger@linux.ibm.com >
Cc: Sven Schnelle <svens@linux.ibm.com >
Cc: linux-s390@vger.kernel.org
Link: https://lore.kernel.org/r/20231206073712.17776-9-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
03e5af5257
tty: bcm: convert to u8 and size_t
...
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Scott Branden <scott.branden@broadcom.com >
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com >
Cc: Arnd Bergmann <arnd@arndb.de >
Link: https://lore.kernel.org/r/20231206073712.17776-8-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
fbdeead959
tty: ami: use u8 for characters and flag
...
Switch character types to u8. To conform to characters in the rest of
the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org >
Link: https://lore.kernel.org/r/20231206073712.17776-7-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
4e8d887814
tty: core: the rest to u8
...
There are still last minor users in the tty core that still reference
characters by the 'char' type. Switch them to u8.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-6-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
3a00da0279
tty: make tty_operations::send_xchar accept u8 char
...
tty_operations::send_xchar is one of the last users of 'char' type for
characters in the tty layer. Convert it to u8 now.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Karsten Keil <isdn@linux-pingi.de >
Cc: Ulf Hansson <ulf.hansson@linaro.org >
Cc: Marcel Holtmann <marcel@holtmann.org >
Cc: Johan Hedberg <johan.hedberg@gmail.com >
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com >
Cc: netdev@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-bluetooth@vger.kernel.org
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org >
Link: https://lore.kernel.org/r/20231206073712.17776-5-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
49943393c9
tty: switch tty_port::xmit_* to u8
...
Both xmit_buf and xmit_fifo of struct tty_port should be u8. To conform
to characters in the rest of the tty layer.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-4-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
e93102bea4
tty: mmc: sdio_uart: switch sdio_in() to return u8
...
sdio_in() returns a value returned from sdio_readb(). The latter returns
u8. So should the former. Therefore, switch sdio_in() return type to u8
and all its callers too.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Ulf Hansson <ulf.hansson@linaro.org >
Cc: linux-mmc@vger.kernel.org
Link: https://lore.kernel.org/r/20231206073712.17776-3-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
e01b5712a8
tty: goldfish: use bool for is_write parameter
...
do_rw_io()'s is_write parameter is boolean, but typed int. Switch to the
former, so that it's obvious. (And the two users too.)
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231206073712.17776-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Stephan Gerhold
173ebdedcd
serial: msm: Use OPP table for DVFS support
...
Parse the OPP table from the device tree and use dev_pm_opp_set_rate()
instead of clk_set_rate() to allow making performance state votes
specified in the OPP table (e.g. for power domains and interconnects).
Without an OPP table in the device tree this will behave just as before
this patch.
Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com >
Link: https://lore.kernel.org/r/20231128-serial-msm-dvfs-v1-2-4f290d20a4be@kernkonzept.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Stephan Gerhold
692079bda7
dt-bindings: serial: qcom,msm-uartdm: Vote for shared resources
...
Document power-domains, operating-points-v2 and interconnects to allow
making performance state votes for certain clock frequencies of the UART
DM controller. The interconnect path to DRAM is needed when UART DM is
used together with a DMA engine.
Voting for these shared resources is necessary to guarantee performance
with power management enabled. Otherwise these resources might run at
minimal performance state which is not sufficient for certain UART
baud rates.
Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20231128-serial-msm-dvfs-v1-1-4f290d20a4be@kernkonzept.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Christophe Leroy
1e7e56160d
serial: ucc_uart: Fix multiple address space type errors
...
sparse reports multiple problems with address space type.
Most problems are linked to missing __iomem qualifier.
Others are caused by dereferencing __iomem addresses.
Fix all this by adding missing __iomem and using ioread32be().
Reported-by: kernel test robot <lkp@intel.com >
Closes: https://lore.kernel.org/oe-kbuild-all/202312050412.zN2PKArS-lkp@intel.com/
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu >
Link: https://lore.kernel.org/r/e49deeb079391ff7273ec32f5563df94cf70bc95.1701781976.git.christophe.leroy@csgroup.eu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Ayan Kumar Halder
0ec058ece2
tty: hvc: dcc: Check for TXfull condition while setting up early console
...
Refer ARM DDI 0487I.a ID081822, D17.3.8, DBGDTRTX_EL0,
"If TXfull is set to 1, set DTRRX and DTRTX to UNKNOWN"
Thus one should always check for TXfull condition before hvc can be
used as an early console. This is similar to what is being done
today in hvc_dcc_console_init() and hvc_dcc_init().
The count 0x4000000 has been obtained from uboot (v2024.01-rc3)
drivers/serial/arm_dcc.c "TIMEOUT_COUNT".
It reads the dcc status and waits for 0x4000000 times for the TX Fifo
to be available before returning an error. Thus, it will prevent DCC
to be used as early console.
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com >
Link: https://lore.kernel.org/r/20231205123534.3376883-1-ayan.kumar.halder@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Heiko Stuebner
b18fefd230
dt-bindings: serial: snps-dw-apb-uart: include rs485 schema
...
The dw-apb-uart also can emulate rs485, so include the rs485
schema to allow validating rs485 properties.
Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de >
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://lore.kernel.org/r/20231201140542.323564-1-heiko@sntech.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Théo Lebrun
093258a996
tty: serial: amba: cleanup whitespace
...
Fix whitespace in include/linux/amba/serial.h to match current kernel
coding standards. Fixes about:
- CHECK: spaces preferred around that '|' (ctx:VxV)
- ERROR: code indent should use tabs where possible
- WARNING: Unnecessary space before function pointer arguments
- WARNING: please, no spaces at the start of a line
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com >
Link: https://lore.kernel.org/r/20231130-mbly-uart-v5-1-6566703a04b5@bootlin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Jiri Slaby (SUSE)
675bf8ef20
tty: virtio: drop virtio_cons_early_init()
...
The last user of virtio_cons_early_init() was dropped in commit
7fb2b2d512 ("s390/virtio: remove the old KVM virtio transport").
So now, drop virtio_cons_early_init() and the logic and headers behind
too.
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org >
Acked-by: Jason Wang <jasowang@redhat.com >
Cc: Richard Henderson <richard.henderson@linaro.org >
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru >
Cc: Matt Turner <mattst88@gmail.com >
Cc: Amit Shah <amit@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: "Michael S. Tsirkin" <mst@redhat.com >
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com >
Cc: linux-alpha@vger.kernel.org
Cc: virtualization@lists.linux.dev
Link: https://lore.kernel.org/r/20231130113001.29154-1-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:37 +01:00
Paul Geurts
78d60dae9a
serial: imx: fix tx statemachine deadlock
...
When using the serial port as RS485 port, the tx statemachine is used to
control the RTS pin to drive the RS485 transceiver TX_EN pin. When the
TTY port is closed in the middle of a transmission (for instance during
userland application crash), imx_uart_shutdown disables the interface
and disables the Transmission Complete interrupt. afer that,
imx_uart_stop_tx bails on an incomplete transmission, to be retriggered
by the TC interrupt. This interrupt is disabled and therefore the tx
statemachine never transitions out of SEND. The statemachine is in
deadlock now, and the TX_EN remains low, making the interface useless.
imx_uart_stop_tx now checks for incomplete transmission AND whether TC
interrupts are enabled before bailing to be retriggered. This makes sure
the state machine handling is reached, and is properly set to
WAIT_AFTER_SEND.
Fixes: cb1a609236 ("serial: imx: implement rts delaying for rs485")
Signed-off-by: Paul Geurts <paul_geurts@live.nl >
Tested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk >
Tested-by: Eberhard Stoll <eberhard.stoll@gmx.de >
Link: https://lore.kernel.org/r/AM0PR09MB26758F651BC1B742EB45775995B8A@AM0PR09MB2675.eurprd09.prod.outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-12-08 12:02:36 +01:00
Vamshi Gajjela
d804987153
serial: 8250_dw: Decouple DLF register check from UCV
...
Designware UART has an optional feature to enable Fractional Baud Rate
Divisor (DLF) through the FRACTIONAL_BAUD_DIVISOR_EN configuration
parameter, and it is not dependent on ADDITIONAL_FEATURES.
dw8250_setup_port() checks DLF to determine dlf_size only when UART
Component Version (UCV) is non-zero. As mentioned above DLF and UCV are
independent features. Move the logic corresponding to DLF size
calculation ahead of the UCV check to prevent early return. Otherwise,
dlf_size will be zero and driver will not be able to use the
controller's fractional baud rate divisor (DLF) feature.
Signed-off-by: Vamshi Gajjela <vamshigajjela@google.com >
Link: https://lore.kernel.org/r/20231126160420.2442330-1-vamshigajjela@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-28 19:24:14 +00:00
Jiri Slaby (SUSE)
068ab2135b
tty: srmcons: remove 'str_cr' and use string directly
...
'str_cr' contains a single character: \r. There is no need to declare it
as array. Instead, pass the character (as a string) to callback_puts()
directly. This ensures the string is in proper .rodata (const) section
and makes the code more obvious.
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: linux-alpha@vger.kernel.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231127123713.14504-5-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-28 19:17:06 +00:00
Jiri Slaby (SUSE)
2ea2ac84ef
tty: srmcons: switch need_cr to bool
...
'need_cr' is a flag, so type it properly to be a 'bool'. Move the
declaration into the loop too. That ensures the variable is initialized
properly even if the code was moved somehow.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru >
Cc: Matt Turner <mattst88@gmail.com >
Cc: linux-alpha@vger.kernel.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231127123713.14504-4-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-28 19:17:06 +00:00
Jiri Slaby (SUSE)
ad18855592
tty: srmcons: use 'count' directly in srmcons_do_write()
...
Similarly to 'buf' in the previous patch, there is no need to have a
separate counter ('remaining') in srmcons_do_write(). 'count' can be
used directly which simplifies the code a bit.
Note that the type of the current count ('c') is changed from 'long' to
'size_t' so that:
1) it is prepared for the upcoming change of 'count's type, and
2) is unsigned.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru >
Cc: Matt Turner <mattst88@gmail.com >
Cc: linux-alpha@vger.kernel.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231127123713.14504-3-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-28 19:17:06 +00:00
Jiri Slaby (SUSE)
ff4b8c3a8b
tty: srmcons: make srmcons_do_write() return void
...
The return value of srmcons_do_write() is ignored as all characters are
pushed. So make srmcons_do_write() to return void.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru >
Cc: Matt Turner <mattst88@gmail.com >
Cc: linux-alpha@vger.kernel.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231127123713.14504-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-28 19:17:06 +00:00
Jiri Slaby (SUSE)
a3db64c575
tty: make tty const in tty_get_baud_rate()
...
After commit 87888fb9ac ("tty: Remove baudrate dead code & make
ktermios params const"), the 'tty' parameter is only read in
tty_get_baud_rate(). Therefore, we can make 'tty' accepted in the
function 'const' for clarity.
The "the terminal bit flags may be updated." part of the
tty_get_baud_rate()'s kernel-doc is dropped as it is no longer true.
Because of the same commit above. And it was misplaced anyway.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231127123713.14504-1-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-28 19:17:06 +00:00
Jiri Slaby (SUSE)
ab58841ab9
tty: srmcons: use 'buf' directly in srmcons_do_write()
...
There is no need to have a separate iterator ('cur') through 'buf' in
srmcons_do_write(). 'buf' can be used directly which simplifies the code
a bit.
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: linux-alpha@vger.kernel.org
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Link: https://lore.kernel.org/r/20231121092258.9334-14-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:18 +00:00
Jiri Slaby (SUSE)
2bf93a48cc
tty: nozomi: remove unused debugging DUMP()
...
DUMP()'s only use is commented out. Remove the macro completely along
with this unused use.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231121092258.9334-13-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:17 +00:00
Jiri Slaby (SUSE)
7588b08203
tty: hvc_console: use flexible array for outbuf
...
This means:
* move outbuf to the end of struct hvc_struct and convert from pointer
to flexible array (the structure is smaller now)
* use struct_size() at the allocation site
* align outbuf in the struct instead of ALIGN() at kzalloc()
And apart from the above, use u8 instead of char (which are the same
thanks to -funsigned-char). The former is now preferred over the latter.
It makes the code easier to understand.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20231121092258.9334-12-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:17 +00:00
Jiri Slaby (SUSE)
4ccef1f142
tty: hso: don't initialize global serial_table
...
'serial_table' is global, so there is no need to initialize it to NULLs
at the module load. Drop this unneeded for loop.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: Eric Dumazet <edumazet@google.com >
Cc: Jakub Kicinski <kuba@kernel.org >
Cc: Paolo Abeni <pabeni@redhat.com >
Cc: linux-usb@vger.kernel.org
Cc: netdev@vger.kernel.org
Acked-by: Jakub Kicinski <kuba@kernel.org >
Link: https://lore.kernel.org/r/20231121092258.9334-11-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:17 +00:00
Jiri Slaby (SUSE)
e4b3cd3b6a
tty: hso: don't emit load/unload info to the log
...
It's preferred NOT to emit anything during the module load and unload
(in case the un/load was successful). So drop these prints from hso
along with global 'version'. It even contains no version after all.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: Eric Dumazet <edumazet@google.com >
Cc: Jakub Kicinski <kuba@kernel.org >
Cc: Paolo Abeni <pabeni@redhat.com >
Cc: linux-usb@vger.kernel.org
Cc: netdev@vger.kernel.org
Acked-by: Jakub Kicinski <kuba@kernel.org >
Link: https://lore.kernel.org/r/20231121092258.9334-10-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:17 +00:00
Jiri Slaby (SUSE)
7cf61de7f7
tty: goldfish: drop unneeded temporary variables
...
We can pass 'buf' directly to goldfish_tty_rw() using simple (unsigned
long) cast. There is no need to obfuscate the code by another variable
with double casts.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231121092258.9334-9-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:17 +00:00
Jiri Slaby (SUSE)
9d3e3301ae
tty: ehv_bytecha: use memcpy_and_pad() in local_ev_byte_channel_send()
...
There is a helper for memcpy(buffer)+memset(the_rest). Use it for
simplicity.
And add a comment why we are doing the copy in the first place.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com >
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20231121092258.9334-8-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:17 +00:00
Jiri Slaby (SUSE)
73b2ed3675
tty: amiserial: use bool and rename overrun flag in receive_chars()
...
'oe' is a yes-no flag, switch it to boolean. And rename to overrun. All
for the code to be more obvious.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231121092258.9334-7-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:17 +00:00
Jiri Slaby (SUSE)
c35e6ec1f3
tty: amiserial: return from receive_chars() without goto
...
The 'out' label is just before 'return'. So return immediately and drop
both the label and the return. This makes the code more straightforward.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231121092258.9334-6-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:17 +00:00
Jiri Slaby (SUSE)
239123e7e8
tty: move locking docs out of Returns for functions in tty.h
...
Both tty_kref_get() and tty_get_baud_rate() note about locking in their
Return kernel-doc clause. Extract this info into a separate "Locking"
paragraph -- the same as we do for other tty functions.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231121092258.9334-5-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:17 +00:00
Jiri Slaby (SUSE)
d22d53ad8a
tty: remove unneeded mbz from tiocsti()
...
'mbz' in tiocsti() is used only to pass TTY_NORMAL to
tty_ldisc_ops::receive_buf(). But that can be achieved easier by simply
passing NULL to ::receive_buf().
So drop this 'mbz'.
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org >
Link: https://lore.kernel.org/r/20231121092258.9334-3-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-11-25 07:23:17 +00:00