Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp495143rwd; Wed, 24 May 2023 22:54:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tlDKo/XZIcKwGRpq1PiXrqNbRXLAvq4HvurieoQ46lTP/qqkUhfgw3zPzFsSC+DlDfcZH X-Received: by 2002:a05:6a00:99a:b0:645:834c:f521 with SMTP id u26-20020a056a00099a00b00645834cf521mr2457687pfg.17.1684994063076; Wed, 24 May 2023 22:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684994063; cv=none; d=google.com; s=arc-20160816; b=JPhRKtMbPgrrQwe5O0JJbuu+GUy6qFCp9L11FdkdI2JpHHYrLon/lKw3d1TNJ1dGd/ 3LjEd0KLo/EC52XOnxiO94ftppjYCwXmz5+LMhtNDIerYHa36DVzC77kmRtQkOSl3VKl DPHrqkq+ksu7ExFN0UiC7BxFvLufG9GrGP8qm53MUXki56nZpLHC/XDNnwdSbiXaDWRa +dNV/X+yVaiSp1nQqrsjKQoJzHQu7nUmGpkqXQkT+VfLFtsjNlZYuQIcs9OT7XQBas1/ E4pu2u4xBY9jDtktk1SKJh+N9l+Hlioen9SNVaYV2jad0otMIMQFRc3McWgmk92OUr06 rJUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id; bh=B8+s/K+5RvHd3mBUPmt+K92bKir5drTiVIL22nfYEIw=; b=EJ90XC2vqgdaT545Kp5TJUOkNBds6kBkElikG+IVK+NT0tebzULGNJ/hSu/E4f6TkJ v8HsWzi1xr9XcZq5dA2SQxlfHh5BCw7iBmzT3Q3grSznYserzfDH0w6Puxa7MatTc80w 4AEGLfm9a1A2AhT1Ekw0jtQ2cT9heX1ye1+xhY4UcqgjUdJzJcuW7PKtynVH5Hcj7+qW MKZMjd20fzZqzw/DJP8DNqigXjGfAA2JP2cm+wU/R/qUNyYVbMmhYNNYGf0vfCUqF+3p 4XkRx59lO4Ohqu1971YNN1Nhryc/7O0QavmwppKPMnK561X+f2znqBOE7luUq00C16QD gT7Q== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v2-20020aa799c2000000b00643ae7da34bsi525318pfi.221.2023.05.24.22.54.08; Wed, 24 May 2023 22:54:23 -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; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232941AbjEYFsw (ORCPT + 99 others); Thu, 25 May 2023 01:48:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjEYFsv (ORCPT ); Thu, 25 May 2023 01:48:51 -0400 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 870B495; Wed, 24 May 2023 22:48:49 -0700 (PDT) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-510b4e488e4so3693233a12.3; Wed, 24 May 2023 22:48:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684993728; x=1687585728; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=B8+s/K+5RvHd3mBUPmt+K92bKir5drTiVIL22nfYEIw=; b=KRrFryhheh/ZeXU1dlBJNp3XYdKdEqdTXRk17E4sPW0496eoqAizFBO4HOQhXAXqHQ +I3zGLfTBICtRAOmdfvUVyCJxnDon/VHu03pIbc6+6GP4EgTh4MoKakKf05kq2dbeTkW P5HV2VWSmDLRFnOqfW81XtrsfKH6x3IOylWCTQBGdwAtFGaYrU7QJWKj9h3PinX52pMR bQWRGoW3tw8vBP00HUfyDudiEvaW1zY6HIM3eFL3zWxtW03/yJ6oefit/84CX2mI1HVC g3XFPKkFMENozcdI4nWLwrUbJS5ZKpk/Ga31RyrCVFTXiWOvuuOx3moSWVWXv+AGzOK9 4iZg== X-Gm-Message-State: AC+VfDxWDAve2N0QUDINa0moiVAyg8UyXsVXU9r4jYooARDqQfyIXb1U GGmKnRhoxxvFUuJ3zU46baU= X-Received: by 2002:a50:ed1a:0:b0:510:e877:33c with SMTP id j26-20020a50ed1a000000b00510e877033cmr3218941eds.30.1684993727811; Wed, 24 May 2023 22:48:47 -0700 (PDT) Received: from [192.168.1.58] (185-219-167-24-static.vivo.cz. [185.219.167.24]) by smtp.gmail.com with ESMTPSA id d6-20020a056402078600b0050d89daaa70sm189740edy.2.2023.05.24.22.48.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 May 2023 22:48:47 -0700 (PDT) Message-ID: <75375f8d-e157-a364-3da5-9c8d5b832927@kernel.org> Date: Thu, 25 May 2023 07:48:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US To: Arnd Bergmann , Jacky Huang , Rob Herring , krzysztof.kozlowski+dt@linaro.org, Lee Jones , Michael Turquette , Stephen Boyd , Philipp Zabel , Greg Kroah-Hartman , Tomer Maimon , Catalin Marinas , Will Deacon Cc: 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 References: <20230516075217.205401-1-ychuang570808@gmail.com> <20230516075217.205401-11-ychuang570808@gmail.com> <3d4acb20-c80e-fd39-c0d0-e9b1e0309d81@kernel.org> From: Jiri Slaby Subject: Re: [PATCH v11 10/10] tty: serial: Add Nuvoton ma35d1 serial driver support In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 24. 05. 23, 11:00, Arnd Bergmann wrote: > On Wed, May 24, 2023, at 10:34, Jacky Huang wrote: >> On 2023/5/24 下午 03:42, Jiri Slaby wrote: >>> On 16. 05. 23, 9:52, Jacky Huang wrote: >>>> +static void ma35d1serial_config_port(struct uart_port *port, int flags) >>>> +{ >>>> +    /* >>>> +     * Driver core for serial ports forces a non-zero value for port >>>> type. >>>> +     * Write an arbitrary value here to accommodate the serial core >>>> driver, >>>> +     * as ID part of UAPI is redundant. >>>> +     */ >>>> +    port->type = 1; >>> >>> So this 1 translates to PORT_8250. Why not to use it directly? Or >>> something more saner like PORT_16550A? >>> >> It's not actually 8250 or 16550A. >> Can we add the following definition to >> 'include/uapi/linux/serial_core.h' and use PORT_MA35 instead? >> >> #define PORT_MA35    124 > > This was already in a previous version, until Greg commented > that it was probably not needed: > > https://lore.kernel.org/lkml/20fc81c9-5517-ce1e-639a-3b425cf27759@gmail.com/ > > Since leaving port->type at PORT_UNKNOWN doesn't work, and almost > all other drivers have something in serial_core.h, it's probably > best to do the same here. Checking the other drivers showed that > drivers/tty/serial/lantiq.c is currently the only exception, it > defines PORT_LTQ_ASC locally, which causes a conflict with > PORT_SPRD. Hmm. Anyone has an idea what this is really used for in userspace? Can we replace all of them by simply some sort of "PORT_OTHER"? For example: xdg-open `echo -n 'https://codesearch.debian.net/search?q=\b('; sed -n 's@#define\s\(\w\+\)\s.*@\1@ p' include/uapi/linux/serial_core.h | tail -20 | sed 's@.* \(.*\)[\x09 ][\x09 ]*.*@\1@'|paste -sd'|' | tr -d '\n'; echo ')\b'` gives _no_ clue. FTR the above translates here into: https://codesearch.debian.net/search?q=\b(PORT_HSCIF|PORT_ASC|PORT_TILEGX|PORT_MEN_Z135|PORT_SC16IS7XX|PORT_MESON|PORT_DIGICOLOR|PORT_SPRD|PORT_CRIS|PORT_STM32|PORT_MVEBU|PORT_PIC32|PORT_MPS2UART|PORT_MTK_BTIF|PORT_RDA|PORT_MLB_USIO|PORT_SIFIVE_V0|PORT_SUNIX|PORT_LINFLEXUART|PORT_SUNPLUS)\b thanks, -- js suse labs