Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp248719pxp; Wed, 9 Mar 2022 02:03:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOsX3ybjM/JRqFlyIHxLXt/C8+KlJ4bWaJ/RP4NInw3P5U6M2jHG7PeDHebsaWCGm3FK1p X-Received: by 2002:a50:fd8e:0:b0:415:fe34:f03 with SMTP id o14-20020a50fd8e000000b00415fe340f03mr20103529edt.310.1646820187241; Wed, 09 Mar 2022 02:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646820187; cv=none; d=google.com; s=arc-20160816; b=LMiKffWMkBRXVirwHfihLy2Zx90K+Go5R5EK0VbNzob7ZUp0xcqsITmt6iwOuA2U1+ sZgL/uuZmKTXA5wtCFisI11aQntAAl8TULVuMic9nyk5pWhUAMCTGH8DJtcZwjYkNMX8 DheC68k/HnlPH8XCXb+udJxada7nzOy/b65K9wt4XM/f5otNcOb9bW4m9ftNhbe3pjeT QC3LVKypValKs/mDhzSJ6sPXumdmo0/PFcJDvcCresKHaDn9pbrVxKhL12TNbVPNzwat t7AQDNWPs0b3fLtxm6N8Sqwls9dsWvwDyaGSCjLrUNITZ6/9i8cQia4Ok7zdsoB2YEe/ nOCA== 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=zxo5bCyaUr3ZNCsLV1tYp4icIcPiDkoAjAsZcO3LWx0=; b=jEVubP+9oAxIM+q51R6UYg/GpyZ3VNJUlrv4PVPP3waWnX9KtBPOcbDrWIQc+tFQRM aA52pPUMKFgGzmBlNkNAPV7014/0b1dfs6EcMWWHkWH75URWpbQKKvQHWgPJ9rPb3ifu So8EtH27+h2jDwguadjCkC0E1Bv0/V5si2v9Dve/MgDqLvQnOl/Yw/KWYp7dwMKQNnCh 7ava6O+ZVEv30SzWVR5kiPpJX/RKzYLC1SUA2snG1yIIEO1RNmEZJ5gBNLRrYbXPloQn DMgVn+Z87I8Cqrel6Ru+6D/1ZOMgLUdefqgn0A2TmhmGuAVaIY/OWZYsK/HdOxMUf/gd ozmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=F2rh5V5S; 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 r26-20020a05640216da00b0041613e9744csi884593edx.294.2022.03.09.02.02.17; Wed, 09 Mar 2022 02:03:07 -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=F2rh5V5S; 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 S232287AbiCIJwO (ORCPT + 99 others); Wed, 9 Mar 2022 04:52:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232255AbiCIJwN (ORCPT ); Wed, 9 Mar 2022 04:52:13 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C0E116EA9E; Wed, 9 Mar 2022 01:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646819475; x=1678355475; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=Zych22kl5xpT4JSarhqPONWWkJ6kwcSGyYiRLML481U=; b=F2rh5V5SF9gF+BZ4vT5+aLefi0e3jJE6QSn7JO2/UeTvkEEhi4xVMAZK MT4TsgcJ5HJZ/VIoo5vO/wcwwT4DxD5Y+iMJHO5JQ+dtTfJiebeU/x/6l RlMbBSc9lHtFvByLPvKk/pU0+DoPdco1posVDGrK+N1YP8/R1gD7SAXHw GZQmHlfeZn2LBDLG2Zf4NcJcM9T5sZwYBQWDr5x4KA8VHSBsDbW6KPGxo qYbysFR67cakEWYTbpRjbpTk82uN4liwD9tfHFbMD0HARmkvY44S33x0T CbYyyhhRBiQ7ENSeCsJp/1hKl+Yo465eAxt4kz8OUCFzQQvZgelCVWKsa g==; X-IronPort-AV: E=McAfee;i="6200,9189,10280"; a="254876017" X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="254876017" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 01:51:14 -0800 X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="537943718" Received: from vladi-laptop.ger.corp.intel.com ([10.252.32.21]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 01:51:09 -0800 Date: Wed, 9 Mar 2022 11:51:07 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Lukas Wunner cc: Andy Shevchenko , "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 In-Reply-To: <20220308203014.GA11096@wunner.de> Message-ID: References: <20220306184857.GA19394@wunner.de> <20220307191854.GA27748@wunner.de> <6931d6ad-7520-b585-a8ba-35349e730bb@linux.intel.com> <20220308122220.GA24694@wunner.de> <20220308145042.GA20520@wunner.de> <20220308203014.GA11096@wunner.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1890276712-1646819472=: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-1890276712-1646819472=:1769 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT On Tue, 8 Mar 2022, Lukas Wunner wrote: > On Tue, Mar 08, 2022 at 04:53:56PM +0200, Andy Shevchenko wrote: > > On Tue, Mar 8, 2022 at 4:50 PM Lukas Wunner wrote: > > > Of course, if hardware-assisted DE assertion requires a particular pinmux > > > state, we could double-check whether that pinmux state is set. > > > > I'm wondering how to achieve this. > > On DT platforms, the devicetree specifies the pin controller settings > which need to be configured for a device to be usable, e.g.: > > pinctrl-names = "default"; > pinctrl-0 = <...>; > > Before a driver is bound to the device, really_probe() in drivers/base/dd.c > calls pinctrl_bind_pins() which configures the pin controller accordingly. > In other words, the OS is fully in charge of configuring the pinmux. > > I'm not sure how this is done on ACPI platforms. If the pinmux is > exclusively under the control of the platform firmware and the OS has > no way of getting or setting the pinmux configuration, then that would > be a competitive disadvantage vis-?-vis DT platforms which should really > be addressed. However I notice there are various drivers for Intel > chipsets in drivers/pinctrl/intel/, so surely there's a way to let the > OS handle pinmux settings? The problem here is that the driver ("we could double-check" in your initial suggestion above) doesn't know which pins it should check the states for. I don't think any general mapping exists between drivers and pins. Based on what I read, the mapping is a feature not wanted into pinmuxing. Assuming I understood them correctly, they don't want to do such thing on kernel side (based on experience with earlier approaches with mapping. It probably got too messy/unmaintainable in the end :-)). So at best, one can only read and control pin mux states but that's about as far as pinmuxing in kernel goes (and control could be locked by FW). Anyway, I've implemented the detection now based on RE_EN non-zero write + read + check based on your suggestion (despite still thinking myself it has these obvious problems with pinmux & other hw config unrelated dw uart itself). -- i. --8323329-1890276712-1646819472=:1769--