Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3567545pxp; Tue, 8 Mar 2022 17:39:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiFP7JvxWl01uG2vdTcdvETYn04PSIYd1pF7WU5aDOQ7c3Z4quIa7oXafm4h7Uh2znjFnP X-Received: by 2002:a17:902:f602:b0:14f:53a8:64f7 with SMTP id n2-20020a170902f60200b0014f53a864f7mr19875128plg.151.1646789974499; Tue, 08 Mar 2022 17:39:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646789974; cv=none; d=google.com; s=arc-20160816; b=Ak9kIEriJAhlGFocVNC0Ncg/RrXrkLhLhbO+jRxSAZHAc85k/pGfiZdNnR/K8tGnZe onXkhRhDsfcdBjCFp15r3KV/ySHU8tckcWGTeby55KuSBUH6nZ7YJBcj7nXgBTXoosiV p1GUjVfzlFVhsA/sf5cJP3xanMV+1oRSqUEs3dhlxsnAXDfj77wJHAQ1z+LubI9i+2mt 3xdhceKeZXtBEi8wnAwygOWeToUdQbmZRVxYhZV/uE9EyRu+Jd6/HjixlIQXCaTy3J6g 7YPIFfpkxxkHqdNSHdcKv40FFkqQ99K5jvh73kHXX3VgDVY72Ku7fmL1smim5zFEmgos g7nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=o2Noq7NsCOrB6lD2sG9/OrUSKIPseqQK/BWk5q+mKlw=; b=Kmt+RYuMHp9BPbrQ9hz/Y0S2u222zmmsl4jixhB69bmUETuU0CbbD5atlH3LX4HXx4 eSEb1OJ6VgAyTQrCl0asw12RBrW5hn7tW5FVYn23Z93p9c55CO9fxcQX36ZmRmGcgHTz C4uvEkAMABJouGsCH6C87637hBYiNxM1TSokVcgmOdyUVCzE60iMB64DbmOpc0kZV/uh Hge44u70IfsgHjFOPvZ1sGfHKR0O2DzRGUnq+fg8nhFh/mNvcwcr2hE4Xh3060vv2+xf BISHfYfF8YCNdS41BjJBAPMQjUES21i91KbKGoyDgZy0l1G9dyiP6NEB0AteIYMr2RDd bdsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lk7-20020a17090b33c700b001bd14e03073si4300339pjb.75.2022.03.08.17.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:39:34 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2B7662129AD; Tue, 8 Mar 2022 16:32:59 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241005AbiCGTlS (ORCPT + 99 others); Mon, 7 Mar 2022 14:41:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231883AbiCGTlR (ORCPT ); Mon, 7 Mar 2022 14:41:17 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B53A13DE2; Mon, 7 Mar 2022 11:40:22 -0800 (PST) X-IronPort-AV: E=McAfee;i="6200,9189,10279"; a="254217114" X-IronPort-AV: E=Sophos;i="5.90,163,1643702400"; d="scan'208";a="254217114" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 11:40:22 -0800 X-IronPort-AV: E=Sophos;i="5.90,163,1643702400"; d="scan'208";a="711233447" Received: from smile.fi.intel.com ([10.237.72.59]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 11:40:19 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nRJCg-00CxVa-V8; Mon, 07 Mar 2022 21:39:34 +0200 Date: Mon, 7 Mar 2022 21:39:34 +0200 From: Andy Shevchenko To: Lukas Wunner Cc: Ilpo =?iso-8859-1?Q?J=E4rvinen?= , "open list:SERIAL DRIVERS" , Jiri Slaby , Greg Kroah-Hartman , Linux Kernel Mailing List , Johan Hovold , Heikki Krogerus , Raymond Tan , Heiko Stuebner Subject: Re: [PATCH 1/7] serial: 8250_dwlib: RS485 HW half duplex support Message-ID: References: <20220302095606.14818-1-ilpo.jarvinen@linux.intel.com> <20220302095606.14818-2-ilpo.jarvinen@linux.intel.com> <20220306184857.GA19394@wunner.de> <20220307191854.GA27748@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220307191854.GA27748@wunner.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,SPOOFED_FREEMAIL_NO_RDNS,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Mon, Mar 07, 2022 at 08:18:54PM +0100, Lukas Wunner wrote: > On Mon, Mar 07, 2022 at 11:19:59AM +0200, Ilpo J?rvinen wrote: > > On Mon, 7 Mar 2022, Andy Shevchenko wrote: ... > That's for DT platforms, but I suppose you've got ACPI. Not sure > how it's handled there, the ACPI 6.4 spec contains a "UART Serial Bus > Connection Resource Descriptor" but nothing on RS-485, so I guess > the only option is to use regular DT properties in a _DSD object? Which make me think that this series needs an additional patch to describe RS485 enumeration for ACPI case (somewhere in Documentation/firmware-guide/acpi/enumeration.rst IIRC the filename). ... > > I initially had additional version check here while developing this > > patch series but it seemed to not provide any added value due those > > other factors that need to be considered. > > Here's another idea: > > Read TCR register on ->probe. It's POR value is 0x6 if RS-485 is > supported by the chip, else 0x0. (Page 220 of the 4.01a spec says > UCV register does not exist if additional features are not implemented > and reading from this register address returns 0, I suppose the same > applies to TCR if RS-485 is not implemented.) > > Since the driver may change the polarity in the TCR register, be sure > to write 0x6 to it on ->remove so that you can still correctly detect > presence of the RS-485 feature after unbind/rebind of the driver. What to do in the case when DE pin is muxed to RTS and locked in pin control IP by firmware (no possibility to change the muxing in the OS)? -- With Best Regards, Andy Shevchenko