From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB8D93FCC for ; Wed, 19 Aug 2026 06:31:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787121088; cv=none; b=E03/qzLxMriDehhXbGwsuhOcMLyxcapHXsGXgzRVVxWGBOVkk4We96xzT4NcSCVGXDF5uZJAk/vPU2j4byWamqnwvQDpMqBaTH2JDY7hGrXmL8Y+LVPfezm529qOwbaNCJ+tRIH/c/k1vG3A+tQLNDY4pyrjeFoMYC353Pq2xvA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787121088; c=relaxed/simple; bh=E7U2pdBSzmPRbhEDk1+nhVwIHgjPvU3itGr9fyRVplI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=m/e8FVUAY0iXKH+CIbBnlZyl35BCKyc5JYCFhMBInESN9F8jPyto1Ud5XLyX0vHiaZvi+1qbI8BUE6jHb3Cot9yxmpO4f7y0MUIRNrx6jkgWeqn8pBjR7fEGRlHo+6ioAuasTZnE1BML9n53IxvGAY8an3Dz7O+S5REFcSaM/qM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-499840a2575so4569955e9.3 for ; Tue, 18 Aug 2026 23:31:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787121085; x=1787725885; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=CeMbRRpxJhABtTKZKYmvLntVqaXrQydJ0AK3LdgfC2k=; b=bEUsAsTC4qTy+A1YH8gNf7dqdOmyYv6gCeD24vw7G0RVN5MDOHQl1dK81AJYjgaBIT kIG2KYS170cRbs347O0E3Ginjjn/UcAmvPCWIbeLsCsyjNgW/rqBMBVjXiglu3e/MYgY I6+COBeDCUiuVfTc0GVAN9LYK0C9GU7D1+xasSAXGfVadSv/Hb4MxDKUd7mbiCE4cq4p kT9dGmx1jyHSlw9yvwsRCGcB0obzU9UTN0mg11IEKK4LYTwS2beoneX4zHjS0NqIiVIL SLIRSo8UPOACcfRhvAioP9nqTGWq+fLRF5S1Pcy3zfYqNU5rNkRc8M0G/IZ52tUuKY1i nOmA== X-Gm-Message-State: AOJu0Yx6lA4BStuKdlScp+iah04Yv4hmdE0znp5Q5+CEdyeJXdHMW3nz cmC10XGoK2cMd5GoXw0Bi2VzeB3kmw9aH3n5ZH94CrsBd/Pms/sj1XKv X-Gm-Gg: AR+sD13DkGZGJHUMiMZgz0HZlv0s4P7DBCgfYNdbJgyXCtrt7/AGfAFd+XTlc+D5mH5 ay1iK0QOQbT/019e5ylzroi6a4+rV0dR48zwOZLgdbwyXazC0z/em3CAyVbb+mt4da2KUC8BhLZ yBo8qk/9dU7Dt0wLwVLs0zNHXvAMtkAdKkIguxWu5tBj6ZwDb2myKgWBAB9jS3mWAqX0UoANeVX ygf+rNzn1MxVvqmUylKSAUW3iQ0KID910tlZGxBNnRm+n+zIPwh4OBCEs+ENTWEBWzCsS+otZT1 nliKBU4sZxEcxvw+2dM3vXZeYP3xGlrf3Zv3EqRTjXnX2m80PDu1TeZdxcc7JknYwZKqOx8cR8A aQY7WJOI5KlyA6/RqF85dMfUvXCNG/GNiBhuCUf8dKZG6+TZ1h3eiW713MxC2TIZLEZ/RjKuq7R IOzB/Iwh6hBwyqh0eON50yr2w5F8BwPbmQVH01MqfVYqX1tyrDBuFiZxNA+Pe91LVgzMuMNH4ur ItUEY78haHG7AP8zWSJFQ== X-Received: by 2002:a05:600c:4e94:b0:499:84fe:5f3e with SMTP id 5b1f17b1804b1-499aa1b6a0dmr29726595e9.9.1787121084843; Tue, 18 Aug 2026 23:31:24 -0700 (PDT) Received: from [192.168.1.135] ([83.106.158.114]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499aa0dd5fcsm41013435e9.14.2026.08.18.23.31.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Aug 2026 23:31:24 -0700 (PDT) Message-ID: <52d1dcfc-9eea-4786-a7e7-13a011b7f1e9@linux.com> Date: Wed, 19 Aug 2026 07:31:23 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] serial: 8250: don't register ports that have no hardware To: Jiri Slaby , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org References: <20260818185200.10243-1-tanure@linux.com> Content-Language: en-US From: Lucas Tanure In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 19/08/2026 05:42, Jiri Slaby wrote: > On 18. 08. 26, 20:52, Lucas Tanure wrote: >> The 8250 driver creates a fixed set of port slots at boot and >> registers a ttyS device for each one, even when the slot describes no >> hardware. On device tree platforms those slots are empty, but they >> still take the ttyS0..ttyS3 names. >> >> New Amlogic SoCs (S4, T7) name their real UARTs ttyS as well. With >> both drivers built in, as in arm64 defconfig, the real port fails to >> bind: >> >>    sysfs: cannot create duplicate filename '/class/tty/ttyS0' >>    meson_uart fe078000.serial: Cannot register tty device on line 0 >> >> Skip slots that have no I/O and no memory address. Legacy x86 slots >> come with resources and are not affected. >> >> Signed-off-by: Lucas Tanure >> Assisted-by: Claude:claude-fable-5 >> --- >>   drivers/tty/serial/8250/8250_core.c | 8 ++++++++ >>   1 file changed, 8 insertions(+) >> >> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/ >> serial/8250/8250_core.c >> index f49862d90eeb..e66e0cdbb210 100644 >> --- a/drivers/tty/serial/8250/8250_core.c >> +++ b/drivers/tty/serial/8250/8250_core.c >> @@ -378,6 +378,14 @@ void __init serial8250_register_ports(struct >> uart_driver *drv, struct device *de >>           if (up->port.dev) >>               continue; >> +        /* >> +         * Skip slots that describe no hardware: they would only >> +         * take up ttyS names. Real ports get their node when >> +         * they claim a slot in serial8250_register_8250_port(). >> +         */ >> +        if (!up->port.iobase && !up->port.mapbase && !up->port.membase) >> +            continue; > Hi, I am working on upstreaming the Khadas VIM4 (Amlogic T7). On that board the serial console does not come up at all: meson_uart fails to register because the 8250 stub ports already own the ttyS names. > So you can no longer set up those ports via TIOCSSERIAL? > > And what about already registered consoles? > > Why does meson register ttyS* in the first place? Because of commit e71aab9d6132 ("tty: serial: meson: apply ttyS devname instead of ttyAML for new SoCs"). meson_uart carries two uart_drivers, ttyAML and ttyS, and A1, S4 and T7 are wired to the ttyS one. > > F*ck AI proposed changes. > > thanks, I will talk to Amlogic list to see if there is other solution. thanks, lucas