Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4931137yba; Wed, 8 May 2019 05:23:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/JCmQPbVKPJLlEqknavy74vLVZ3cEAqUUBwdSqn4ZsyTohf7KsX6r/3+1lECnfRVNsHPu X-Received: by 2002:a17:902:141:: with SMTP id 59mr46591806plb.132.1557318202282; Wed, 08 May 2019 05:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557318202; cv=none; d=google.com; s=arc-20160816; b=iuIwwMJrwj89TWHp6M7ey5UZ2A2K826hNhkDIv7YRcf7LX5ODhzpFY6wZ5PM/lmSeY RS+4h29dF3RgQcjlEZrynO9hZ6hZGJtDKW1BlJTWLp1I2BbCplFB9zPY9p1LAYjOb3rI pGka4Uooc6Faol0hkZHUSjdaoz2WlZ9N3KuNxhH7gGGhCGqXMxgn3SUmitW7q6bhhasY lPiU2oHCqFnxyCWZ/SV80Jx5+o8Cph76PuFssqcqCfW4qdBlFvPXFAzVvhqCoje5by0L eZsv1nZ/05v9kJ+H3Q3To2/hbuL0D+lMtwSg8kIPenW/mYie/WaCvyjQkxovkzN/xGHo VJ0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=c56+fU2CQM0Nq1k2I7fJqeTGwyx7cqaE2PIO7nv0Pv0=; b=VQc8nfJvbNfJvkrdUxjAoiHLCRudAKAfrDQi1V7/6vDbgJki5hkQXPBEKAnFTIVu5a QsnJPiK73N3y65wQpajlN1Yktg7bJoAd/9xFCeO8GzLJ1TzAB8Gx/DjbzacrMtUKLP1S LSUF5nRgGVwAl2IZVRXy+7hj331f95z6UPerKWBPvmNpfvPxUf3kRwvTe50/8d4aXCuG uO3+pjQi0WFSpTQ+kDOJ4f4UN2hO5wmhFtbjLZQmddsqlpYxwQT/JRvWn5JMJZSGsjHj LwguZK/ZrxB98YwnVuVKIF9YsfGKV7ae95hjXDkTxIZzhi6YJY6v8gNNaStqNpzXGzMB TSWg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si21280176pgp.273.2019.05.08.05.23.04; Wed, 08 May 2019 05:23:22 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728501AbfEHMWL (ORCPT + 99 others); Wed, 8 May 2019 08:22:11 -0400 Received: from mx.socionext.com ([202.248.49.38]:8119 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728469AbfEHMWJ (ORCPT ); Wed, 8 May 2019 08:22:09 -0400 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 08 May 2019 21:22:07 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 603886117D; Wed, 8 May 2019 21:22:07 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Wed, 8 May 2019 21:22:07 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by kinkan.css.socionext.com (Postfix) with ESMTP id D14B81A04E1; Wed, 8 May 2019 21:22:06 +0900 (JST) Received: from [127.0.0.1] (unknown [10.213.119.83]) by yuzu.css.socionext.com (Postfix) with ESMTP id BCB33121BCE; Wed, 8 May 2019 21:22:06 +0900 (JST) Subject: Re: [PATCH v3] serial: Add Milbeaut serial control To: Alan Cox Cc: Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann , Takao Orito , Kazuhiro Kasai , Shinji Kanematsu , Jassi Brar , Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org References: <1555555916-22251-1-git-send-email-sugaya.taichi@socionext.com> <20190426191515.757e6015@alans-desktop> From: "Sugaya, Taichi" Message-ID: <93002681-37f8-cb12-725c-48c1695d29a0@socionext.com> Date: Wed, 8 May 2019 21:22:05 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190426191515.757e6015@alans-desktop> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thank you for pointing out. On 2019/04/27 3:15, Alan Cox wrote: > O >> +static void mlb_usio_set_termios(struct uart_port *port, >> + struct ktermios *termios, struct ktermios *old) >> +{ >> + unsigned int escr, smr = MLB_USIO_SMR_SOE; >> + unsigned long flags, baud, quot; >> + >> + switch (termios->c_cflag & CSIZE) { >> + case CS5: >> + escr = MLB_USIO_ESCR_L_5BIT; >> + break; >> + case CS6: >> + escr = MLB_USIO_ESCR_L_6BIT; >> + break; >> + case CS7: >> + escr = MLB_USIO_ESCR_L_7BIT; >> + break; >> + case CS8: >> + default: >> + escr = MLB_USIO_ESCR_L_8BIT; >> + break; >> + } >> + >> + if (termios->c_cflag & CSTOPB) >> + smr |= MLB_USIO_SMR_SBL; >> + >> + if (termios->c_cflag & PARENB) { >> + escr |= MLB_USIO_ESCR_PEN; >> + if (termios->c_cflag & PARODD) >> + escr |= MLB_USIO_ESCR_P; >> + } > > If you don't suport CMSPAR then clear that bit in termios as well > OK, clear the bit because of not supported. >> + /* Set hard flow control */ >> + if (of_property_read_bool(port->dev->of_node, "auto-flow-control") || >> + (termios->c_cflag & CRTSCTS)) >> + escr |= MLB_USIO_ESCR_FLWEN; > > That's just broken. The termios bits are the definitive things for the > port, and in addition even if they are forced you need to correct the > termios data. > > You might want to control flow control *at boot* with an OF property but > doing it post boot is just busted. > Ah, Yes. I think OF property should not be here, and it may only be used to determine the characteristics of the port. I try to make a fixes patch. Thanks, Sugaya Taichi > Alan >