From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.84.56 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796210967; b=x9FfauJUBHs9MuM/nAmFI+lA5g6QDjM4q0d6mgOBSM7vBxFWEw+mUBSMhhu7aq2HtASS l3O9CQEpV5R1zedPHR3fvKPikhLuVIXKh6ZuaZcKwNjCTmy74uFQd5G7sWiWKy2jSigR7 8ehJ/35By/r4X6lKAW46yVBzRqJvnmC/JwX1B52jtn3D/tySlgQQKdLidruQFvyBlEtnr ieQNFn2Oq76aiJzpn0Ey/WBauchW0+g7N7BCWkZe+WCcSCne+TOT71dbAq2Jgo8ijxT2Y YvgzpGlv0YaAq7VnWgWnrQbl01jFe8Z3L3nMIE8BeLstTJG6iS5xpQf4sVltnXf/EYQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796210967; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:To:Cc: Subject:In-Reply-To:References:User-Agent:Date:Message-ID: MIME-Version:Content-Type:X-Last-TLS-Session-Version; bh=lZ0sMPTK4VAYWx3B455B8pYG+VOMKTdi5Q3topTnSDo=; b=BsThHD+tREr/nlbNuqJoEiNnHLTIH2XeQ/Lj2lvhtMJDpKnB4lRLxypd2K8xtn9BlRXC wRCchk9W5K0VTxkS9s/QJnZqNQWN9gVawlnkxngaBf1iat7+/RuTjomzKbgMJ7YkAa5p5 3XrnD9be8u/fgQIIYrMlc67n1bxILP2y1rhWqfiJk83eYkXjPrsTriZVt2bOZVFhfepVu hBQTcw1NI9Rd2VmxYPYS/FMQpcjBXb5D4Otr5o3N5OlqolnwUuHS/ZUC9A5c9Uc6aZxfo YZu+5gpoHrPGbiC6KJMQJEvzMss026vaDq/F6Q96t7rhJKtvpzwu5nlep639AvhqIMg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=kJxZPjne; arc=none smtp.remote-ip=185.246.84.56 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 032C1606A32F for ; Wed, 2 Dec 2026 11:29:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 032C1606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=kJxZPjne Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 165A71A18B1; Wed, 2 Dec 2026 11:29:25 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D4A376075F; Wed, 2 Dec 2026 11:29:24 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E7E1A11EA288B; Wed, 02 Dec 2026 12:29:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796210964; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=lZ0sMPTK4VAYWx3B455B8pYG+VOMKTdi5Q3topTnSDo=; b=kJxZPjnefQFf9Eomcf7LslDJbLWjzX2mUsw7c7WeuR/6itwgJAE1BlKiTkKqiF0oHyLqi4 jDvwAmiuvBflMgL8d7Sq+AelbI4hXaG0+J5efxFzdd9z7BwGZIajRWophn8yjPpjPy7cvK c9MkmtL0pw6zhMgOYsZNgrc+GzfM0VAxgdcXtObQZ+eWHY4KIiH3Y2GJueSosfq3vgmkMB Af6Zk0qBRSzeCMPJnxv6X5bPSXaqIWILzF/Qfe2h18E+0p0n7kZWx7jKEZj2WENSdhAKeI G0lneCRDTFyDk6pGfckkdkssnGt0Twb0UwM4mYSymv3MuNn6zEC63BRS8hWyhQ== From: Miquel Raynal To: Arina Kharlamova via B4 Relay Cc: Pali =?utf-8?Q?Roh=C3=A1r?= , Greg Kroah-Hartman , Jiri Slaby , Gregory CLEMENT , arina.kharlamova@mbzuai.ac.ae, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH] serial: mvebu-uart: do not leave a stale port behind when probe fails In-Reply-To: <20261201-v08b-v1-1-add40eb9ffee@mbzuai.ac.ae> (Arina Kharlamova via's message of "Tue, 01 Dec 2026 23:19:52 +0400") References: <20261201-v08b-v1-1-add40eb9ffee@mbzuai.ac.ae> User-Agent: mu4e 1.12.12; emacs 30.2 Date: Wed, 02 Dec 2026 12:29:20 +0100 Message-ID: <874icvor8v.fsf@bootlin.com> X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain X-Last-TLS-Session-Version: TLSv1.3 On 01/12/2026 at 23:19:52 +04, Arina Kharlamova via B4 Relay wrote: > From: Arina Kharlamova > > mvebu_uart_probe() stores the devm mapping in mvebu_uart_ports[] before > it gets the clock and the interrupts. If one of them fails or defers, > devres unmaps the registers and frees the private data, but the static > port keeps membase, mapbase and private_data. > > mvebu_uart_console_setup() only checks membase and mapbase. When > another port registers the console first, for example with > console=ttyMV1 and ttyMV1 still waiting for its clock, the setup > callback uses the stale port and accesses the unmapped registers. > > Keep the mapping in a local variable and store it in the port only > after the last step that can fail before uart_add_one_port(). > > Fixes: 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate") > Signed-off-by: Arina Kharlamova Reviewed-by: Miquel Raynal