Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1907702rbb; Tue, 27 Feb 2024 05:15:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV942e4IPtiKS8247wv9bPyJFrkHfpuRyQgVw5mqnbFuWXtDmUHjuV3C5m2UH9Vg/87RmMFe0JwRtmAgcJ0o70o1kNd5c85VQqDzJzL5g== X-Google-Smtp-Source: AGHT+IH3f8PA7AA2nrOL62XFChAlVV6R2iIsLd54eojMn6X8erRY004V0czlHIhzsd0ry7YzgIpb X-Received: by 2002:a05:6358:7e81:b0:179:272e:54c6 with SMTP id o1-20020a0563587e8100b00179272e54c6mr10192931rwn.25.1709039708385; Tue, 27 Feb 2024 05:15:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709039708; cv=pass; d=google.com; s=arc-20160816; b=eZe+sGaCa7BF86a/Naf/8khjNOxg4Iu9nv1/Sj05nxyO0DoLpx7gih9lKn/APZcQaS d9X33UxcHgGPeXajQnoDvK1t8T2vZD98wEqTfAMY+FZzre3rXmZ2TH98WI/JNKnDqi7a EYgzabzg87J79mVAyirNGQHVkSKYKQLy1V6T4BGLsxpZF39tj7fhit44yr+8NudKctOl tjLVHscoMiZG5kuaQ6HI1hyitTxYHszDiq2/1qpNcKmwBzAi19kXWGCQL0t8DKub2a4g LTT7rK4x1h6HroQPmdSFkDBQLCy6hlwezJ2MFBwKVGGJFUBY9Vruqk80B74rt35qKWSw twbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=2AMRMbVhNM06Hgp1X0TeGKqLaPQRtt3bhZ1iElXox58=; fh=LcxO27J+TX96G6ivhbPGLcIQZ3qoxkpD4tHSxGNulFo=; b=1Lh6RH2Hw/wzTIDjOG4w4Sj4WPUU0/H5SDOpLL8NhmY9Xpzmcny31NFdzkmNioXxAO 6K9y/+b8Nv3XncRu2QTHR7bt8OC4nGcohzEiNdB+KYAnH6hruFajLbsKUpRl5gPzUFmV HCOKWzkQALHh4gGK9HUM0UJUeBUHWPWR1x7n1UOH9ku2qKLScgFp3/8TwnnycE0Q3v8W UYhq/NOzvb3jk/pfWaFxzENehokJahGHoE7smA3spGYgqc7a7dLBUYl7G7TFhr1knG4E 7jf0dtbrgW1wGTVc4WoPZ+AsSaK/XbyscJUh5I4wabVLD3UnE+Yh+sL1uJxYuaMNuAb1 ku+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=qple0pkx; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-83296-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83296-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s22-20020a05620a29d600b00787d6989706si3980416qkp.98.2024.02.27.05.15.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 05:15:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83296-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=qple0pkx; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-83296-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83296-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 235AB1C24B0B for ; Tue, 27 Feb 2024 13:15:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7ABC613B2B2; Tue, 27 Feb 2024 13:14:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="qple0pkx" Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 110281EB25 for ; Tue, 27 Feb 2024 13:14:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709039695; cv=none; b=Ev4kcqWCSfaMQFJa2HvGB1nDBdRa1UsS2YiKK8VDCGL+tXygRWpM0eC8XRgakP8wzWhSuqV/mVOA0MoqSFTUJHFe1k3EQZLVrGKXE7VHsI2VHJ2u1yjx7Iqdqg1xqusr7ZGoipsymFS9gbhQCMYCcl5l2ooL11TDOHlhvnh6kQM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709039695; c=relaxed/simple; bh=2AMRMbVhNM06Hgp1X0TeGKqLaPQRtt3bhZ1iElXox58=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RuEjmWU26JM8l1m1WNkxHshXbu7LLhCZQQGQGX+zNo49oECkO5bbXjx9z7n8UYmR452/X7uLGOhDPwD5acd21BU+PkWnJnpfbYNFIBWHTqV5fr7euDuU1tLwXorlFIGSJrOsTqSDr/JOnN+w0T4XXVmwolN07VOaLGPJL9a8mq0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=qple0pkx; arc=none smtp.client-ip=209.85.222.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-ua1-f45.google.com with SMTP id a1e0cc1a2514c-7d6024b181bso2072903241.2 for ; Tue, 27 Feb 2024 05:14:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1709039693; x=1709644493; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2AMRMbVhNM06Hgp1X0TeGKqLaPQRtt3bhZ1iElXox58=; b=qple0pkxnzJDd9Yn+9eMXeEhbx85nGc++HkFBgEW6ANDwHzduvps37G+TjRJCmE45U cx1QxYQkn2HKg0nq9fT0Q2D70AMlUVHqrpapR/rqBYdAvmOJ+cx0Gch9hwTc9YmvhtgC 0UkIwgCq11oGB1PT3uMrKzPdEcF6eZJNjee4qaIJyaEuNdxoxD1so99pjcPJNqgmrMLU fkxcxvW8ZWPxn6OZvkEKeHCSRmj8Sh3u5wmMO38xR/jy8Lx7a/MSXfWcMCti/2Fs984g rVAEi4mmnhwt1YY+hGfFXRPeUnhDFUUXbljisVrsLBI4e2h/hS8e9qmQNUoq9NlbSr/6 X3aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709039693; x=1709644493; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2AMRMbVhNM06Hgp1X0TeGKqLaPQRtt3bhZ1iElXox58=; b=jpjGqxQbDB7k7Re1YwrEoceubcKbEayfBZfb1QQeK03FHB3JrNY8kJZCki/PKGqxvc +fdtv7pxOCkUDvFbhyOEDUvs8mGCnowwtyk0sdOHbbUFLsgkNFCbSraCrIs8asumBnb9 8kmpGZMs3CMwaND0zdSQiEKOtgZtamBvm+ZzXREkFVZ+024Ia/YyYzpJL/ztMNP1pjbZ uJjbkuBPwk1hTkyh658URSwAn7JfxGU+UU9Zh62eeB/8kvNzPo/BbRU+As2HNdHfyLsC T+bwS5H2RsUwsEPjO3VizpC7MdXCaoeNUXUoa1SSeEugA6e11kTnE7+l9rLY8k9P0ayf ukNQ== X-Forwarded-Encrypted: i=1; AJvYcCWMK7bnISETdPaNTMd72HahL7j79mo4LBikCrnYDvd8+XiTq3gWpIlzGA8IvRYjNK5yYD0cQWtXaHjNYAubpCRhlmB5K3TvDNde0l51 X-Gm-Message-State: AOJu0YzOVrZ3YY49l7PF+Qau4hS66GYRN3TQ7i65+asq09qsUJ0wQXCI Ip7Q0Q6U1r5inO7VgmuTo233c53ykfVsps2xEWWFkmOaCw6lmJ5o08yz1AGtPhBR7pv/55GXGEV QfzGiMDW7Iq0J/sT/hoDMYmjo47rAb5wnJDCxbQ== X-Received: by 2002:a1f:ccc1:0:b0:4cd:b718:4b08 with SMTP id c184-20020a1fccc1000000b004cdb7184b08mr6123482vkg.11.1709039691592; Tue, 27 Feb 2024 05:14:51 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240226134656.608559-1-arturas.moskvinas@gmail.com> <3f629079-6809-4cae-bd4d-8b0ee4860196@gmail.com> In-Reply-To: <3f629079-6809-4cae-bd4d-8b0ee4860196@gmail.com> From: Bartosz Golaszewski Date: Tue, 27 Feb 2024 14:14:40 +0100 Message-ID: Subject: Re: [PATCH] gpio: 74x164: Enable output pins after registers are reset To: Arturas Moskvinas Cc: Andy Shevchenko , linus.walleij@linaro.org, u.kleine-koenig@pengutronix.de, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Feb 27, 2024 at 7:58=E2=80=AFAM Arturas Moskvinas wrote: > > Hello, > > On 2/26/24 16:01, Andy Shevchenko wrote: > > On Mon, Feb 26, 2024 at 03:46:56PM +0200, Arturas Moskvinas wrote: > >> Move output enabling after chip registers are cleared. > > Does this fix anything? If so, maybe elaborate a bit the potential beha= vioural > > changes on the real lines. > > Chip outputs are enabled[1] before actual reset is performed[2] which > might cause pin output value to flip flop if previous pin value was set > to 1 in chip. Change fixes that behavior by making sure chip is fully > reset before all outputs are enabled. > > Flip-flop can be noticed when module is removed and inserted again and > one of the pins was changed to 1 before removal. 100 microsecond > flipping is noticeable on oscilloscope (100khz SPI bus). > > For a properly reset chip - output is enabled around 100 microseconds > (on 100khz SPI bus) later during probing process hence should be > irrelevant behavioral change. > > [1] - > https://elixir.bootlin.com/linux/v6.7.4/source/drivers/gpio/gpio-74x164.c= #L130 > [2] - > https://elixir.bootlin.com/linux/v6.7.4/source/drivers/gpio/gpio-74x164.c= #L150 > > Arturas Moskvinas And this is precisely the kind of information that needs to go into commit messages. I can tell *what* you're doing by looking at the code. What I can't tell is *why*. Bartosz