linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/18] serial: samsung: gs101 updates and winter cleanup
@ 2024-01-10 10:20 Tudor Ambarus
  2024-01-10 10:20 ` [PATCH 01/18] tty: serial: samsung: prepare for different IO types Tudor Ambarus
                   ` (17 more replies)
  0 siblings, 18 replies; 52+ messages in thread
From: Tudor Ambarus @ 2024-01-10 10:20 UTC (permalink / raw)
  To: krzysztof.kozlowski, alim.akhtar, gregkh, jirislaby
  Cc: linux-arm-kernel, linux-samsung-soc, linux-kernel, linux-serial,
	andre.draszik, peter.griffin, kernel-team, willmcvicker,
	Tudor Ambarus

Hi,

The patch set is intended for v6.9 and is expected to be queued through
Greg's tty tree.

The patch set includes updates for GS101 so that we infer the IO type
from the compatible. This is because the GS101 Peripheral Blocks, which
include the serial, only allow 32-bit register accesses. So instead of
specifying the reg-io-width = 4 property everywhere, deduce the iotype
from the compatible. The GS101 patches were previously proposed at:
Link: https://lore.kernel.org/linux-arm-kernel/20240109125814.3691033-1-tudor.ambarus@linaro.org/

The patch set then includes some cleanup changes that started as a
consequence of trying to reduce the memory footprint of the
``struct s3c24xx_uart_info``. For arm32 the struct was not as bad
defined as for arm64, because all its members could fit in the same
cacheline. But for arm64 we started from:

struct s3c24xx_uart_info {
	const char  *              name;                 /*     0     8 */
	enum s3c24xx_port_type     type;                 /*     8     4 */
	unsigned int               port_type;            /*    12     4 */
	unsigned int               fifosize;             /*    16     4 */

	/* XXX 4 bytes hole, try to pack */

	long unsigned int          rx_fifomask;          /*    24     8 */
	long unsigned int          rx_fifoshift;         /*    32     8 */
	long unsigned int          rx_fifofull;          /*    40     8 */
	long unsigned int          tx_fifomask;          /*    48     8 */
	long unsigned int          tx_fifoshift;         /*    56     8 */
	/* --- cacheline 1 boundary (64 bytes) --- */
	long unsigned int          tx_fifofull;          /*    64     8 */
	unsigned int               def_clk_sel;          /*    72     4 */

	/* XXX 4 bytes hole, try to pack */

	long unsigned int          num_clks;             /*    80     8 */
	long unsigned int          clksel_mask;          /*    88     8 */
	long unsigned int          clksel_shift;         /*    96     8 */
	long unsigned int          ucon_mask;            /*   104     8 */
	unsigned int               has_divslot:1;        /*   112: 0  4 */

	/* size: 120, cachelines: 2, members: 16 */
	/* sum members: 104, holes: 2, sum holes: 8 */
	/* sum bitfield members: 1 bits (0 bytes) */
	/* padding: 4 */
	/* bit_padding: 31 bits */
	/* last cacheline: 56 bytes */
};

and after the cleaning we get to:

    struct s3c24xx_uart_info {
            const char  *              name;                 /*     0     8 */
            enum s3c24xx_port_type     type;                 /*     8     4 */
            unsigned int               port_type;            /*    12     4 */
            unsigned int               fifosize;             /*    16     4 */
            u32                        rx_fifomask;          /*    20     4 */
            u32                        rx_fifoshift;         /*    24     4 */
            u32                        rx_fifofull;          /*    28     4 */
            u32                        tx_fifomask;          /*    32     4 */
            u32                        tx_fifoshift;         /*    36     4 */
            u32                        tx_fifofull;          /*    40     4 */
            u32                        clksel_mask;          /*    44     4 */
            u32                        clksel_shift;         /*    48     4 */
            u32                        ucon_mask;            /*    52     4 */
            u8                         def_clk_sel;          /*    56     1 */
            u8                         num_clks;             /*    57     1 */
            u8                         iotype;               /*    58     1 */
            u8                         has_divslot:1;        /*    59: 0  1 */
    
            /* size: 64, cachelines: 1, members: 17 */
            /* padding: 4 */
            /* bit_padding: 7 bits */
    };

Also note that sorting the include files in alphabetic order in the
driver revealed some problems that were fixed with the following
patches:
Link: https://lore.kernel.org/linux-arm-kernel/20240110074007.4020016-1-tudor.ambarus@linaro.org/
Link: https://lore.kernel.org/linux-kernel/20240109141045.3704627-1-tudor.ambarus@linaro.org/

Cheers,
ta

