Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp485577lqh; Sat, 4 May 2024 08:53:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIyYDvIdNlvY0doXB+0GgUbYOLNeH8HOghMNrmPDxDnIoPnf6d1P586MZWN+vcng8EsaC9TKBErrPVK4ivlghE4YQFBf2iqb83x1/nlw== X-Google-Smtp-Source: AGHT+IHugEzZBhXdjplOE9RUokJu9aaMIPnumhUjBpvoVPgFWFVEEVgP+ILG8ycypqu1KOYr7S3i X-Received: by 2002:a17:906:1c0e:b0:a59:aff8:c713 with SMTP id k14-20020a1709061c0e00b00a59aff8c713mr649849ejg.10.1714838030102; Sat, 04 May 2024 08:53:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714838030; cv=pass; d=google.com; s=arc-20160816; b=sHIB/8b1sdIv18hu2gHApN2wvJLE0fGMT6HK8oFaWk+sX0OCfEGzrOd4oCum2UH3Pt SdG3zmdxIkOvtOY0zkyAAvnxt0x4ALv95ch/j2Q3lZQi8b+meH+Dz+oLwTnaBI7H/E2j cTkxrb0MBF5wJP8HZkXyZt98RjPZbY3G3nvS+tjA80zMrAaFRVGHsoeYIcXWp5FddEsR AbP27tvjc5UPIxUxxJlVpJcPnpDA3SQAb0BUBtJcIiAJ2u/VnUnVssy8UbTQ5b9OCIuX 2mrrMVPLHz10mHAAP+Ce0LYnwveoYyKHCkgIO/SdR9DeKEt3dobh56prUS8GpHk54JWx it2w== 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=UBXBJtffOja3egHzEKyxetcDW1ul6Wq+9c39T+6EiR0=; fh=eGg/lrNjwNmxRrHk/cZcm8bZsBa/IhiR0Yo3DrM7kHM=; b=WuRgEmxm7vsbSTAo+htrF25nYLs63hVfJrNnjSsh0CBbtd0pUcsf15i3Uq22Dqk2np YPDyIJEw81/6VuDkr4yWWfm0OI+xkf37Xh0i6iNVYpUayrp3hJInBKWhvrHk63naijV9 OHGTAzbRd6dpksjycAMuSPAkbXUPScNviAUnBZTAhg0AlnJcZmT5AWTLhjGkqbAlfirO 6msVbVw5+sQ8ybP1qEvUsRj8Tx9BKkEl8Oyzas9y+jfP8wFTT4rth1Obu5yFZvhOVBF5 ruQE1PrQr7xkq2aytXFiYcJN7DQyk1pzRgZd44SNLILcXBDU9bxp9WA9S4ppyGLA+6/J +UCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nBFZQmgd; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-168736-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168736-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v7-20020a170906380700b00a59a75518a8si870984ejc.676.2024.05.04.08.53.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:53:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168736-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nBFZQmgd; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-168736-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168736-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 am.mirrors.kernel.org (Postfix) with ESMTPS id A96B31F215BD for ; Sat, 4 May 2024 15:53:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 075185103D; Sat, 4 May 2024 15:53:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nBFZQmgd" 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 15E6A3D0A4; Sat, 4 May 2024 15:53:41 +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=1714838022; cv=none; b=nmq8sN+SUE/JXepEpC2EPFAliw886bJoBEQiQITCyBbUPEH/30sQNXeU/VCx3cTj1+vMUuI1WN/ABZFIJgXXj+xtriDeNEtXxPOT9OB5zLZXc6jmDoeRBf8AxPMxT/EV/3HW1aGZbeaHuZoBqKTXBIrwKZM/kDtLqqu+xGUxmVc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714838022; c=relaxed/simple; bh=8I8m+ARERilkFj7kIbhJ3jfl4OiynemXtq1r//9ZZG0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FhBGtJyylf5iAZ88WUvs1TvitYOzHA6qS3HnljX8GG2AyunmIpAvvvn/sElD2DlUqhr0va8NDzbS/See0kuSZsNaHXRnWiH3RxlLD4JNY8fv9IOII+yfV6MeBWJWqxSKs/tzsxILgKAovJN51SkdId921R+QZYrHl/eYLou6jU8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nBFZQmgd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0ED39C072AA; Sat, 4 May 2024 15:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714838021; bh=8I8m+ARERilkFj7kIbhJ3jfl4OiynemXtq1r//9ZZG0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nBFZQmgdyX6pMsEUa7czdAYYb8afZ3p6iRVUD/H9YzuOfGgH1cZKo2dib2Jh93VK+ 8LPWbA2+H9SGLgmogKYkxW5/Q+Vq/loJY9A+poOwUtd5I2agVivdOgQXtTwcqUx+b6 m+Duex3ZyppN9X/0T/ZfT4gefnqjqWMjeM41aIDI= Date: Sat, 4 May 2024 17:53:38 +0200 From: Greg Kroah-Hartman To: Sunil V L Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-serial@vger.kernel.org, acpica-devel@lists.linux.dev, Catalin Marinas , Will Deacon , Paul Walmsley , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Thomas Gleixner , Samuel Holland , Jiri Slaby , Robert Moore , Conor Dooley , Andrew Jones , Andy Shevchenko , Marc Zyngier , Atish Kumar Patra , Andrei Warkentin , Haibo1 Xu , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= Subject: Re: [PATCH v5 17/17] serial: 8250: Add 8250_acpi driver Message-ID: <2024050421-coil-payphone-f3a1@gregkh> References: <20240501121742.1215792-1-sunilvl@ventanamicro.com> <20240501121742.1215792-18-sunilvl@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240501121742.1215792-18-sunilvl@ventanamicro.com> On Wed, May 01, 2024 at 05:47:42PM +0530, Sunil V L wrote: > RISC-V has non-PNP generic 16550A compatible UART which needs to be > enumerated as ACPI platform device. Add driver support for such devices > similar to 8250_of. > > The driver is enabled when the CONFIG_SERIAL_ACPI_PLATFORM option is > enabled. Enable this option for RISC-V. > > Signed-off-by: Sunil V L > --- > arch/riscv/configs/defconfig | 1 + > drivers/tty/serial/8250/8250_acpi.c | 96 +++++++++++++++++++++++++++++ > drivers/tty/serial/8250/Kconfig | 8 +++ > drivers/tty/serial/8250/Makefile | 1 + > 4 files changed, 106 insertions(+) > create mode 100644 drivers/tty/serial/8250/8250_acpi.c > > diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig > index 3cae018f9315..bea8241f52eb 100644 > --- a/arch/riscv/configs/defconfig > +++ b/arch/riscv/configs/defconfig > @@ -150,6 +150,7 @@ CONFIG_SERIAL_8250=y > CONFIG_SERIAL_8250_CONSOLE=y > CONFIG_SERIAL_8250_DW=y > CONFIG_SERIAL_OF_PLATFORM=y > +CONFIG_SERIAL_ACPI_PLATFORM=y > CONFIG_SERIAL_SH_SCI=y > CONFIG_SERIAL_EARLYCON_RISCV_SBI=y > CONFIG_VIRTIO_CONSOLE=y > diff --git a/drivers/tty/serial/8250/8250_acpi.c b/drivers/tty/serial/8250/8250_acpi.c > new file mode 100644 > index 000000000000..3682443bb69c > --- /dev/null > +++ b/drivers/tty/serial/8250/8250_acpi.c > @@ -0,0 +1,96 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Serial Port driver for ACPI platform devices > + * > + * This driver is for generic 16550 compatible UART enumerated via ACPI > + * platform bus instead of PNP bus like PNP0501. This is not a full > + * driver but mostly provides the ACPI wrapper and uses generic > + * 8250 framework for rest of the functionality. No copyright line? Odd, but ok, I'll take it, glad to see your company finally realizes the lack of needing them :) And as Andy said, please use the existing driver and extend what you need, don't write a new one, we really don't need a new one. > +static int acpi_platform_serial_probe(struct platform_device *pdev) > +{ > + struct acpi_serial_info *data; > + struct uart_8250_port port8250; > + struct device *dev = &pdev->dev; > + struct resource *regs; > + > + int ret, irq; > + > + regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + if (!regs) { > + dev_err(dev, "no registers defined\n"); > + return -EINVAL; > + } > + > + irq = platform_get_irq(pdev, 0); > + if (irq < 0) > + return irq; > + > + memset(&port8250, 0, sizeof(port8250)); > + > + spin_lock_init(&port8250.port.lock); Are you sure this works? thanks, greg k-h