Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp252866pxh; Tue, 9 Nov 2021 10:08:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZwyfqvjb2PdL9GytIsLCD1QcGrO+EG/CHGgjBN2WUEVVTgLjIHS8oF2suLKaG5C1lK464 X-Received: by 2002:a17:906:ce2a:: with SMTP id sd10mr12247927ejb.154.1636481338620; Tue, 09 Nov 2021 10:08:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636481338; cv=none; d=google.com; s=arc-20160816; b=WZvFnV9AYIS6+acn2Xohri6TbRZrK31yhy/EGrBaqtAQLwxymd74L+kZDljksyOldh 3JYUE0kXyU8lrhsUzBV9PRLZoLl8E2C+s35rYLi7fqHaeZGDAv35sMmfGW6/mvh+0lDg ZEgVyILftKOUGthrgTGOe6UEl2701tiy5vpV6uQstuYb+ed/Fx79kNrRJI9EMvYisMYA q2s41sKKN9UZ4xEybfI/rr/gmOFAEEL7eeoHIav74p/ihWn5ZXpcTAmx3VnXylIonRyW jQ4ozoQOB7eE7z98kNAAKCwwr5kJOwTcGoLPj+2JQKJX8qpVJvqcvnQ4Mo4U5cZIpa1V 3kmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lcKEhYP4+yPtNIxKXGgbgdUfjg0mHGJfVwUnsoOpxAY=; b=RrldP/bh8f+LDZXwBxnOBKmQDerz1uvYgbGs6DlorALQCeeeFL6Al/QuMF0n/VpGnx mmyps1JwnWuxrfbZIBkBa41MoD4yHaBn+X/Jkqwmksyq9aQwf+0Su11SRByjm3KiJMFM JOgFBLgbJqcKlB/q52ReqUjc7LAStpoI3UxB0bYyE7XN4pkBbU9xlJ0ORWSt5t3/vpbS 9Rcq7Sf1j5gWkTrHgNzvrMVFmniv/rik8RQrI5G90BuGQ3Bq0Lq0VK/U8qaQtbWE2wg8 3NNWzZEBcQebr6y9/h2m+RGxYH1ZKq9MziXItTHqI+pVazlMzJ9AdflS6FEdfLDdiVL/ Vj2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oBOlsPNF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si30499398ejn.343.2021.11.09.10.08.33; Tue, 09 Nov 2021 10:08:58 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oBOlsPNF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244918AbhKIJgw (ORCPT + 99 others); Tue, 9 Nov 2021 04:36:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244908AbhKIJgu (ORCPT ); Tue, 9 Nov 2021 04:36:50 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10976C061764; Tue, 9 Nov 2021 01:34:05 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id j21so73927512edt.11; Tue, 09 Nov 2021 01:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lcKEhYP4+yPtNIxKXGgbgdUfjg0mHGJfVwUnsoOpxAY=; b=oBOlsPNFn0gaiki/GKvqQJhMANbtFxOs60cmycBfbRyX7suhZrv7wMadmLWmbukSj0 WVppmPtJZ6QZzoQmxVXt2p0O/MEph5yQ6OEO0Mq85tIq+XybH2FvFsxa+mV+WC6ntqhX Cqn3eUugJJjA2il/u7B3VbpqcJmouLsZX0gwdDQl6qmPuf6++BE8k4aGNeShMRCnyvWP FU6osIQjARDVHbACUoCWr6fsdL/wX3pRQfOy0rbHO7zbCF+egA0hXhU43sqZhvH1K6uK aXrMvmzo7eqBHdkR2x1eKQd7P2QvL6P/WCK8/cYgqmJc1Mgp1IaP9tRdkLTTxz5la/ve xFLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lcKEhYP4+yPtNIxKXGgbgdUfjg0mHGJfVwUnsoOpxAY=; b=Y+Y+NCFoxgaUMQPeF34VIiSODbxmDhFBYCRLSH3CTavGSuJdV6btbklYG4japLw6vf somsTYOTQJ7m73w7otY8a3f/7NrbOtryhlnMiSqOi5i3Gx9+ebCn+d4H661dSg9LLCfM x9nU4swCfFaUntmlR7nZqyTU6e7qQhBzXoZPOdf7V55+eoMhPojVV3eIg7GW6bj5h5VB ilDsCWOPwaOkNqT3svp2A2JqJKiiroNCkj8LSa3bu/5l065Z5d6xWz7Cyvw83jsxXZJq Ul6SA06nPDwbYgvV0/5JEKqS6D+iOhFvm4kM4/7mNNC+ev2PPfoVAiOXC9yzW1opGPxU bkuw== X-Gm-Message-State: AOAM531n34kvUlGqghDz6eQSk0zS4JUVOo4gxdfpWEUo7+wdE+Ceuo1N 2OByBxgdcXm4JCJ/wHYrpKNLSuIzL3IXLjOXQhs= X-Received: by 2002:aa7:cb09:: with SMTP id s9mr8212855edt.359.1636450443458; Tue, 09 Nov 2021 01:34:03 -0800 (PST) MIME-Version: 1.0 References: <20211102161125.1144023-1-kernel@esmil.dk> <20211102161125.1144023-13-kernel@esmil.dk> In-Reply-To: From: Andy Shevchenko Date: Tue, 9 Nov 2021 11:33:18 +0200 Message-ID: Subject: Re: [PATCH v3 12/16] pinctrl: starfive: Add pinctrl driver for StarFive SoCs To: Emil Renner Berthing Cc: Linus Walleij , linux-riscv , devicetree , linux-clk , "open list:GPIO SUBSYSTEM" , "open list:SERIAL DRIVERS" , Palmer Dabbelt , Paul Walmsley , Rob Herring , Michael Turquette , Stephen Boyd , Thomas Gleixner , Marc Zyngier , Philipp Zabel , Greg Kroah-Hartman , Daniel Lezcano , Andy Shevchenko , Jiri Slaby , Maximilian Luz , Sagar Kadam , Drew Fustini , Geert Uytterhoeven , Michael Zhu , Fu Wei , Anup Patel , Atish Patra , Matteo Croce , Linux Kernel Mailing List , Huan Feng Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 9, 2021 at 11:21 AM Emil Renner Berthing wrote: > On Tue, 9 Nov 2021 at 02:01, Linus Walleij wrote: > > On Tue, Nov 2, 2021 at 9:08 PM Andy Shevchenko > > wrote: ... > > > Linus any comments on this code (sorry if I missed your reply)? The > > > idea behind above is to skip all settings from the same category and > > > apply only the last one, e.g. if we have "bias set to X", ..., "bias > > > disable", ..., "bias set to Y", the hardware will see only the last > > > operation, i.e. "bias set to Y". I think it may not be the best > > > approach (theoretically?) since the hardware definitely may behave > > > differently on the other side in case of such series of the > > > configurations (yes, I have seen some interesting implementations of > > > the touchpad / touchscreen GPIOs that may be affected). > > > > That sounds weird. I think we need to look at how other drivers > > deal with this. > > > > To me it seems more natural that > > starfive_padctl_rmw(sfp, group->pins[i], mask, value); > > would get called at the end of each iteration of the > > for (i = 0; i < num_configs; i++) loop. > > That would work, but when the loop is done the end result would be > exactly the same. It seems we interpret the term "result" differently. The result when we talking about GPIOs is the series of pin state changes incl. configuration. This is how it should be recognized when programming hardware. > The only difference is that the above would rapidly > "blink" the different states during the loop until it arrives at the > result. This would certainly be different, but it can never be the > intended behaviour and only a side-effect on how the pinctrl framework > works. Is it? That's what I'm trying to get an answer to. If you may guarantee this (the keywords "intended behaviour" and "side effect"), I wouldn't object. > The order the different states are blinked depends entirely on > how the pinctrl framework parses the device tree. I still think it > would be more natural to cleanly go to the end result without this > blinking. -- With Best Regards, Andy Shevchenko