Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1400939ybt; Sat, 27 Jun 2020 07:13:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPdcy+b4t2FoFUH/icuLJ8edd4LIx7uAnPcqZLuRxsuWNcGTOuQuk6/oza/1QYXGE/jZbu X-Received: by 2002:a17:906:19c9:: with SMTP id h9mr6508974ejd.526.1593267204886; Sat, 27 Jun 2020 07:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593267204; cv=none; d=google.com; s=arc-20160816; b=X7FjxaOeBG4SXHgtGU78ozqo3W7V6SLaWE2YiQVlzO6H1afL09VM75CZpgsUfgbidr AkF+jWa64bdL7dLuYpD9EvqrzbVMo/Uo2XPYCsllcfWTWuLEsoFdlVm/eP6IWfSbsWOo 6TF2ADEWSjicuC9n+S/IRhxVpSxBZ4e/zvAjpSCBdyJZIw/hy9dwlXHJ0LOa/bwQU34C +L19DoIJZHprDPuwfQFBkCT9wAoZkwmRU7VOx7j2wgj5A0Kj50uKgfV83ICz0WL6j3E5 RLjcYgShp9idMVQOXO+SEaM0ZV5EYKd15QVpK07nVzsU0RGBy5b5onvTbdw9/geD93so zuiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=rh7fcP6Tu5/+v0k7cp0NJRp3o4eQsF+VtWwaWiIE934=; b=C6t0TWk+Qh/RCD99QQoTCSBdrdjhZZpQOCUGDhO6x+xZAJgk5Gjy6y3+B+jfP6fNpC DmfuRyV/3eGXAyBvb5qcl0ghIfbVblXCZ7R28q1idZQb5eCon3Ydb58iBr8z1zwcgN5K USdTiLKO9wnkkX9vynTrjSpS+uXGZb1yFbB1nsOocI693tdHue13fszyM1tYL4A+tTze I7AyJomUVZ+1HTUigxKVqTfgYcOvRnPEC5lRlFFTm67u6r+tI2QKsOK8PvOHDN2jMTxI 8K+OogQMALpw2hKP3yw4/mYpNMZJGvENpjbdzqAWqy59+CL8Ep4IiHsMmd/lS0lmxYqD /Q8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TfrrfsmE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si13586358ejc.167.2020.06.27.07.13.02; Sat, 27 Jun 2020 07:13:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TfrrfsmE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725975AbgF0OMa (ORCPT + 99 others); Sat, 27 Jun 2020 10:12:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:35932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725798AbgF0OMa (ORCPT ); Sat, 27 Jun 2020 10:12:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AFB4C2184D; Sat, 27 Jun 2020 14:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593267149; bh=Mm9Jr0Y6Toy3xKZiWCZpBQOjWvs88DP6/BkXW7NSloI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TfrrfsmELqDgVdyohdtQg5RGnq/X72CkFtYXD+vVAHqE8bU22zy+qL2STz3ewIsSp a82+ne6RpaLkVeJ5rbGMc/Yhr/6tyXaN6oAKecHhJLWOK+X4sw/UL9jgy/NSwDNSEn EEzmq/TNa+IF7b03gev789SKgOHxnvk12u9q00r8= Date: Sat, 27 Jun 2020 16:12:22 +0200 From: Greg KH To: sean.wang@mediatek.com Cc: robh+dt@kernel.org, jslaby@suse.com, andriy.shevchenko@linux.intel.com, robert.jarzmik@free.fr, arnd@arndb.de, p.zabel@pengutronix.de, joel@jms.id.au, david@lechnology.com, jan.kiszka@siemens.com, heikki.krogerus@linux.intel.com, hpeter@gmail.com, vigneshr@ti.com, matthias.bgg@gmail.com, tthayer@opensource.altera.com, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Steven Liu , Ryder Lee Subject: Re: [PATCH v4] tty: serial: don't do termios for BTIF Message-ID: <20200627141222.GC1901451@kroah.com> References: <78efa2b1e2599deff4d838b05b4054ec5ac2976a.1592595601.git.sean.wang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78efa2b1e2599deff4d838b05b4054ec5ac2976a.1592595601.git.sean.wang@mediatek.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 20, 2020 at 03:59:14AM +0800, sean.wang@mediatek.com wrote: > From: Sean Wang > > Bluetooth Interface (BTIF) is designed dedicatedly for MediaTek SOC with > BT in order to be instead of the UART interface between BT module and Host > CPU, and not exported to user space to access. > > As the UART design, BTIF will be an APB slave and can transmit or receive > data by MCU access, but doesn't provide termios function like baudrate and > flow control setup. > > Even LCR on offset 0xC that is just a FAKELCR > a. If FAKELCR[7] is equaled to 1, RBR(0x00), THR(0x00), IER(0x04) > will not be readable/writable. > > b. If FAKELCR is equaled to 0xBF, RBR(0x00), THR(0x00), IER(0x04), > IIR(0x08), and LSR(0x14) will not be readable/writable. > > So adding a new capability 'UART_CAP_NTIO' for the unusual unsupported > case. > > The bluetooth driver would use BTIF device as a serdev. So the termios > still function would be called in kernelspace from ttyport_open in > drivers/tty/serdev/serdev-ttyprt.c. > > Fixes: 1c16ae65e250 ("serial: 8250: of: Add new port type for MediaTek BTIF controller on MT7622/23 SoC") > Cc: Steven Liu > Signed-off-by: Sean Wang > Signed-off-by: Ryder Lee > > -- > v1->v2: > no change on termios->c_cflag and refine commit message > > v2->v3: > change the naming from NMOD to NTIO as TIO is a well established prefix > for termios IOCTLs. > > v3->v4: > 1. remove appropriate tag > 2. add the explanation why the termios is required even when the connection > isn't exported to userspace. > --- > drivers/tty/serial/8250/8250.h | 1 + > drivers/tty/serial/8250/8250_port.c | 5 ++++- > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h > index 52bb21205bb6..0d9d3bfe48af 100644 > --- a/drivers/tty/serial/8250/8250.h > +++ b/drivers/tty/serial/8250/8250.h > @@ -82,6 +82,7 @@ struct serial8250_config { > #define UART_CAP_MINI (1 << 17) /* Mini UART on BCM283X family lacks: > * STOP PARITY EPAR SPAR WLEN5 WLEN6 > */ > +#define UART_CAP_NTIO (1 << 18) /* UART doesn't do termios */ Naming is hard. I will never remember what "NTIO" is, how about we make it explicit: define UART_CAP_IGNORE_TERMIOS And the _CAP_ name is getting out of hand, this isn't a "capability", it's a "quirk for this port" but that's a battle to worry about later... thanks, greg k-h