control: tags 1077217 + patch Attached is a patch which fixes the linux 6.10 build for this module.
The fix provides the necessary changes to replace circular array to fifo for linux 6.10. As I don't possess this hardware so I am unable to do verification. Regards, Syed Shahrukh Hussain.
From: Syed Shahrukh Hussain <[email protected]> Date: Mon, 19 Jan 2026 22:15:00 +0500 Subject: Fix Linux 6.10 build caused by commit 1788cf6a91d9fa9aa61fc2917afe192c23d67f6a --- a/adv17v35x.c +++ b/adv17v35x.c @@ -50,6 +50,7 @@ #include <linux/serial_reg.h> #include <linux/serial.h> #include <linux/serial_core.h> +#include <linux/kfifo.h> #include <asm/io.h> #include <asm/irq.h> @@ -826,11 +827,13 @@ { #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) struct circ_buf *xmit = &up->port.info->xmit; -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) struct circ_buf *xmit = &up->port.state->xmit; +#else + struct kfifo *xmit_fifo = (struct kfifo *)&up->port.state->port.xmit_fifo; #endif int count, bytes_in_fifo; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) int tmp; #endif @@ -848,7 +851,11 @@ #endif return; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) if (uart_circ_empty(xmit)) { +#else + if (kfifo_is_empty(xmit_fifo)) { +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14) serialadv_stop_tx(&up->port, 0); #else @@ -864,9 +871,14 @@ // how much buffer is availabe now to write? count = up->port.fifosize - bytes_in_fifo; - +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) if (uart_circ_chars_pending(xmit) < count) count = uart_circ_chars_pending(xmit); +#else + if (kfifo_len(xmit_fifo) < count) { + count = kfifo_len(xmit_fifo); + } +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14) if(count > 0) @@ -875,7 +887,7 @@ memcpy_toio(up->port.membase + UART_17V35X_TX_OFFSET, &(xmit->buf[xmit->tail]), 1); xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); } -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) do { // if the count is more than (tail to end of the buffer), transmit only the rest here. @@ -890,7 +902,7 @@ count -= tmp; } else - { + { memcpy_toio(up->port.membase + UART_17V35X_TX_OFFSET, &(xmit->buf[xmit->tail]), count); xmit->tail += count; xmit->tail &= UART_XMIT_SIZE - 1; @@ -899,15 +911,32 @@ } }while (count > 0); +#else + do { + unsigned char c; + if (kfifo_get(xmit_fifo, &c) == 0) { + break; + } + memcpy_toio(up->port.membase + UART_17V35X_TX_OFFSET, &c, 1); + up->port.icount.tx++; + count--; + }while (count > 0); #endif - +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) +#else + if (kfifo_len(xmit_fifo) < WAKEUP_CHARS) +#endif uart_write_wakeup(&up->port); - DEBUG_INTR("THRE..."); + DEBUG_INTR("THRE..."); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) if (uart_circ_empty(xmit)) +#else + if (kfifo_is_empty(xmit_fifo)) +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14) serialadv_stop_tx(&up->port, 0); #else
signature.asc
Description: PGP signature