Tudor Ambarus (18):
  tty: serial: samsung: prepare for different IO types
  tty: serial: samsung: set UPIO_MEM32 iotype for gs101
  tty: serial: samsung: add gs101 earlycon support
  tty: serial: samsung: sort headers alphabetically
  tty: serial: samsung: explicitly include <linux/types.h>
  tty: serial: samsung: use u32 for register interactions
  tty: serial: samsung: remove braces on single statement block
  tty: serial: samsung: move open brace '{' on the next line
  tty: serial: samsung: drop superfluous comment
  tty: serial: samsung: make max_count unsigned int
  tty: serial: samsung: don't compare with zero an if (bitwise
    expression)
  tty: serial: samsung: use TIOCSER_TEMT for tx_empty()
  tty: serial: samsung: return bool for s3c24xx_serial_txempty_nofifo()
  tty: serial: samsung: return bool for s3c24xx_serial_console_txrdy()
  tty: serial: samsung: change return type for
    s3c24xx_serial_rx_fifocnt()
  tty: serial: samsung: shrink the clock selection to 8 clocks
  tty: serial: samsung: shrink port feature flags to u8
  tty: serial: samsung: shrink memory footprint of ``struct
    s3c24xx_uart_info``

 drivers/tty/serial/samsung_tty.c | 239 ++++++++++++++++++-------------
 1 file changed, 136 insertions(+), 103 deletions(-)

-- 
2.43.0.472.g3155946c3a-goog


^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2024-01-19 10:02 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-10 10:20 [PATCH 00/18] serial: samsung: gs101 updates and winter cleanup Tudor Ambarus
2024-01-10 10:20 ` [PATCH 01/18] tty: serial: samsung: prepare for different IO types Tudor Ambarus
2024-01-16 18:12   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 02/18] tty: serial: samsung: set UPIO_MEM32 iotype for gs101 Tudor Ambarus
2024-01-16 18:12   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 03/18] tty: serial: samsung: add gs101 earlycon support Tudor Ambarus
2024-01-16 18:14   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 04/18] tty: serial: samsung: sort headers alphabetically Tudor Ambarus
2024-01-16 18:13   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 05/18] tty: serial: samsung: explicitly include <linux/types.h> Tudor Ambarus
2024-01-16 18:14   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 06/18] tty: serial: samsung: use u32 for register interactions Tudor Ambarus
2024-01-16 18:17   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 07/18] tty: serial: samsung: remove braces on single statement block Tudor Ambarus
2024-01-16 18:17   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 08/18] tty: serial: samsung: move open brace '{' on the next line Tudor Ambarus
2024-01-16 18:18   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 09/18] tty: serial: samsung: drop superfluous comment Tudor Ambarus
2024-01-16 18:18   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 10/18] tty: serial: samsung: make max_count unsigned int Tudor Ambarus
2024-01-16 18:21   ` Sam Protsenko
2024-01-17 15:21     ` Tudor Ambarus
2024-01-17 15:38       ` André Draszik
2024-01-17 15:54         ` Tudor Ambarus
2024-01-17 16:27           ` Sam Protsenko
2024-01-17 16:26         ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 11/18] tty: serial: samsung: don't compare with zero an if (bitwise expression) Tudor Ambarus
2024-01-16 18:38   ` Sam Protsenko
2024-01-17 15:41     ` Tudor Ambarus
2024-01-17 16:24       ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 12/18] tty: serial: samsung: use TIOCSER_TEMT for tx_empty() Tudor Ambarus
2024-01-16 18:46   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 13/18] tty: serial: samsung: return bool for s3c24xx_serial_txempty_nofifo() Tudor Ambarus
2024-01-16 18:52   ` Sam Protsenko
2024-01-10 10:20 ` [PATCH 14/18] tty: serial: samsung: return bool for s3c24xx_serial_console_txrdy() Tudor Ambarus
2024-01-16 18:54   ` Sam Protsenko
2024-01-17 15:57     ` Tudor Ambarus
2024-01-10 10:20 ` [PATCH 15/18] tty: serial: samsung: change return type for s3c24xx_serial_rx_fifocnt() Tudor Ambarus
2024-01-16 18:58   ` Sam Protsenko
2024-01-10 10:21 ` [PATCH 16/18] tty: serial: samsung: shrink the clock selection to 8 clocks Tudor Ambarus
2024-01-16 19:09   ` Sam Protsenko
2024-01-17 16:26     ` Tudor Ambarus
2024-01-17 16:31       ` Sam Protsenko
2024-01-10 10:21 ` [PATCH 17/18] tty: serial: samsung: shrink port feature flags to u8 Tudor Ambarus
2024-01-16 19:03   ` Sam Protsenko
2024-01-19  8:56     ` Tudor Ambarus
2024-01-19  9:07       ` Jiri Slaby
2024-01-19  9:43         ` Tudor Ambarus
2024-01-19  9:54           ` Jiri Slaby
2024-01-19 10:02             ` Tudor Ambarus
2024-01-10 10:21 ` [PATCH 18/18] tty: serial: samsung: shrink memory footprint of ``struct s3c24xx_uart_info`` Tudor Ambarus
2024-01-16 19:14   ` Sam Protsenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).