Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp508566pxu; Sun, 22 Nov 2020 17:15:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxh0SeWwn4YjOGadbQh3QtS5S3N4f8o+js1xYjgQ8tMyNKEfUXoIyYYk75aJdXsTTckZXgf X-Received: by 2002:a17:906:6850:: with SMTP id a16mr2615581ejs.72.1606094157964; Sun, 22 Nov 2020 17:15:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606094157; cv=none; d=google.com; s=arc-20160816; b=Rv/DCU/FWFu2sEEnl+bezZbiuBi2HILhbgUEaWL383f2H6s3xpxytMt57PtxTu5s9w Og8yIJPjR89bAmxhvZrXso9sBDaDST88/Z19hkqDmlPGLjT16r+tptHPqnzUFwCbEjoL FBsTnHloWNMyaZsGG1E966r+XzzftaIyARrEKn91Pk89fkbrvVlvdsOxg1+tEeUwrqgS I0vU5yaU1JPP4jcGCqH/11RzBF/HKtaZsIpBkxjR5x9SoILO6OHx9EXhmp5Qh7DdaWRz msaYsytIi88HrbX2DzlcW7PnQ6suSMCn5XaFQHaUvNVVKU4syD6CtTm2jB7RBHe+Luji vQYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :document_confidentiality:msip_labels:content-language :accept-language:in-reply-to:references:message-id:date :content-class:thread-index:thread-topic:subject:cc:to:from; bh=RHgDmytTK5ueu9v1zBklcZxKLyQSTDCRyU9XMm/o+0M=; b=CPXQYMcZdSOyg/NJ7hbuvdMQld5uw01tyIYvYrR0UxVii4VVuwGACxByFNAfgcKJoO SNbSPk4NeLDZiu0cTbRSF0IdUmaQXDuKrxY35T9uw3KEYTr2kZWed5YK+Oxo55DTR405 ZCF4I+hLremhaQwcYcpLMPJ5Uyy6f3gZsvZj50XYaAKIlGbq6TxPpxzhZQsho9OaP7CG bjM4ym08L5BaC7v6PwoIijYrFa5xP9XmWiiOTvi3sLSizOeHfmOiFlubg4tvWC2xAxZX SFSOOiifYHZcZPs7/FwUGR7f1SawnIYF/kzV0VetX00FQMAzCDkse9ty4zKJq/KyOSMT mXdQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si5515743ejk.69.2020.11.22.17.15.24; Sun, 22 Nov 2020 17:15:57 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726839AbgKWBLo convert rfc822-to-8bit (ORCPT + 99 others); Sun, 22 Nov 2020 20:11:44 -0500 Received: from david.siemens.com.cn ([194.138.202.53]:44606 "EHLO david.siemens.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726630AbgKWBLo (ORCPT ); Sun, 22 Nov 2020 20:11:44 -0500 Received: from mail.siemens.com.cn (mail.siemens.com.cn [194.138.237.52]) by david.siemens.com.cn (8.14.9/8.14.9) with ESMTP id 0AN1BSHt020357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Nov 2020 09:11:29 +0800 Received: from CNPEK01M02MSX.ad011.siemens.net (cnpek01m02msx.ad011.siemens.net [139.24.237.215]) by mail.siemens.com.cn (8.14.9/8.14.9) with ESMTP id 0AN1BP1c018969 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 23 Nov 2020 09:11:27 +0800 Received: from CNPEK01M06MSX.ad011.siemens.net (139.24.237.223) by CNPEK01M02MSX.ad011.siemens.net (139.24.237.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 23 Nov 2020 09:11:24 +0800 Received: from CNPEK01M06MSX.ad011.siemens.net ([139.24.237.223]) by CNPEK01M06MSX.ad011.siemens.net ([139.24.237.223]) with mapi id 15.01.2106.003; Mon, 23 Nov 2020 09:11:24 +0800 From: "Wang, Sheng Long" To: Johan Hovold CC: Sheng Long Wang , "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lkp@intel.com" Subject: RE: [PATCH v6] usb-serial:cp210x: add support to software flow control Thread-Topic: [PATCH v6] usb-serial:cp210x: add support to software flow control Thread-Index: AQHWo2OeB9qO2j8ZGUeYQhba2pC/J6nF1h2AgAS8JjCAAA6LgIAKgkeg Content-Class: Date: Mon, 23 Nov 2020 01:11:24 +0000 Message-ID: <496f2cc77b4d4c3a9b49410ac318b927@siemens.com> References: <20201016022428.9671-1-china_shenglong@163.com> <520e730958174cb39561a94d03e4727e@siemens.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-dg-ref: PG1ldGE+PGF0IG5tPSJib2R5LnR4dCIgcD0iYzpcdXNlcnNcejAwNDNjYnhcYXBwZGF0YVxyb2FtaW5nXDA5ZDg0OWI2LTMyZDMtNGE0MC04NWVlLTZiODRiYTI5ZTM1Ylxtc2dzXG1zZy1jYmQyM2E0My0yZDI4LTExZWItYmU3MS1iMDBjZDE2OTA4NjRcYW1lLXRlc3RcY2JkMjNhNDUtMmQyOC0xMWViLWJlNzEtYjAwY2QxNjkwODY0Ym9keS50eHQiIHN6PSIyNjE1IiB0PSIxMzI1MDU2NzQ4MTY1NDU3NzIiIGg9IkN3bGFUMXFwZm93elYzbXYxZ0RzaGFQMlk2cz0iIGlkPSIiIGJsPSIwIiBibz0iMSIgY2k9ImNBQUFBRVJIVTFSU1JVRk5DZ1VBQUhBQUFBRHM0eW1PTmNIV0FTYTBwTHA3VkdjZ0pyU2t1bnRVWnlBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQkFBQUJBQUFBbytaL1dnQUFBQUFBQUFBQUFBQUFBQT09Ii8+PC9tZXRhPg== x-dg-rorf: true msip_labels: MSIP_Label_a59b6cd5-d141-4a33-8bf1-0ca04484304f_Enabled=true; MSIP_Label_a59b6cd5-d141-4a33-8bf1-0ca04484304f_SetDate=2020-11-23T01:11:21Z; MSIP_Label_a59b6cd5-d141-4a33-8bf1-0ca04484304f_Method=Standard; MSIP_Label_a59b6cd5-d141-4a33-8bf1-0ca04484304f_Name=restricted-default; MSIP_Label_a59b6cd5-d141-4a33-8bf1-0ca04484304f_SiteId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; MSIP_Label_a59b6cd5-d141-4a33-8bf1-0ca04484304f_ActionId=b5033c27-e2f5-4078-bcd5-2c1ba15bdcdd; MSIP_Label_a59b6cd5-d141-4a33-8bf1-0ca04484304f_ContentBits=0 document_confidentiality: Restricted x-originating-ip: [139.24.108.241] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Johan Do I add my software flow control patch directly to the branch you gave me now ? https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git/log/?h=cp210x-termios Then, I also need the cp210x_ get_ terminus() add ixoff / iXon handling? Thanks! With best regards, Wang Sheng Long Siemens Ltd., China RC-CN DI FA R&D SW Tianyuan road No.99 611731 CHENGDU, China Mobil: +86 15281074996 mailto:shenglong.wang.ext@siemens.com www.siemens.com/ingenuityforlife -----Original Message----- From: Johan Hovold Sent: Tuesday, November 17, 2020 12:38 AM To: Wang, Sheng Long (EXT) (RC-CN DI FA BL IPC&C PRC4) Cc: Johan Hovold ; Sheng Long Wang ; gregkh@linuxfoundation.org; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org; lkp@intel.com Subject: Re: [PATCH v6] usb-serial:cp210x: add support to software flow control [ Please avoid top posting. ] On Mon, Nov 16, 2020 at 07:56:10AM +0000, Wang, Sheng Long wrote: > Hi, Johan > > Thank you very much for your reply! > > You mean if we call cp210x_open() When opening the device, because > IXON is set by default, the cp210x_get_termios() does not process > IXON, So it is invalid IXON at this time. Right, with the current implementation you need to make sure that termios reflects the device state on open or your changes will never actually enable software flow control in the device. > As you said, It is very strange in cp210x_get_termios() In the "get" > function to "set" IXON. In addition, the best way is to disable the > IXON bit as you said. If the user needs IXON, call set_ termios > function, So I'm now in cp210x_get_termios() Is it a temporary > solution for terminos to handle IXON ? I'm afraid it will need to be > adjusted. No, I didn't mean that IXON should be disabled by default. I meant that the driver should make sure that the device settings matches termios on open, not the other way round. This unusual implementation has caused a number of issues in the past and it's been on my list fix up for some time. I finally got around to that today and I just CCed you on the result. That should simplify adding software flow control and allow more code to be shared with the hardware flow-control handling. I've pushed a branch for you here: https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git/log/?h=cp210x-termios Johan