Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp702001imu; Thu, 13 Dec 2018 03:03:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/WQZQowj4YR87oIBixlMraK1ImH8soRkUtL4XLnzShIQzT/H4I9r38FpZaZduOQU7KlPywj X-Received: by 2002:a63:30c8:: with SMTP id w191mr22050108pgw.120.1544698989686; Thu, 13 Dec 2018 03:03:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544698989; cv=none; d=google.com; s=arc-20160816; b=dSGwILxOJyzIEuU3H9fDuPf8Y8pcm7un+fxoFeZaKZulwIopVP3aqEL5rl+wxZRz/s MV+qhgSHdcsaqGwBo6odRsP7pcvAVvMRm0HUqzCE2h0jsD5BL9/la9kmDZr4t+Ile3IY Tx0YNVRQVxgpwLBoKhr8N93OErIVuQFo+KD72mFqDZOEfwdou/li7mkFKQdkvk+swfKY +AId4Uc3HFLvBN6iAa7Cv21+Nl890skYbjEUjzMBoptYj4I6colX2ZP6GqCARArL028O f2VuerwtLwa3QuxaXivuKmYtiJGztvupQONgUHe7qNQZJSmcFizka6BEZEIG5UFWuIgY wIng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9qIbvvG/9lDI0uuCNjYROMG8ASH47z9X4H8Zg0GgJhE=; b=DTsT2d6HcBUlAiuoYXkBDGEXDFsNmvbfqO/XGDLLcJhrW//hHFr5fw6Co/caC8YD3o H3/qyEufOrZRtsjrkGCmXlT13w0y4lfpLVA49bnv5fcmjwnm4GHk0uOVUmyF1h+G9fzJ ffMdn9Dh+u4GdLk8Un0LTWygloxJSMNEat4ym4JAAG7X+D4EPiXJxamzObS1QzkGq2Hi 33MJ+tc3MbvhXZcUMB5sIJKGBGFunmv1d8C20pm/qfTR6UdbqFr0YNPBmV6qQHOOw3Kn pKsQHAKpohjDCEtMX4tclTwwe4L7jr0X+EL28pDxX6xQMDa/t88M5VUyuX1yjiQhKfcO 5Nig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b="dMLyJ/20"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si1280186ply.222.2018.12.13.03.02.55; Thu, 13 Dec 2018 03:03:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b="dMLyJ/20"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728590AbeLMLAy (ORCPT + 99 others); Thu, 13 Dec 2018 06:00:54 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:45448 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727556AbeLMLAy (ORCPT ); Thu, 13 Dec 2018 06:00:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9qIbvvG/9lDI0uuCNjYROMG8ASH47z9X4H8Zg0GgJhE=; b=dMLyJ/20SBZrUcdB7qY2/6Jeu KMy7yre+SRT/s1amlnFxPKoCI3hYLXWYrBQGbErxDh46P7PdfYvvZKeyp2U2Tk5u+puMh+KOnV4Tv WnxroXw5DBjoPJXIy+pG6KQD7Y1XgNwYzOOzCrNFe0gg+YRiOxISLjehWIVhDKwUSvdX0=; Received: from n2100.armlinux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:47708) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1gXOjN-0001ys-NR; Thu, 13 Dec 2018 11:00:37 +0000 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1gXOjI-0003nr-Vm; Thu, 13 Dec 2018 11:00:33 +0000 Date: Thu, 13 Dec 2018 11:00:29 +0000 From: Russell King - ARM Linux To: Ryder Lee Cc: Andy Shevchenko , Greg Kroah-Hartman , Sean Wang , Sean Wang , Weijie Gao , linux-kernel@vger.kernel.org, Roy Luo , linux-mediatek@lists.infradead.org, linux-serial@vger.kernel.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] tty: serial: don't do termios for BTIF Message-ID: <20181213110029.GN30658@n2100.armlinux.org.uk> References: <972976519be8e28ee600651fe14d1f6d5f23e697.1544679557.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <972976519be8e28ee600651fe14d1f6d5f23e697.1544679557.git.ryder.lee@mediatek.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 13, 2018 at 02:24:03PM +0800, Ryder Lee wrote: > The MediaTek BTIF controller doesn't need to set termios so add > a new capability 'UART_CAP_NMOD' for the unsupported case. > > > Signed-off-by: Sean Wang > Signed-off-by: Ryder Lee > --- > drivers/tty/serial/8250/8250.h | 1 + > drivers/tty/serial/8250/8250_port.c | 7 ++++++- > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h > index ebfb0bd..2b9ba39 100644 > --- a/drivers/tty/serial/8250/8250.h > +++ b/drivers/tty/serial/8250/8250.h > @@ -80,6 +80,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_NMOD (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 c39482b..e4a69a0 100644 > --- a/drivers/tty/serial/8250/8250_port.c > +++ b/drivers/tty/serial/8250/8250_port.c > @@ -297,7 +297,7 @@ > .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_NMOD, > }, > [PORT_NPCM] = { > .name = "Nuvoton 16550", > @@ -2663,6 +2663,11 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port, > unsigned long flags; > unsigned int baud, quot, frac = 0; > > + if (up->capabilities & UART_CAP_NMOD) { > + termios->c_cflag = 0; So your port is limited to 5-bits and is unable to receive characters? That's what a zero cflag means, and that's what you'll be telling userspace here. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up