Linux Serial subsystem development
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Hugo Villeneuve" <hugo@hugovil.com>, "Arnd Bergmann" <arnd@kernel.org>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev
Subject: Re: [PATCH 1/2] tty: serial: remove hub6 multiport support
Date: Fri, 16 Oct 2026 18:16:20 +0200	[thread overview]
Message-ID: <5743b352-ffa2-4d38-9abb-a06085dea56d@app.fastmail.com> (raw)
In-Reply-To: <20261016115604.a89ef44986bb3620c327feaf@hugovil.com>

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

  reply	other threads:[~2026-10-16 16:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 12:59 [PATCH 1/2] tty: serial: remove hub6 multiport support Arnd Bergmann
2026-10-16 12:59 ` [PATCH 2/2] [v2] serial: 8250: remove obsolete and broken PORT_RSA support Arnd Bergmann
2026-10-16 13:14   ` Arnd Bergmann
2026-10-16 13:28 ` [PATCH 1/2] tty: serial: remove hub6 multiport support Andy Shevchenko
2026-10-16 14:41   ` Arnd Bergmann
2026-10-16 13:32 ` Andy Shevchenko
2026-10-16 14:10 ` Hugo Villeneuve
2026-10-16 15:56 ` Hugo Villeneuve
2026-10-16 16:16   ` Arnd Bergmann [this message]
2026-10-16 17:17     ` Hugo Villeneuve
2026-10-16 16:48 ` Hugo Villeneuve
2026-10-16 17:12   ` Arnd Bergmann
2026-10-16 17:16     ` Hugo Villeneuve
2026-10-16 18:28 ` Frank Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5743b352-ffa2-4d38-9abb-a06085dea56d@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hugo@hugovil.com \
    --cc=hvilleneuve@dimonoff.com \
    --cc=imx@lists.linux.dev \
    --cc=jirislaby@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox