Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp197777lqc; Thu, 29 Feb 2024 14:46:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXH2HnB3FclK2pkN/rhNaXr/Hbdx/NHxs7GdGqVcrBWlTmZQAHIsXWLYKrthkRGSJDMaSGHPBhOG98NUoq0MSeuKkwbZjqqpYU6lSScFw== X-Google-Smtp-Source: AGHT+IGYrRZ3r67dRsagyCbfUVIQAXXXg+5cH4uR/jvhoh/q0OZcCTTfwGll/EUENVZiC+331kgp X-Received: by 2002:a17:902:b214:b0:1db:2ad9:9393 with SMTP id t20-20020a170902b21400b001db2ad99393mr3400302plr.48.1709246778804; Thu, 29 Feb 2024 14:46:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709246778; cv=pass; d=google.com; s=arc-20160816; b=dEjkqghnLNVpjRVpZVx5KkOxNDwo4KY88UiC53VycZlpmq3jMAWZugq/hYTxNTrI7D LNQPAp3BaILUiWLiesbef+/qYzZ7VUh89LPrZurahiatphdA+z51cwD9PD30vKE8rI1F EzgvMfT1bGxYKJ8gEKNr0KxInZAQehWSrW4LJXwR7+7gS48jY9pWO0t0ZrNGReIH1mgt fcJZovdLibk1LKd8jVamR8aTTAyw0mhs8T0iiT1Vi6S4qvUQqIBN+L9G3Ey0WlU1Rzhz 0K9h/CTQzpVSN6QQWE6xHjaXiW+XVXsVEnWU6hcGEUSB/XkyMOcPZWItQcGe5hc41I7q 4whg== 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=IAtiPDsmSz7hD3vhPLE/igLGTYY4MMGETCJKNgYaVuM=; fh=G2YmlxtL2/8Hss9gYB6GPxC8fdOANfCW4RjXcdtzvK0=; b=wvTPr8Y2spO/krGAtR51zS+93bYvE34CxkoxQfaU+y3Er56Wj/axympSChntAobjMS qRWydFYkLfIwhSlqNQOKbDvAiEghilfc6ZPuR5CstZXmKEynIo64J/Y141NHgpuw+Q2P OwKClPn1k3VfScmBj9qGOcFoWbNSTrD8Rm+HumMdxJTcp1lqLU7oNu2Knpz7wB/B9SVH gALmnxwD8JUleKP2dNkvWoelMFIoLYtr7JjAawu1XGTt9kMe36u4gSc2BPGkynv5TbB2 d/oX6WY82BU5G0oSVMQ8nTWfGFxxXZNsgvWJAqsvVbN/0DY1eYytS1h/PmzJvOtbnyRi /Uug==; 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=Yr8AIOHA; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-87191-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87191-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m14-20020a170902db0e00b001dc1df6489dsi77031plx.26.2024.02.29.14.46.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 14:46:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87191-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=Yr8AIOHA; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-87191-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87191-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 692BC28951D for ; Thu, 29 Feb 2024 17:39:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D78DC70AE6; Thu, 29 Feb 2024 17:39:37 +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="Yr8AIOHA" Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.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 91C2116062E for ; Thu, 29 Feb 2024 17:39:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709228377; cv=none; b=Vpkm7+MaD+ynYOEm/RtTzo659nRJvnRJsbeMiWswRrJEQsK+IK2PBl4A+AG3YKSR7Hxt8kNDZT9YwjPyyK00LqDGwHJpa/IRzcZ59jUv3FsM4WTGBYlAZfnAmaEkrjTxIZZ2BAqyizO/3AigHiZd8yJ6fddUjk7XSv8zM64Q4nk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709228377; c=relaxed/simple; bh=IAtiPDsmSz7hD3vhPLE/igLGTYY4MMGETCJKNgYaVuM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ENwwTubxbXNgY794kWLKBiW9tusd8v+GCjcD7hlujAJxDVMvGROC0ZsWgxj6idpkMSdvOIJm0G5Qrzngr98uvs8xxw5dsqa6KEzIbbh4YRlbWwYNXGaBLrkuJsFi78f3SZlUJKpFdZK2c0oVC9avWSnxQHYDUJFX1WphVyhlv0c= 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=Yr8AIOHA; arc=none smtp.client-ip=209.85.217.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-vs1-f45.google.com with SMTP id ada2fe7eead31-4727ca88800so355977137.1 for ; Thu, 29 Feb 2024 09:39:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1709228374; x=1709833174; 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=IAtiPDsmSz7hD3vhPLE/igLGTYY4MMGETCJKNgYaVuM=; b=Yr8AIOHAyBNbzGWguva4lWdNncaEt96R8bL60P8X3DnCtuE5054AIquijNVFUR748m k/CJw+UVgl9dxnmsKXx+gbn2eeLI1NZYG438eQFFjvOtZFAV5UEuXFYEIznMm58DlXC/ OlN5ePW/DltNEFyGphlyjQFyApnVnYKD5QBr945kB8NkTwRiAxY5ULGzn8tMl1bomSIz 6YUo4dZNr1CYIsYwBC6ATdjZY8e9QpMt42re6D1B5ToUwjrH+F5eJFulyWUNlsG43Dfq 4sdYlxNzRuxoBoo4FE6WA2IUeBW4J5MDsf2ZnYC4E9oCWVeRn8aoSQCYhCVHJ5Nzq87a ep8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709228374; x=1709833174; 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=IAtiPDsmSz7hD3vhPLE/igLGTYY4MMGETCJKNgYaVuM=; b=g2cRhjMB0yrvX3wyj39sQq39EeadbxSB+pFsW07oK5iudHvcD9b/PXR1bjrSoesO4Y zMOvjb1z7IQokN/nQdEcYbVDjLBH045uWLdQYvBpYS/K4wwNo3+IWX3O3raGY6gV2Bt8 dbItYXhQVFnfbEWxR5T2qyrOj5+TnPnzaTt1MpwzVZVmfuyV0s2a75U7PrKxxFUWCrVj eu0gnbzOQsU6YJ7/qDm2v9CbnFXzXbutDOMM8nZrFoj43L5NzVdd01/nga/jEC0yOwp/ Vhemtc0+99Vzmn1iw0UCd4aQbxbHRHbRjoDz9R4KDafuMzsIQFSjwmk9MJA9R6zU0dih pEmw== X-Forwarded-Encrypted: i=1; AJvYcCXzKWY+JNAww6TObNaKzlTh/W1CkX5MImmrJwEJz0b2+SlovaHURQFG5Fpp0/7NLBnbGVPURfLnMZrG5lBW5mSoKJQDKTHXNmt+Ru8Y X-Gm-Message-State: AOJu0YyUgTflje0m1F7PUgWo9NbDoqVhGWHgnGCBYYLebaYcRbdGSO5f qIweQbpZvOONwu+P21VefP2YDE8CSvLkATf0YF5QMkulHZf2awr8KnxGYtVhbsaH/iSZWxGyzyE lEWzYR+58InWiNo/Bt0jwpHcFZhIceJIjy6YGZtrWd0TFnFSeE3E= X-Received: by 2002:a1f:e642:0:b0:4d3:3974:657e with SMTP id d63-20020a1fe642000000b004d33974657emr2462155vkh.4.1709228374399; Thu, 29 Feb 2024 09:39:34 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240229084555.43701-2-arturas.moskvinas@gmail.com> <15e6e45f-7398-4703-8154-35e769bac94a@gmail.com> In-Reply-To: From: Bartosz Golaszewski Date: Thu, 29 Feb 2024 18:39:23 +0100 Message-ID: Subject: Re: [PATCH v2] gpio: 74x164: Enable output pins after registers are reset To: Arturas Moskvinas Cc: andriy.shevchenko@linux.intel.com, 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 Thu, Feb 29, 2024 at 6:24=E2=80=AFPM Arturas Moskvinas wrote: > > > > On 2/29/24 15:25, Bartosz Golaszewski wrote: > > On Thu, Feb 29, 2024 at 1:23=E2=80=AFPM Arturas Moskvinas > wrote: > > Chip outputs are enabled[1] before actual reset is performed[2] which mig= ht > cause pin output value to flip flop if previous pin value was set to 1 > in chip. > Fix that behavior by making sure chip is fully reset before all outputs a= re > enabled. > > Bartosz, does this look better? > > ... if previous pin value was set to 1 period > > Andriy, Bartosz, is commit message ok? > =3D=3D=3D > gpio: 74x164: Enable output pins after registers are reset > > Chip outputs are enabled[1] before actual reset is performed[2] which mig= ht > cause pin output value to flip flop if previous pin value was set to 1. > Fix that behavior by making sure chip is fully reset before all outputs a= re > enabled. > > Flip-flop can be noticed when module is removed and inserted again and on= e 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 behavior= al > change. > > Fixes: 7ebc194d0fd4 (gpio: 74x164: Introduce 'enable-gpios' property) > Link: https://elixir.bootlin.com/linux/v6.7.4/source/drivers/gpio/gpio-74= x164.c#L130 [1] > Link: https://elixir.bootlin.com/linux/v6.7.4/source/drivers/gpio/gpio-74= x164.c#L150 [2] > Signed-off-by: Arturas Moskvinas > =3D=3D=3D > > Arturas Moskvinas Looks good to me. Bart