Re: [PATCH 1/2] tty: serial: remove hub6 multiport support

From: Arnd Bergmann

Date: Fri Oct 16 2026 - 12:24:39 EST


On Fri, Oct 16, 2026, at 17:56, Hugo Villeneuve wrote:
> On Fri, 16 Oct 2026 14:59:47 +0200

>> retinfo->custom_divisor = uport->custom_divisor;
>> - retinfo->hub6 = uport->hub6;
>> + retinfo->hub6 = 0;
>
> Would a comment here help?
>
> retinfo->hub6 = 0; /* No longer supported */

Good idea, added.

>> @@ -924,7 +921,6 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
>> change_port = !(uport->flags & UPF_FIXED_PORT)
>> && (new_port != uport->iobase ||
>> (unsigned long)new_info->iomem_base != uport->mapbase ||
>> - new_info->hub6 != uport->hub6 ||
>
> Maybe keep this so that change_port is true if someone sets hub6 to a
> value other than zero (see below)?

Right, this would be fairly harmless as nothing looks at the field
afterwards but it makes sense for consistency.

I've moved the hub6 check up before change_port now to behave the
same way for regular users and root:

@@ -935,6 +935,11 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
if (uartclk == 0)
return -EINVAL;
}
+
+ /* hub6 is no longer supported */
+ if (new_info->hub6 != 0)
+ return -EINVAL;
+
if (!capable(CAP_SYS_ADMIN)) {
if (change_irq || change_port ||
(new_info->baud_base != uport->uartclk / 16) ||
@@ -950,10 +955,6 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
goto check_and_exit;
}

- /* hub6 is no longer supported */
- if (new_info->hub6 != 0)
- return -EINVAL;
-
if (change_irq || change_port) {
retval = security_locked_down(LOCKDOWN_TIOCSSERIAL);
if (retval)

Thanks for taking a look!

Arnd