From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from s1.sapience.com (s1.sapience.com [72.84.236.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4383139B; Sun, 16 Mar 2025 12:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=72.84.236.66 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742129343; cv=fail; b=eQceoa+SsM46QYoaW5b2j27J+pRCruqTMfXelwGhihOIfgBnqfJfjkfnmzAPfTd+eDxJBu/bs14yV8Ylyr1aZgeUHPJGUuMA+7/tVHGVpQb3uakXY7mGWk3qUkOJKIMCUafMw0ADeKn0+vpmeNWG1HVpMgsVWTahdh5vXwU1W9M= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742129343; c=relaxed/simple; bh=vi91Pt6QOlfTXCKzKhBDCHcsLTlHmjFi2TZT8TbnHl0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=HFMksBzy5I15fORP3H10mFHLlAKXXhQtsJFVyUcOTwb2wrcwF0K4oYUppzboU/fC69XBTP3fvQ5HqCr2Sq2z0gqw70GAo29yeIrKeWvheFEvJLMzDcdnxPWj3EddmpZzzmvDasm9fG077r87p0C2ZJ8P0Ig2fh7rAXmJx7hdEps= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sapience.com; spf=pass smtp.mailfrom=sapience.com; dkim=permerror (0-bit key) header.d=sapience.com header.i=@sapience.com header.b=73JS9hj4; dkim=pass (2048-bit key) header.d=sapience.com header.i=@sapience.com header.b=IBtYtlkx; arc=fail smtp.client-ip=72.84.236.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sapience.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sapience.com Authentication-Results: smtp.subspace.kernel.org; dkim=permerror (0-bit key) header.d=sapience.com header.i=@sapience.com header.b="73JS9hj4"; dkim=pass (2048-bit key) header.d=sapience.com header.i=@sapience.com header.b="IBtYtlkx" Authentication-Results: dkim-srvy7; dkim=pass (Good ed25519-sha256 signature) header.d=sapience.com header.i=@sapience.com header.a=ed25519-sha256; dkim=pass (Good 2048 bit rsa-sha256 signature) header.d=sapience.com header.i=@sapience.com header.a=rsa-sha256 Received: from srv8.sapience.com (srv8.sapience.com [x.x.x.x]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by s1.sapience.com (Postfix) with ESMTPS id 3AE25480AAB; Sun, 16 Mar 2025 08:48:55 -0400 (EDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=sapience.com; i=@sapience.com; q=dns/txt; s=dk-ed25519-220413; t=1742129335; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : from; bh=6JIvjo9kK9/oJ+fTBwgiA9gSpZyKTHfI7J4Jg/hitwE=; b=73JS9hj4mXsProHbP9DbtOORksf1Im1JzcmXMy8RVNgq1ON+W4gROeYXokqyGgCtKzqfx dd60Zk3lPvz/6SzBw== ARC-Seal: i=1; a=rsa-sha256; d=sapience.com; s=arc6-rsa-220412; t=1742129335; cv=none; b=b4F5mEWMqVXoDMfUa71c9qs8BHFFmVVeiHpj5s1eRsb78aFHQWrwucoB4iTKsNsdmsW7sfzImWmklQ3QAKCS1keKxqFm+L5wyW+q3ezYd3foa50u01VU8Z3RJ2gD8P63ZsAnkLqjzXdJWdYYDC30abFUDSw/87lk916I1RiYQHC8OV+hRvL6azLUhprUSJlYU5BrxZpBh6O/NOqz/D4D11BrGBm4Fo03THeZY75RkQYDPl+kqE6E4TSxa3/cO6+732rDm0OcSaotbsrmvx0WSALQru1ybaSgaWgDOcNCfe2wJXgrEqIDXBH522CJCiAc5XcvKTRio1W0z/owLK8WuQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=sapience.com; s=arc6-rsa-220412; t=1742129335; c=relaxed/simple; bh=vi91Pt6QOlfTXCKzKhBDCHcsLTlHmjFi2TZT8TbnHl0=; h=DKIM-Signature:DKIM-Signature:Message-ID:Subject:From:To:Cc:Date: In-Reply-To:References:Autocrypt:Content-Type:User-Agent: MIME-Version; b=OQeEYNrocHh0UGzhClux2+PZwjtLTGJiDwQF1AP6XfeSkav95y2RsPpSZUY603PSD2Qp2V5MNE3/RSY403TBvz5A8kfcd2wfEyymfeLWtXER5qXzSGHribk5gKjFejvPbz8mDIXkj9zKn48VZr4Y183BbL8SLoLRpuNkUDKfENZ+f5Pwe/R9U3Sx74l/GTF/Nb4C7BphC79Swe3dakH4CgPKOYLxwkhA2DQzuNelGoaDko1qo2C4KQLHBSnFeYOr4RjXdeI6f3y24kkl1dcoTb/MXvywgEmdZyIryUHQg9XgfhA9C+JGN82msKcgGft40Zp7AEtiZzpSDxyArjKudw== ARC-Authentication-Results: i=1; arc-srv8.sapience.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sapience.com; i=@sapience.com; q=dns/txt; s=dk-rsa-220413; t=1742129335; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : from; bh=6JIvjo9kK9/oJ+fTBwgiA9gSpZyKTHfI7J4Jg/hitwE=; b=IBtYtlkxXiTGa30nX7uqsrgKJZAJY3PQPwV3CRAyVBfUAShOjOpffKYu+0CSRTnW6l45+ sSmdb8J5is27Kv0y4uVxufCOi9SvTKRZtWp2oox2BY09hSme4Po5cj0O4nS0jtiY+VCbSI+ KBSwDa2udM6vFAozwa3oCCYIJNlM08eSfT2FPwQZyojfnkF9SKZygQy+WHLsd9/lZOLjnde mWx97icbCzil+hMcPNig38cQB+gONmG/BRTGnfafwhmwPirod9svB+JKdFHnxg9PgOzBaNA H8k2nmEp4JVTSgRxUB9GCAOAmsxKiPgaEKrhK6F7C3Q/ziZifV5OvxsCUjwg== Received: by srv8.prv.sapience.com (Postfix) id 082E428001B; Sun, 16 Mar 2025 08:48:55 -0400 (EDT) Message-ID: <76e77de144a51d345c3542dd77dd0bdd86e4d5e5.camel@sapience.com> Subject: Re: rc4 and later log message: gpiochip_add_data_with_key: get_direction failed From: Genes Lists To: Bartosz Golaszewski Cc: Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 16 Mar 2025 08:48:47 -0400 In-Reply-To: References: <579283e5c832d77aeed531e8680961c815557613.camel@sapience.com> <1d8bf01be50646bb7b36abfc1ecb25eb997598dd.camel@sapience.com> Autocrypt: addr=lists@sapience.com; prefer-encrypt=mutual; keydata=mDMEXSY9GRYJKwYBBAHaRw8BAQdAwzFfmp+m0ldl2vgmbtPC/XN7/k5vscpADq3BmRy5R 7y0LU1haWwgTGlzdHMgKEwwIDIwMTkwNzEwKSA8bGlzdHNAc2FwaWVuY2UuY29tPoiWBBMWCAA+Ah sBBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEE5YMoUxcbEgQOvOMKc+dlCv6PxQAFAmPJfooFCRl vRHEACgkQc+dlCv6PxQAc/wEA/Dbmg91DOGXll0OW1GKaZQGQDl7fHibMOKRGC6X/emoA+wQR5FIz BnV/PrXbao8LS/h0tSkeXgPsYxrzvfZInIAC Content-Type: multipart/signed; micalg="pgp-sha384"; protocol="application/pgp-signature"; boundary="=-qGmPose2pqDUpsQBP6jG" User-Agent: Evolution 3.54.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --=-qGmPose2pqDUpsQBP6jG Content-Type: multipart/alternative; boundary="=-CDzcXSjZE21TrESpJjPk" --=-CDzcXSjZE21TrESpJjPk Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2025-03-11 at 10:40 -0700, Bartosz Golaszewski wrote: > On Tue, 11 Mar 2025 15:03:59 +0100, Genes Lists > said: > > On Sat, 2025-03-08 at 15:45 -0500, Genes Lists wrote: > > > ...... > >=20 >=20 > There are two problems here. The issue you're seeing is fixed in next > but > not in mainline due to my omission. I will send a patch for that. >=20 > On the other hand, the pinctrl driver in question should be fixed > too. > Can you try the following change: >=20 > diff --git a/drivers/pinctrl/intel/pinctrl-intel.c > b/drivers/pinctrl/intel/pinctrl-intel.c > index d889c7c878e2..0c6925b53d9f 100644 > --- a/drivers/pinctrl/intel/pinctrl-intel.c > +++ b/drivers/pinctrl/intel/pinctrl-intel.c > @@ -1068,7 +1068,11 @@ static int intel_gpio_get_direction(struct > gpio_chip *chip, unsigned int offset) >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pin =3D intel_gpio_to_pin(pctr= l, offset, NULL, NULL); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (pin < 0) > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 return -EINVAL; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 /* > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 * For pins configured to functions other than GPIO, > default > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 * to the safe INPUT value. > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 */ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 return GPIO_LINE_DIRECTION_IN; >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reg =3D intel_get_padcfg(pctrl= , pin, PADCFG0); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (!reg) >=20 > ? >=20 > FYI: This was uncovered by commit 9d846b1aebbe ("gpiolib: check the > return value of gpio_chip::get_direction()"). >=20 > Bart Hi Bart - I don't see this pincntrl patch in mainline yet - =C2=A0what's your thinking on this? thanks! --=20 Gene --=-CDzcXSjZE21TrESpJjPk Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
On Tue, 2025-03-11 at 10:40 -0700, Bartosz Golasz= ewski wrote:
On Tue, 11 Mar 2025 15:03= :59 +0100, Genes Lists <lists@sapi= ence.com> said:
On Sat, 202= 5-03-08 at 15:45 -0500, Genes Lists wrote:
......


There are two prob= lems here. The issue you're seeing is fixed in next but
not i= n mainline due to my omission. I will send a patch for that.
=
On the other hand, the pinctrl driver in question should be = fixed too.
Can you try the following change:
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c
b/drivers/pinctrl/intel/pinctrl-intel.c
index d889c7c878e2= ..0c6925b53d9f 100644
--- a/drivers/pinctrl/intel/pinctrl-int= el.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -1068,7 +1068,11 @@ static int intel_gpio_get_direction(struct
gpio_chip *chip, unsigned int offset)

&= nbsp;       pin =3D intel_gpio_to_pin(pctrl, = offset, NULL, NULL);
      &nbs= p; if (pin < 0)
-       = ;        return -EINVAL;
+=             &nb= sp;  /*
+        = ;        * For pins configured to functi= ons other than GPIO, default
+     &= nbsp;          * to the safe I= NPUT value.
+        =         */
+  &n= bsp;            retu= rn GPIO_LINE_DIRECTION_IN;

   &= nbsp;    reg =3D intel_get_padcfg(pctrl, pin, PADCFG0);
<= /div>
        if (!reg)

?

FYI: This was uncovered by = commit 9d846b1aebbe ("gpiolib: check the
return value of gpio= _chip::get_direction()").

Bart

Hi Bart - I don't see this pincntrl patch in mainlin= e yet -  what's your thinking on this?

thanks= !


-- 
Gene

--=-CDzcXSjZE21TrESpJjPk-- --=-qGmPose2pqDUpsQBP6jG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iHUEABYJAB0WIQRByXNdQO2KDRJ2iXo5BdB0L6Ze2wUCZ9bIrwAKCRA5BdB0L6Ze 21NwAQCarHY4VslF4jX67Wf+kfjL45aw+eXxg6zNdxv1KToe5QEAtcwhE9IEPalm t7K+9zTEffx5ap73NWj19IqYOZd9xwk= =9Ya9 -----END PGP SIGNATURE----- --=-qGmPose2pqDUpsQBP6jG--