Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1038853ybz; Wed, 22 Apr 2020 12:22:59 -0700 (PDT) X-Google-Smtp-Source: APiQypIEcNi4Ux4GZKI33w5ObijMi6xwvERTjHrgsth7IT0fltxcg+m61vbh2i0eAi1tVEtMrq65 X-Received: by 2002:a05:6402:28e:: with SMTP id l14mr142276edv.184.1587583379781; Wed, 22 Apr 2020 12:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587583379; cv=none; d=google.com; s=arc-20160816; b=ZO/1UoXq2qX6KGUDzdHSHoYnOFcrfsxkLxD0eeJWe4VHr6klHnefelrPXQmm9lP44V aQACc46QEpJ4ryyIFMz1Z6g15t/p9He65lEtbFDN7/1VLtNbccdJz/P+HIKDPZScUuUP msDST+biUDGEoI4eiC1X5x8HASviVFliVfLDhVkOZ3lbpLQSO6rThlDHS5wLQwoumN5F LHPJ4OXNOhTZ2LgKZ+lugYR77ODblVmM47Sw2khPXwFuAGNBK+4MYzcUFuJ72IT8wtWz nlUoM5Z4h2rkxpkpjG73ltCHFUQNbJhHC7Ib0Ie+1FcWJ4Tm0DMit63RGR3/gFaSk1Pv lahg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=KtmFmWbQrY8pc1EpVQXZVMz+o7YgDf3mMA7eDgpe41c=; b=BtkRqANxz34+uDQWgiE6/KAWSzrDN97InwRTEQx8zjayq2Vd52uZVFIBV553NnJJ/o M1MjRBglN7C5Qxh5U0juldRr7z5yJ0Vf20TtuWOW1rTGbPSA6GKtReBy8kcfai7HJk7O YvbOQKSyM/hirinoVDKcklatUgt4rpnbNRSmKGN4BiV8MkncNbkTWIcsdW2NcVaPJzHL 0N06rtAVWjiM2WbVR9BqSdtyMJQ83JTdZB7IlmZyJXKCFmXTaqApKOcDo6lEWSp7iN8e rhzWsA+QSkPU+/8kF8dKreelmJF9ay9vVjATxW6HoasHp7fiNUaRgldBKLZkk5npA9He HdOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uhT1tnQf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si48922ejk.442.2020.04.22.12.22.36; Wed, 22 Apr 2020 12:22:59 -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=@gmail.com header.s=20161025 header.b=uhT1tnQf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726414AbgDVTUq (ORCPT + 99 others); Wed, 22 Apr 2020 15:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725935AbgDVTUp (ORCPT ); Wed, 22 Apr 2020 15:20:45 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E7AAC03C1A9; Wed, 22 Apr 2020 12:20:45 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id w65so1593011pfc.12; Wed, 22 Apr 2020 12:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KtmFmWbQrY8pc1EpVQXZVMz+o7YgDf3mMA7eDgpe41c=; b=uhT1tnQfPSj/TjtZ3wZw+so7Z0Vt7cA+7T6xXaEseKDmfs5FBjyrvrTomdpZvQDiY2 2k5+TnTWWIoEE8Acv1BllsIWWxWBlBAcIqY4aYLDMMMYGCq2FM+9mKXgjzqBDTt8pqMC oNbP3xVPWlH15/zlEZOQTawwTnBtbtNgjGJIxDlJlY0ETcRFB3H59NFbDMKKvi+PYdlF P9XmiAm9GYIflk6+mwaBhQviWGrRoBjEM6x1PIPNbs5d04JFOQ4gfn6liDfD+LG8wOKn 3aFUdAl0kNG+iGbWf5QmqIkoszQHtXkfvo2qM3zaqtCD0YV82j+Q21XA6mhylE7eaIem tXRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KtmFmWbQrY8pc1EpVQXZVMz+o7YgDf3mMA7eDgpe41c=; b=buLPIHExYGurUyi7e1kAUHlS4xKha2C56YltIRc8SBwUJJtrrAiwQbVEm0TqpISr4j Cg3MTu1VWIcySbv/sv3rB0t3r8x1qsDBSfL7u6+DDj3RDDZaDbDLzPF+9wKgTti/V7HU SkcHR5RumgJyIwdGBpl7Sm/UpXrAFBLzTzfWD4CiyspBGE6Xmjp76sdJbJLLsX5fFZ09 F1Ju7IAjKGKGpH0RuREUJpZ6VebI2g9GnwaFK5128KCaWB00hzWy0hMCUP65bGtYCKNa azjz7dJgmYgqSacFUPAmZYVaKU7XbGjPha1Q6YMbR8U3q9Xs5Awsr6fEKLMaELVA7v6N zltw== X-Gm-Message-State: AGi0PuYm4x12zcIpEov81Gtg+lxurEHxPJf2YlRDX7jmHfSM1spr07VK 3a45m/lqJRq+LUMQKpCqRmf/xISzk9XU1ll92Fg= X-Received: by 2002:a63:5511:: with SMTP id j17mr576026pgb.4.1587583245100; Wed, 22 Apr 2020 12:20:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andy Shevchenko Date: Wed, 22 Apr 2020 22:20:33 +0300 Message-ID: Subject: Re: [PATCH v3] tty: serial: don't do termios for BTIF To: Sean Wang Cc: Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko , Mika Westerberg , Stefan Roese , Arnd Bergmann , Matthias Brugger , tthayer , "moderated list:ARM/Mediatek SoC support" , "open list:SERIAL DRIVERS" , linux-arm Mailing List , Linux Kernel Mailing List , Steven Liu , Ryder Lee Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2020 at 9:05 PM 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. > > Fixes: 1c16ae65e250 ("serial: 8250: of: Add new port type for MediaTek BTIF controller on MT7622/23 SoC") > Cc: Steven Liu > Suggested-by: Andy Shevchenko I didn't suggest this change. I only commented on the name of the macro. > 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. > --- > 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 33ad9d6de532..234d8db470c0 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 */ > > #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ > #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ > diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c > index 0325f2e53b74..abc974b4113f 100644 > --- a/drivers/tty/serial/8250/8250_port.c > +++ b/drivers/tty/serial/8250/8250_port.c > @@ -286,7 +286,7 @@ static const struct serial8250_config uart_config[] = { > .tx_loadsz = 16, > .fcr = UART_FCR_ENABLE_FIFO | > UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, > - .flags = UART_CAP_FIFO, > + .flags = UART_CAP_FIFO | UART_CAP_NTIO, > }, > [PORT_NPCM] = { > .name = "Nuvoton 16550", > @@ -2544,6 +2544,9 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, > unsigned long flags; > unsigned int baud, quot, frac = 0; > > + if (up->capabilities & UART_CAP_NTIO) > + return; > + > if (up->capabilities & UART_CAP_MINI) { > termios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CMSPAR); > if ((termios->c_cflag & CSIZE) == CS5 || > -- > 2.25.1 -- With Best Regards, Andy Shevchenko