Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp662413rdh; Wed, 14 Feb 2024 07:57:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU4U5Pgm6h/w/BNvCxR6crb5t+Nox76ob4WDmz8H+v8X1mvQAO47A3fgeQK+CXjyS2MsN3KRUDQB/TYoafl58mOf+EhEPAhXpmRL+yV+w== X-Google-Smtp-Source: AGHT+IGyI/3e1orbrKPozc9vbJKowQ3x1+1AILRGe14h3reNoG6JpyOH5bLgFgWIoTDld4Qz+a4I X-Received: by 2002:a05:6808:1387:b0:3c0:34b4:ee0f with SMTP id c7-20020a056808138700b003c034b4ee0fmr3250304oiw.53.1707926237806; Wed, 14 Feb 2024 07:57:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707926237; cv=pass; d=google.com; s=arc-20160816; b=KXkzowinmQ+IoUNKWR2STtWoAvb/8lutIEIvbKW8zDrPeM22bKHZFnsa/4Fn2+A13k rqjHFMniYwY9JVysIhzedNaR7VfTH5EGgGTyluPA2ymM/54NxNSREFGMkgafztZyPOht /NFkq0J8COwGhSf//EMHj4xpLsW38huHH/JKbzrrnYpGvYisMtwt90aZOWl92JmLpvUx 8SUdKuW+oFXmvBTLO1EdhgAyDK0Jv3P//9d3meypZbbKQVc+2ry0yYC++ChyezEl8PG+ jX8CiUQ5tPjvCrrJRTBAjiMo8WnenDnD0tNF4OW03MACBw9NXKXexezMRgOLGRKxCCMw Mkgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=epmC+2s8K6rmNoOOLWhs9oyPeZI6TONYvP2xJK0LQN4=; fh=wpfSyEb1WD5kGjvYM4wfYSx/KvkbXPmJZ3eXbU8LAW4=; b=aSzqeaRHzr6r8VCwHioaeNUS+uYoRsCbOn/NsSHW6Jvrj6D6SgCd8BOaDwr1v8V/yn RFJQqp7e3ceeovWD4z8LLD3HE1TJ001OOCi57QRINnJSRUf/7runHOEqunI3NJXkvviF N1vyVNHBHtAYDVuimRgHN4YaouzxPEu4jmtueUDPusy7O6ig54Z/U3AdTi7XjJDTGWe8 w+gHzc16ur5xLPP83P7UUMGv9O051GEC0p1g5ELPWmX2CMVh8o1jhlvvWt7eT0tVe0YA PQlH5ddh51K1mC7e8HwlTtuml8SfhlW25/yYytESjmlPvW5Kj+o2FSPdtDKecz6AIb1C OgJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lvqkGmDf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-65466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWb3WLLjcJz9f7lCfNS+rgIs31JFWHv98c9ZWrmcmao1alKn+2a1kCu8vWaqLkMtb4YnzBmUEwAeU6mcj0KLI9lgsoN/TP8rU5paupVDg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gi4-20020a056214248400b0068ceaf50961si5776986qvb.208.2024.02.14.07.57.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 07:57:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lvqkGmDf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-65466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6917A1C2894B for ; Wed, 14 Feb 2024 15:55:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99B905FBB4; Wed, 14 Feb 2024 15:55:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lvqkGmDf" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE9076024D; Wed, 14 Feb 2024 15:55:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707926102; cv=none; b=IXbfysFMRzNJeRuHDJXIKMpAk6XzbC1dmwcwZIfsgqS5G+giRtWyEeFsyQl6T0pao5o4lyZ55yF++5E0OvKyspZXJD2R9une2fZmF6c/RI33mz3mrNQY9advbRI3y31xmBWdcaVG07MWiQfFo5tWd1WVLsk+XMCVzH1aDqqQrbk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707926102; c=relaxed/simple; bh=I5QmVlSxsPE/Gk4+HnD06ucKGeusZCkAT0pMy1rJFdk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nE+vTZTAV5yH8Eu85rN2Ncr/q3GZ5T9WXQA8shFZeYM5Afm6ZRip4fttGIkraKbn0VzY9yWBzSEKP/wF/SfE5pNvVV9WbESeXMG9XgxT7HtEg8sPDQSm9dw6SCsxh9UUAYyEZDc/gIvE5SQa5KmrmR7/CJOBhEBv7amR/7ngjwc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lvqkGmDf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00213C43399; Wed, 14 Feb 2024 15:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707926102; bh=I5QmVlSxsPE/Gk4+HnD06ucKGeusZCkAT0pMy1rJFdk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lvqkGmDfiWK0/udDnfCBRaDRe2kArttC6QTkDsM1BxGHPZTBnbzWYTP4veP3ZargP aa80u28eGTmb3HYZ6oGtKR65HcpjxycM1VMzPS4fYFTC0EbeI+rblhYH5Pxe8kkoTk piWqBbRlZ3WUN8Ur08uVW+pleZvBCYBuFxtDvJH0kTxKRxdrLHSaweAq9p/Ya8HFOM sD0nomU3aUbzp3g/hO/j9ABxNQ+PevDhv8jT7tFPC+GjPBI0HImRZV6jPzw3axLIAC CzUwM/eHkXlHKHd9XW1i4L3SQ30mWBeGeaEFgIOQeI9Ks+AjSmvK9B5bf7NlwGMfJr fmbaBGfW564vw== Date: Wed, 14 Feb 2024 15:54:57 +0000 From: Conor Dooley To: Palmer Dabbelt Cc: linux-riscv@lists.infradead.org, Greg KH , jirislaby@kernel.org, Atish Patra , ajones@ventanamicro.com, apatel@ventanamicro.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Emil Renner Berthing Subject: Re: [PATCH] tty: hvc: Don't enable the RISC-V SBI console by default Message-ID: <20240214-impound-gumdrop-230d0725f5ce@spud> References: <20240214153429.16484-2-palmer@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZpSavjsIcxHJ5llO" Content-Disposition: inline In-Reply-To: <20240214153429.16484-2-palmer@rivosinc.com> --ZpSavjsIcxHJ5llO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 14, 2024 at 07:34:30AM -0800, Palmer Dabbelt wrote: > From: Palmer Dabbelt >=20 > The new SBI console has the same problem as the old one: there's only > one shared backing hardware and no synchronization, so the two drivers > end up stepping on each other. This was the same issue the old SBI-0.1 > console drivers had, but that was disabled by default when SBI-0.1 was. >=20 > So just mark the new driver as nonportable. >=20 > Reported-by: Emil Renner Berthing > Fixes: 88ead68e764c ("tty: Add SBI debug console support to HVC SBI drive= r") > Signed-off-by: Palmer Dabbelt As was brought up when we covered this earlier today, if you're going to probe a driver based on an ecall, the same hardware should not remain enabled in the DT passed to the kernel. If you want to enable this driver in a multiplatform kernel alongside "real" drivers, then the solution is simple, firmware needs implementation needs to patch the DT and, at least, mark the uart as reserved if it is using it to provide the debug console. Marking this nonportable so that people only walk into this with their eyes open seems like a reasonable action to me. Reviewed-by: Conor Dooley Cheers, Conor. > --- > drivers/tty/hvc/Kconfig | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig > index 6e05c5c7bca1..c2a4e88b328f 100644 > --- a/drivers/tty/hvc/Kconfig > +++ b/drivers/tty/hvc/Kconfig > @@ -108,13 +108,15 @@ config HVC_DCC_SERIALIZE_SMP > =20 > config HVC_RISCV_SBI > bool "RISC-V SBI console support" > - depends on RISCV_SBI > + depends on RISCV_SBI && NONPORTABLE > select HVC_DRIVER > help > This enables support for console output via RISC-V SBI calls, which > - is normally used only during boot to output printk. > + is normally used only during boot to output printk. This driver > + conflicts with real console drivers and should not be enabled on > + systems that directly access the console. > =20 > - If you don't know what do to here, say Y. > + If you don't know what do to here, say N. > =20 > config HVCS > tristate "IBM Hypervisor Virtual Console Server support" > --=20 > 2.43.0 >=20 >=20 --ZpSavjsIcxHJ5llO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZcziUQAKCRB4tDGHoIJi 0ha2AP4h37dfZJEi2Ma4Nfwx6PGVD0xADFSNtFYCxflzdgLW7AD+OawAfKCLrXnJ 5fR1lKUHo+712HP3zmc1aJ6D2m0LTg8= =3+DZ -----END PGP SIGNATURE----- --ZpSavjsIcxHJ5llO--