From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 0D1C52D8767 for ; Tue, 18 Aug 2026 18:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787079125; cv=none; b=svRvXzKRvEj3FQu2i3u0khOF05U9/lKwXtjbFYyZCE7NmEi2TjUr+6LPW5ScXomWNuqOYWnu5GMEVHl1MaowR3L0imy9aze4//qxfaq9/eNinxaCEbMGYFqhAkWXmaY9sbE9QpkgkKFgt0PCKXLfdo2yazwC9uFZAJH8v0b2Gaw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787079125; c=relaxed/simple; bh=Hrs/9NMsr5HJTULUw2It4HagL6BuCS8FHkZ5uh6OwzI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Vc7Xd5G8uow2WZHezebwLiUs1qB5uUOORErrcBqonH09kzjjh4EhlyJ5ReAViIVU22WANAA3+ftRbYeNpxnyAS4giMQpYUDXAVfF35YDr+hLtIBVbUjt7QTbaPxCzt9PjGeLQMkawj2LordvGUzHbiOKO9m+fzaYxGk6rEk2siE= 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.47 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-f47.google.com with SMTP id 5b1f17b1804b1-4953de5be0aso1524155e9.0 for ; Tue, 18 Aug 2026 11:52:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787079122; x=1787683922; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=qZ5z7fwve5FMy5m1IMm5ZFxSUCweCqJ2mA7pSyCd4EE=; b=r1kN9RQW+CbDBQWjoR2PPlAjl8takD3MhQ1G3tVPlJnOONBnBuOs7rL7Y1t2Cs47Bi 4GnaAxCeO9vnFRrko6ywmtdcPl9gRa0VZbJXWf1ga1xT166+0Un5hC+7WyRkgx36MBdl uqkCc3weVCSoMYxvvf56i3K+DAHd2f/pyECvz+Z51NbOlPFDVWwdGy/vklwoV4xDUZAr I2QEMmD8SGUsOce6mpn+/jnCinIBqfh7N8EB5O13a/pEl8aRN3yUvW6W04SJo7r4a70G SRlD+ulwevWtk9Z0ZS5fKrRdgrjycXl8UkS+bvR9E6BCSdJLIMnXCu6CYhiRMqCkCPfD uvqQ== X-Gm-Message-State: AOJu0YxSy4Q3AI52D5FuApWKI4ubKaTG5AmKJee5A0yIaXBYAXFHRLho 4dwTgXKf+oxDiqG19aUXw7yd91oCa1fEXjqEkHG8btcpmKh8KmELLkhDuuzuZw== X-Gm-Gg: AR+sD11KvlG7bIQ1ByGWrEW/saVB0OIOOKZroIul+3JpGgt5M+nSaIRaR/ZPBPTd58x 5lnSRluzXauAHi738RAAX3oSKztd9IRjokS+Q95Ojpd+XFVaeWjXN2MUkvPW8GS8k+lFWjDs5Ze BVQ7s9oMNcJ2ODQABLYk55A/37klf1TRb9VeEMcU9az8KWkqEiF79H0WV+jmMt19Tc7xE94wzPI Gw3ETu0KAfja5/y+/IDGMMqya+fuXO3A/ibawXjT2zlnz+r7PxmXbndUy3wf1K7H6Q6ZFVJ1oso Mejmzx7vPkMxhkZ4Tbuyc+w9eeKn5P0LlwNJmKQVEPLzS1ENw9c5fH9ONQVe8K5S4c/SFgXCNf4 icPh5q17mZugfGl5PplafKuiqgUWOTk52F2QBh+AvHuOiCwt3VgdI5yIwXT5Pk4dsHMNbp3SFFZ uC7G8KVI74p7zdQH/Y4rla5Ds0MAFBp/cBeMEpe5r4nDQEsgI6tKQ8DaZM5eK5kD+lvBUYyNw9E zQl/sGz9lmaurz8ryqOuNKuiGw= X-Received: by 2002:a05:600c:8b6f:b0:493:bd2a:93be with SMTP id 5b1f17b1804b1-499a8f62d13mr2823225e9.6.1787079122068; Tue, 18 Aug 2026 11:52:02 -0700 (PDT) Received: from threads.localdomain ([83.106.158.114]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482a5b816c0sm14257310f8f.33.2026.08.18.11.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2026 11:52:01 -0700 (PDT) From: Lucas Tanure To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH] serial: 8250: don't register ports that have no hardware Date: Tue, 18 Aug 2026 19:52:00 +0100 Message-ID: <20260818185200.10243-1-tanure@linux.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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; + up->port.dev = dev; if (uart_console_registered(&up->port)) -- 2.55.0