Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2262782pxm; Fri, 4 Mar 2022 12:36:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbs8GoeBizSTn7LL7MIOUOKgVECAx3Z6ot/DCZ8sCbcLrLWEDGnzNAcPUhwws6xPoJ9nI3 X-Received: by 2002:a17:90a:b010:b0:1bf:2ce9:8774 with SMTP id x16-20020a17090ab01000b001bf2ce98774mr3753226pjq.137.1646426176041; Fri, 04 Mar 2022 12:36:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646426176; cv=none; d=google.com; s=arc-20160816; b=iVbWGf+Aa5UIiZi6uprJrrFPqzzN9mHvt1n/S2KyxHCfud3Ywqc60+4QZCf2eSqN5C 0JOWaJxrrTblp6ys8CyVnFMIq38L4JMa+bLJ0umoIKVLJh+/m372CeUC64aWg9iyzm8G /FpxTUV25XD2roqw+GJQJ4t3Wzp/iRoRoLkUm99c4kFfvoBJ3yT+N4q1QsrwfWjcoBOG yuOrAk1I+4n9TQAI2uqt2KhhHouIZSKKM3tPtnTcBShlcsgW2QV2anO9U5VFN6akaqZA Bz/q28wiIlQRmxAonKeqYmdNy/bpYp9aa70yaLAWLW3PFwvN/XZBsz4FDuiKV1VUBvow ijKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hm9ZHCdxUfWlE+2D2qD0XKkS9XlGnATj/t+fcgqmu5g=; b=ueXNqa02E77rxQV9byI81oXFBjNs3dtMVkmJ6rpNMc/mOKJw47taPeogxuQ4haR5O7 j8d7uAVtaaPtJ7wmxTskiwyvycatwJ7O8rR0X1bJSMypxZknSFcg+5v/t5sv5LDM9dZ6 uT5XAbacqAgAQ3kUjCpb76Mt0jVSdhb9ESxfymQK3vTPftWVkxwHU8PEd6CMBGOiUaYF f9sFQI8J/DJ2WCoH3P0uHS56nTpHHuUloL9o6F1GtcJKweoLGzoRJ/g9fEmD6xsJR+NZ GzhMFNKoVXGUnpv9i38TbdS++x15nI5gu5DI2MYyIUMws1uYBMeJEHBWCRzGEcf5+BiI g+yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=2kGsGoJq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r22-20020a6560d6000000b00372b2d98e7asi5546320pgv.41.2022.03.04.12.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:36:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=2kGsGoJq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 26F3D2C94B1; Fri, 4 Mar 2022 11:40:44 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239680AbiCDMHM (ORCPT + 99 others); Fri, 4 Mar 2022 07:07:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239677AbiCDMHK (ORCPT ); Fri, 4 Mar 2022 07:07:10 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 807E01B30A4; Fri, 4 Mar 2022 04:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1646395583; x=1677931583; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=gZtyK7pDwLY5lAZrCyJHDcj242KDLDUK8zT8V+IfAjI=; b=2kGsGoJqcUzDc0l+/4+cfvp8oJ/tsYBEV/Aq5wUA3fJH4EoAdIRYPMnY bEHuYbZpbL8VdJH8ohMbigYceA4wtTEXX+Z8ofgPmit9ecAFsu2W2w2MV OYvfHGUk81CuKXMhEtHFcLpME1XaoUqP9Sqo5EJW12rD/h2KDBAHF/3Sm v+WhmToKQgVSTgDjHCjSVr1fPl/QzGS4utCSB0UwUO91nwhFikPkzSXAq 95zGEdpOUXNOq7RdUqRDYn1Nx/41ifAWI/zy1xkuc3E5bFgxSNNHruWv7 1sOJLKG1omr21flg7WVct/r9WULm6z/gkltNC2ZVIpEnJNqApVoOcz+uM A==; X-IronPort-AV: E=Sophos;i="5.90,155,1643698800"; d="scan'208";a="148093200" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Mar 2022 05:06:22 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 4 Mar 2022 05:06:21 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 4 Mar 2022 05:06:21 -0700 Date: Fri, 4 Mar 2022 13:09:11 +0100 From: Horatiu Vultur To: Michael Walle CC: Lars Povlsen , Steen Hegelund , Linus Walleij , , , , , Colin Foster Subject: Re: [PATCH v1 5/5] pinctrl: microchip-sgpio: wait until output is actually set Message-ID: <20220304120911.i5rngplg5l6gnnyy@soft-dev3-1.localhost> References: <20220224161021.2197263-1-michael@walle.cc> <20220224161021.2197263-6-michael@walle.cc> <20220225092427.jjilv3qo52crsmuw@soft-dev3-1.localhost> <2f8a215c67269d639290515931d10b78@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <2f8a215c67269d639290515931d10b78@walle.cc> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,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 The 02/25/2022 12:29, Michael Walle wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe Hi Michael, Sorry for late reply. > > Hi Horatiu, > > Am 2022-02-25 10:24, schrieb Horatiu Vultur: > > The 02/24/2022 17:10, Michael Walle wrote: > > > Right now, when a gpio value is set, the actual hardware pin gets set > > > asynchronously. When linux write the output register, it takes some > > > time > > > until it is actually propagated to the output shift registers. If that > > > output port is connected to an I2C mux for example, the linux driver > > > assumes the I2C bus is already switched although it is not. > > > > > > Fortunately, there is a single shot mode with a feedback: you can > > > trigger the single shot and the hardware will clear that bit once it > > > has > > > finished the clocking and strobed the load signal of the shift > > > registers. This can take a considerable amount of time though. > > > Measuremens have shown that it takes up to a whole burst cycle gap > > > which > > > is about 50ms on the largest setting. Therefore, we have to mark the > > > output bank as sleepable. To avoid unnecessary waiting, just trigger > > > the > > > single shot if the value was actually changed. > > > > I have tested this patch series on our lan9668 board and it worked > > fine. Thanks! > > Thanks for testing! > > > I just have few questions: > > 1. What about other boards/chips that have this sgpio, do they have > > also > > the same issue? Because from what I recall on sparx5 they don't have > > this issue. I have seen it only on lan9668. > > Unfortunatly, I don't have any knowledge what IP core is used in > which SoC. I assumed the lan9668 used the same as the sparx5. If > that is not the case, we need a new compatible. Do you know if it > the same? From what I see, it is the same IP. > > On the sparx5 are there any peripheral who you would actually > notice that the timing is off? There are some SFP connected, similar to lan966x. So I don't understand why that issue is not seen there. > > That being said, I'd assume all the serial gpio controller has > this "flaw". Simply because a register write won't block until the > value is shifted out to the shift register and actualy loaded by > strobing the load signal. It just depends on your burst setting > (even with bursts off, and clocking all the time) on how large > the delay is. So you might or might not notice it on a board. > > Could you also have a look at the other supported sgpio block, > the ocelot and the luton? I don't have any register description > of these. > > > 2. I remember that I have tried to fix this issue like this [1], but > > unfortunetly that was never accepted. Is this something that is > > worth > > at looking at? > > That fix is at the wrong place. You'd need to fix every gpio user, no? > Instead this tries to fix the controller. Yes, you are right. > > > > > [1] > > https://patchwork.ozlabs.org/project/linux-i2c/patch/20211103091839.1665672-3-horatiu.vultur@microchip.com/ > > -michael -- /Horatiu