Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1497967rwd; Tue, 13 Jun 2023 09:53:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5F2I8vHjHuEiDk7dpCMIR/fjcco7TnXvWq4oOAGudEeg8c8HL+jXh67/JrPi5QPKiaOUuU X-Received: by 2002:a17:907:705:b0:96f:cde5:5f5e with SMTP id xb5-20020a170907070500b0096fcde55f5emr12045195ejb.29.1686675187669; Tue, 13 Jun 2023 09:53:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686675187; cv=none; d=google.com; s=arc-20160816; b=OXGMA5tlCWIqGziMeTZGtXVK/ny7J/0nMjVZflL9FmIhavkuqbhzXd1UKcD4RqYZQ0 LZBs/3NjlWrGV2iZI39hYxCB7/G1eWMcsig7XmN7ZLkrIa7aLulrQVQFGZnFkeANCAjl HDzwKtRZpV8Yk5BebHLUwrNuFLbgWjMuZjob517RiLAISnnfYJWzG293JxrHrE+PqRlv M1JDHpA1PKkQS7JGkB2+v/Rd5SqFAuvhmTKApZGWUK84zBSd49Llzrgaem9/6wCIizOm V/dXCXoKkEjd6NB0RrYLLLGrejRWVZc28obigYkAzT0I53DKIkqQALPdKqCoCfhRYCFc HX9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=k3ek7V5og/jAxqAHyIbXVs/nCJAhWpzv8iSulQtMJ8I=; b=PKTcKlMnJgc9++RsCe5SmDumrMlqdWLjUKUkjcVm7n4OSU05Wdn0GwnKn8iBOSUDyE kXlusjJOfZKXLgqe95yYqmSU3R7ZzEt1hAVC23gcMSbPnPlubZGMzvDqIr8JT0mu0IBv ppRfPOzr+K5E1pohQk33xPMQHx8LwKHNNdkLGYPmLKk/mEf0aYGh8XbvhYW4Oo8ZHk9/ SfUYwBq0Ga1geVgADdO/BO8C9dZYmx/M/I0SARW5JOKLyFgEyexdf4Gt5Gdamg1Q5CaO IKu59OeGmeN8vpLDiNEZZYc6Oi9hH82LY6wrnrYeYWh73Jia/A4/SBs4qLSfEf2tdY6G oEMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=i25fvbZ4; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=I418A2xf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rn26-20020a170906d93a00b0096637b27352si6949101ejb.52.2023.06.13.09.52.43; Tue, 13 Jun 2023 09:53:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=i25fvbZ4; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=I418A2xf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242515AbjFMPpA (ORCPT + 99 others); Tue, 13 Jun 2023 11:45:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242956AbjFMPou (ORCPT ); Tue, 13 Jun 2023 11:44:50 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF7E8127; Tue, 13 Jun 2023 08:44:48 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id DC23D320095F; Tue, 13 Jun 2023 11:44:44 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Tue, 13 Jun 2023 11:44:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1686671084; x=1686757484; bh=k3ek7V5og/jAxqAHyIbXVs/nCJAhWpzv8iS ulQtMJ8I=; b=i25fvbZ43tfLcBg7k45NhbybIbPtwaulSRLXfJ66DaQlcXJSABL r7eWKY6K7m3XIJQVWFNglIOCiR9bsRX9/GUBj+llF3lM4N56JijzFcD/7mtFcYxg jAt+m4f2D+CqV0xv9u4LcPsKnNvhpd70vvUhTYrhhRIbiraMVxw3ukhuJi5PZkVE Xjjb4yN+c85byOxnXUG5Q8Rqu8Iwy9b78K6Z89+wSUsCk0/rNIKw2r9rMHphg1r0 gmi7QX0lAUcdZQoXwReWV1+NvicsoCA3N06Aopffw60nVcoYMEOFX6UlweNfKjLA zTl39n/blZJsjuVcTnAwuqrYbas4Y/7uA+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1686671084; x=1686757484; bh=k3ek7V5og/jAxqAHyIbXVs/nCJAhWpzv8iS ulQtMJ8I=; b=I418A2xfI25DMobOpjWKbzVLIpNs13e84N9THqgblB4uJe3UNPJ ih+TfVqdy9Sa/0gyf8o2OXq0VNUWTVNeTuOchjzVlOzisJkG20nnAGnJppJImi57 sBxTAnFDc4MC9ajdW2o+gDKy4F9DxR/GN2BnXJGEwta1cKAXd/LTJzQMhJsmJDqK Irk+LFRV9clRB+VuQsEL//zTaW+eFH/jYv3UEeXRDJxLbQmpQnZMx9RdIwkI9ahp q8AiV1X1qBpYGuiD5XfkX7NSp5LqgQq22FNku+iXkxQyiA18pF3afy4HOlyOxq2z wGSYHVweeJK3UMkv/jOnniMHGgvVDLDnEsQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedujedgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeegfeejhedvledvffeijeeijeeivddvhfeliedvleevheejleetgedukedt gfejveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7A948B60086; Tue, 13 Jun 2023 11:44:43 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-492-g08e3be04ba-fm-20230607.003-g08e3be04 Mime-Version: 1.0 Message-Id: <35e768ad-7f15-48a4-9c38-09570026cf71@app.fastmail.com> In-Reply-To: <2023061356-matchbook-footwear-d142@gregkh> References: <20230612025355.547871-1-ychuang570808@gmail.com> <20230612025355.547871-2-ychuang570808@gmail.com> <2023061338-lunchbox-snorkel-e6a9@gregkh> <2023061356-matchbook-footwear-d142@gregkh> Date: Tue, 13 Jun 2023 17:44:23 +0200 From: "Arnd Bergmann" To: "Greg Kroah-Hartman" , "Jacky Huang" Cc: "Rob Herring" , krzysztof.kozlowski+dt@linaro.org, "Lee Jones" , "Michael Turquette" , "Stephen Boyd" , "Philipp Zabel" , "Jiri Slaby" , "Tomer Maimon" , "Catalin Marinas" , "Will Deacon" , devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, soc@kernel.org, schung@nuvoton.com, mjchen@nuvoton.com, "Jacky Huang" Subject: Re: [PATCH v14 1/1] tty: serial: Add Nuvoton ma35d1 serial driver support Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 13, 2023, at 16:49, Greg KH wrote: > On Tue, Jun 13, 2023 at 06:58:32PM +0800, Jacky Huang wrote: >>=20 >> On 2023/6/13 =E4=B8=8B=E5=8D=88 06:28, Greg KH wrote: >> > On Mon, Jun 12, 2023 at 02:53:55AM +0000, Jacky Huang wrote: >> > > From: Jacky Huang >> > >=20 >> > > This adds UART and console driver for Nuvoton ma35d1 Soc. >> > > It supports full-duplex communication, FIFO control, and >> > > hardware flow control. >> > You get a full 72 columns for your changelog :) >> >=20 >> > > --- a/include/uapi/linux/serial_core.h >> > > +++ b/include/uapi/linux/serial_core.h >> > > @@ -279,4 +279,7 @@ >> > > /* Sunplus UART */ >> > > #define PORT_SUNPLUS 123 >> > > +/* Nuvoton MA35 SoC */ >> > > +#define PORT_MA35 124 >> > > + >> > Why is this change needed? What userspace code is going to rely on= it? >> >=20 >> > thanks, >> >=20 >> > greg k-h >>=20 >> Because the serial driver requires a port->type, and almost all serial >> drivers defined their port type here. We follow the practice of most = serial >> drivers here. >> If we don't do it this way, we would have to directly assign a value = to >> port->type. However, such modifications were questioned in the past, >> which is why we changed it back to defining the port type in serial_c= ore.h. > > I really really want to get rid of this list, as it's a UAPI that no o= ne > uses. So please don't use it, it doesn't help anything, and while the > serial driver might require it, it doesn't actually do anything with > that field, right? So why don't we just set all of the values to the > same one? I don't see how Jacky can come up with a patch to do this correctly without more specific guidance to what exactly you are looking for, after the last 123 people that added support for a new port got that merged. I checked debian codesearch and found only three obscure packages that accidentally include this header instead of including linux/serial.h, a couple of lists of all kernel headers, and none that include it on purpose. I agree that this header should really not exist in uapi, but the question is what exactly to do about it. Possible changes would be: - add a special value PORT_* constant other than PORT_UNKNOWN that can be used by serial drivers instead of a unique value, and ensure that the serial core can handle drivers using it. - move all values used by the 8250 driver from serial_core.h to serial.h, as this driver actually uses the constants. - Move the remaining contents of uapi/linux/serial.h into the=20 non-uapi version. - Change all drivers that only reference a single PORT_* value to use the generic one. Arnd