Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp478342pxp; Wed, 9 Mar 2022 06:44:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyU2xMIZUhRuQm8RNgVnFvF9d+oWH9T31i3CfG00gOJwdTDv/AyKm7o6JThMrfBuVbJXZ0U X-Received: by 2002:a17:903:2ce:b0:150:4197:7cf4 with SMTP id s14-20020a17090302ce00b0015041977cf4mr23774873plk.132.1646837097232; Wed, 09 Mar 2022 06:44:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646837097; cv=none; d=google.com; s=arc-20160816; b=v1UaqZQwmJSM2VZCwvl5dsBoMNj4O+LgEjDWlWr1FugSYB+FXFfPdesSQp4h/snJIj GX2gRvyeWcFcOapGVKMoWPu6LiUgv7JmGE97Xfx72bkgJeylIGRHI9rRAatQpRZOWpfQ FJcz9cwkXn9tBk2BHa6idAyWORAh4ICK0I0AUmjRa2xnNgGpnuR/tC6ZBSYLWrDGqQYo vilbLMoQeJ0cs3iRl8/2A+dq+5BziRijsRSQqWishfW+i4J7NUCN2+Lv/XT+Px7aRP06 SZUCUBA43oTcFAoAJcRveXnAbkE3NrUJFAwcXC0JeWKRkrTb2U3K0sexPLnhuzbnLFJ/ yr6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=RLkv4ZMBoSvcI+gCA16XyIERxBd7SLIwU5EWCymCWxc=; b=Lgh4OaaS6Bhw2EHgKW5GsSXTt+G1asBdfU36JhkA6oSKbSyrwIt/HMGUR+dVur2uVX 5KI0rw4d67sMdg6NQZ8SIde9lqR7RsUL6VoX6BxyXrSzvsd2FdkaA4/xYLmvMu1Th4AJ iZn7PXoo0WwZ09uY/ml0hwVgI8Iv5hod6U73u4b2fW4SgiO9pmPUfzdaqwAPkaU2FHgf uzLDnHZhdhDxcEVyMjTNSg9EvcAEx+kHPRZM+Z/axpclgPxCQH6Y1f8aHBxnYm/EVqLG /mj5wKKHCwJNnnxayDmr8FKcn1P3oizLFu1oIwHeMeK3ZON2K9tc+xiDv5/o+90/h1f1 o3Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bNbOXVk7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q22-20020a632a16000000b00380189b7747si2022993pgq.323.2022.03.09.06.44.39; Wed, 09 Mar 2022 06:44:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bNbOXVk7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232549AbiCIMUo (ORCPT + 99 others); Wed, 9 Mar 2022 07:20:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbiCIMUn (ORCPT ); Wed, 9 Mar 2022 07:20:43 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69F9217227B; Wed, 9 Mar 2022 04:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646828385; x=1678364385; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=2XNQVwdKnvrJJjNli7sgRrYSwBvQxLv8hzZcl5S1ao8=; b=bNbOXVk7hj9vukwuL4bJBXN242qxUDXmB4b0wi+ZZBDeNwUN4OCFkggZ FcW9eXwxbvhA0KHTtZNeg0RqKiZfjHdU1rNnkMX6uZEvwc4gFV+wPLkQJ OvC3uNqTwyqRWEGiLTB+Nc+pt4eu4Z4T/8Rxmko3zdBfEzbaw7v38kCX/ DmvF1eHMBuITbJz7lIxDRzVL3xukJBitm4vaWVTo04ouVD47nPztdidzn A3wi66wpnJXEQPkRJWwCfWd88NpikeIEur91sv9SCb4PEkvIyEIZHBykC WkPl57MZhy7nBIa30j1wYqMsheGZEAeWh4dbcXc7plG6o7PM5Cl1ub9sh A==; X-IronPort-AV: E=McAfee;i="6200,9189,10280"; a="341390397" X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="341390397" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 04:19:45 -0800 X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="554095705" Received: from vladi-laptop.ger.corp.intel.com ([10.252.32.21]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 04:19:41 -0800 Date: Wed, 9 Mar 2022 14:19:39 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Lukas Wunner cc: linux-serial , Jiri Slaby , Greg Kroah-Hartman , LKML , Johan Hovold , Andy Shevchenko , Heikki Krogerus , Raymond Tan , Heiko Stuebner , Rob Herring Subject: Re: [PATCH 1/7] serial: 8250_dwlib: RS485 HW half duplex support In-Reply-To: Message-ID: <9c2d96c0-44cf-c84c-5ff7-34c74716a23b@linux.intel.com> References: <20220302095606.14818-1-ilpo.jarvinen@linux.intel.com> <20220302095606.14818-2-ilpo.jarvinen@linux.intel.com> <20220306184857.GA19394@wunner.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1618434843-1646828384=:1769" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1618434843-1646828384=:1769 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT On Mon, 7 Mar 2022, Ilpo J?rvinen wrote: > On Sun, 6 Mar 2022, Lukas Wunner wrote: > > > On Wed, Mar 02, 2022 at 11:56:00AM +0200, Ilpo J?rvinen wrote: > > > > + /* > > > + * XXX: Though we could interpret the "RTS" timings as Driver Enable > > > + * (DE) assertion/de-assertion timings, initially not supporting that. > > > + * Ideally we should have timing values for the Driver instead of the > > > + * RTS signal. > > > + */ > > > + rs485->delay_rts_before_send = 0; > > > + rs485->delay_rts_after_send = 0; > > > > I don't quite understand this code comment. > > It seemed to be missing one "Enable" word. > > Here's my interpretation of it (this comment was written by somebody > else, perhaps either Heikki or Andy): > > Since this HW has dedicated DE/RE in contrast to RTS, it is not specified > anywhere that delay_rts_* should apply to them as well and that the > writer of that comment was hoping to have something dedicated to them > rather than repurposing RTS-related fields. > > I could of course change this if everything called RTS should be applied > to DE as well? Now that it has been pretty much established that anything called "rts" should be applied to DE as well, I took another look on implementing these delays. It turns out to be impractical to do/ineffective because "serial clock periods" are used as the unit by the HW ("serial clock periods" is not as clearly defined by the datasheet as I'd like but it is most likely based on the high-rated uartclk cycles). With the uartclk I've on test HW, the combined delay with max turnaround time and DE assert/de-assert timings cannot do even the smallest possible non-zero value (1 msec). That's because the TAT and DET registers allow only 16-bit and 8-bit values for delays. I also attempted to test it by writing the maximum values into them and got no visible difference. There a note about +1 for delay in TAT so to play safe I put 0xfff0 instead 0xffff (if the HW couldn't handle that 16-bit overflow properly). Perhaps the SW half-duplex with DE/RE will have to be used to cover this case? -- i. --8323329-1618434843-1646828384=:1769--