Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp572861lqt; Fri, 19 Apr 2024 04:40:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWeUChxruFY9IQP2oU9pxo+5RWgH0GWwIj+D6Orawfg2TkQUWQv+vr4iGOKkkUQEJannVbpiuY6xpprYSV4ox2gEhWbMExt8xNElHcVag== X-Google-Smtp-Source: AGHT+IE2xjq2q4AzDF+87cyf7nA6xZtKcbgRahfh4+kQwh/BhFKE6FwdFvkje6NfZOayqGDX18gX X-Received: by 2002:a05:6a21:328f:b0:1aa:6178:345 with SMTP id yt15-20020a056a21328f00b001aa61780345mr2250146pzb.7.1713526845365; Fri, 19 Apr 2024 04:40:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713526845; cv=pass; d=google.com; s=arc-20160816; b=RjuPTfXLBN3BbSAx9rJeFs1ETCOTEpTPcy7nI0iA7cTjO4BYk2usvXsllGpnUjB36i aZJBemzCUDb5dR4MVVjsCdd+C6ivAWHZum02n7uYXNiVKk4ye43fKU0wDIBlprsg3scb rnbkp1QZEaQFArPgII7cBGIdkI7DjMKM7BK24RQhy3FLjADvoKNxPtEqEb7H3FBa9dIl 1JZFz16UClVpk3VKsjqLPhuaoZ21WodXh+WGWqaioMSz6NDaoI3AoQ/eqmkjw2459Bg+ BnCR/2e1lChOwz9WBpFLIvOAc44DOy3rJivFLxeEdgvfHp8UGy7Q6DmeFa8mPcmaWb6E GAmg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=KCpSylsBBU0U0ink6MW+pyy6ZLptHlf0p+v10lZOwHU=; fh=TCw++IcEbRt/LqdH2pgz6c/hePUSkeNwxqC5SCaZybQ=; b=ChhIuA4wxxX+9XHuxTMWxTXjJpoi4ynGC0Rgfl1lCsWWRA6NzAAljD/TQwxfZZXpRi HcObdSqP9WzTsUonuULiYdkUOXbq5Qg7B8DognmFEu2wEy6hd3+OfKabmzxmuHg3KJV1 SuDDNYPXP+lRGsHZgkqogS3wLu4Mw6G+I0KsxduARnjG+VQBK/6RP3s8SuEdTN//4JP6 1fnVoo+f+PxEoXnDuI9fUDo2G7YETEwkGY8LxEJTVS4smYvrpshwVzXckI68kMiTRXy8 dlpSdCDxxFNcjcE0Ib+stIT3SU4/P4HbtF9BuK2ennJ0FtN0a/8EkGh4U4OnSxYdsfar cXBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TxTc2htZ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-151379-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151379-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k9-20020a170902c40900b001e098ad43d7si3185335plk.216.2024.04.19.04.40.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 04:40:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151379-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TxTc2htZ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-151379-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151379-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 0493A282F8D for ; Fri, 19 Apr 2024 11:40:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1560C82D62; Fri, 19 Apr 2024 11:40:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TxTc2htZ" Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 AA0453F8F6; Fri, 19 Apr 2024 11:40:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713526838; cv=none; b=Nx9Yk1CHn1iiOnbbm11vGVmJOk1zcYN6XZIZ16t/8sVwazlj9wx5ZcyjGhmxQunoWktclaMWziJYbOGNHU3CIeWlEFa5zDzpMZ9IrwnbFfI4lRiBCC9RY050Nvr1Dqt3CkAkuhyTZRqcigxD08A/0IyCk8d2GfNT4RBJfsc+vpI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713526838; c=relaxed/simple; bh=67tAD9dPGFnocIYPgAQfazAvvpd43UU0V/pMhoUAdYo=; h=Content-Type:Mime-Version:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=pyQAY9msep0S5MyiCLDFlbrZ+znCl6GXY0w9waEeJ+TDfTuMK3HbGN6xI9KrmtyhfhWuXcseD+QZVzAlnzBCYC1jW3kohw3jaiD4P1ZToanUnZXMiIUEb9JAT48eYz0EcH5eHSggeJTRxSaoApvNMGp+4gMB/zghdKAeHvgQFPg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TxTc2htZ; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-51acb95b892so399542e87.2; Fri, 19 Apr 2024 04:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713526835; x=1714131635; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KCpSylsBBU0U0ink6MW+pyy6ZLptHlf0p+v10lZOwHU=; b=TxTc2htZ7OfSWDf22sQUBYZEtZI0nV4YPpi0dkJe+kSGBUZ7gXGe4vGD/dPY4oouvy 8lQvv38MkQy6mzpN4t12Oi5VlrCJ383icUDgurtcI7SSg3GgPG0xSCDJ1nB8/pRJ78uE 9GPN/c5rYzhCS52t4eJMD9/lV3vIx/XUfMgY5380UVYYiZw+4vf82eexncEK28yU4raZ L8Rx3Y/S5IWbigRuHiIrC046Ox1LLKU+IPvkGzEwaVsO300NttCTJkUzaf+1VHdXs/0S fSYUVD3iPZ/vXNAqHkq3qMY2W3Ynq65VZ4gOBnEYbk/qjlE49xA/g8t3UtnpCkrjK1t9 tL9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713526835; x=1714131635; h=in-reply-to:references:to:from:subject:cc:message-id:date :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KCpSylsBBU0U0ink6MW+pyy6ZLptHlf0p+v10lZOwHU=; b=LBK21c8MEXiM6oB4EFHlGx+bV2MA8Icyqi8JulmY1miU1Dd/ykV2l3uqF0d9BYBdcO //+ue9Y6bV1Tg48b/0PmpBmtNpLHS3Q1MqsH/naJUw3VKl2qztBOOdYwkNqKmAt6/kvt fNvUCPc1E0XlwiHxKJbq9MgZeDK4NDn5xjxzkK3KqpIXCj1b/TfReLe0DsoK69Fc3Z4J qt3VlrfjbqBKveQZ1MLJjQfe8uIR2knU+C+486wVbdxtfqlEj0iATE0GdnqItR8M8mIX EbCjAhTFRqNP0dKRNp9OSbCb2JZoZESnBhzyHNiVckU5pwNRMnuFgSKJ3SyUPl23kPWh 3BZQ== X-Forwarded-Encrypted: i=1; AJvYcCVBLFOKJGPfANrCouQdhWLVoFKI+sLvM5W5mG4MviLCi+/HyFAfC6Jt3jwGqsu+6YFcwPXmk4x2OWvj++DJkB1OV+nr8kfJqR0dIOhA8nKhTA3obNWLXKK2dEsJmknjJwb3Wh2Jv2aiWVZm95fR3MCNyRUUFOBXMeywMrIyPfUneEIXU40T X-Gm-Message-State: AOJu0Yz9keriRx2JVkzGaCu8SoALqQRAdznx3CtdiH/7sACvi6fW0aRI bZrT1O7uP3/6ugms/lajtUgKfzojf6Oezv526DKvKBXCIUSwoQen X-Received: by 2002:ac2:5618:0:b0:51a:ca2d:eeb7 with SMTP id v24-20020ac25618000000b0051aca2deeb7mr738796lfd.14.1713526834339; Fri, 19 Apr 2024 04:40:34 -0700 (PDT) Received: from localhost (p200300e41f162000f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f16:2000:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id v22-20020a1709064e9600b00a55865b2760sm702466eju.30.2024.04.19.04.40.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Apr 2024 04:40:33 -0700 (PDT) Content-Type: multipart/signed; boundary=83f6e9dfc46da42c4afe7fb111a4258e10f079b07429dbcb59380d138491; micalg=pgp-sha256; protocol="application/pgp-signature" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Date: Fri, 19 Apr 2024 13:40:33 +0200 Message-Id: Cc: , , , Subject: Re: [PATCH] gpio: tegra186: Fix tegra186_gpio_is_accessible() check From: "Thierry Reding" To: "Prathamesh Shete" , , , , , , , X-Mailer: aerc 0.16.0-1-0-g560d6168f0ed-dirty References: <20240416123501.12916-1-pshete@nvidia.com> In-Reply-To: <20240416123501.12916-1-pshete@nvidia.com> --83f6e9dfc46da42c4afe7fb111a4258e10f079b07429dbcb59380d138491 Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Tue Apr 16, 2024 at 2:35 PM CEST, Prathamesh Shete wrote: > The controller has several register bits describing access control > information for a given GPIO pin. When SCR_SEC_[R|W]EN is unset, it > means we have full read/write access to all the registers for given GPIO > pin. When SCR_SEC[R|W]EN is set, it means we need to further check the > accompanying SCR_SEC_G1[R|W] bit to determine read/write access to all > the registers for given GPIO pin. > > This check was previously declaring that a GPIO pin was accessible > only if either of the following conditions were met: > > - SCR_SEC_REN + SCR_SEC_WEN both set > > or > > - SCR_SEC_REN + SCR_SEC_WEN both set and > SCR_SEC_G1R + SCR_SEC_G1W both set > > Update the check to properly handle cases where only one of > SCR_SEC_REN or SCR_SEC_WEN is set. > > Fixes: b2b56a163230 ("gpio: tegra186: Check GPIO pin permission before ac= cess.") > Signed-off-by: Prathamesh Shete > --- > drivers/gpio/gpio-tegra186.c | 22 ++++++++++++++-------- > 1 file changed, 14 insertions(+), 8 deletions(-) Acked-by: Thierry Reding --83f6e9dfc46da42c4afe7fb111a4258e10f079b07429dbcb59380d138491 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmYiWDEACgkQ3SOs138+ s6FEphAAmS5L755Tb0YYFIl6RB74eVji3nmDr+ejsQxu0Oaj3NW+Ms1lzxjIuuCy eVTsEAaoaIS6eZA1mX0MMqXJ7cEao3IqG5jGXPer8DxYD8JxW523Pu2N7lG1+FoH Xr+jozaaTqR6pAJu0/E2eYa38xNkUDZmydTPTQJSz35wrBDBP+nGZ9llaCsYIf2B yoF0DAd/ByUig48bnROxBKE6Wqay7oEJmUFY0/Vb/Ef20qqOnTc2TADVcsWkzIsQ 2e6f5hffAxQ+bMYVgfUZ77z8Tv2Ib0SQFIoB97w+IyLR//5o/c00d1Lii1L3lyBf Cu0K0I3tyRa4lh2k7BIXaFyUreJE9Z/KJdRC+OQbeBWWn0B9AXgGAsuyAqMGblsj OVg7K8jsjTW5EYEE/D8QxlU+U9QU7KKH/viXvAN4z8yiXV5Iq/EmygrMyy+xRyrR o4TOpe8mCHaPHb7EJWDxG6+JaAF14MGyNlBkYG4cwolByaTH8neJixlUQqywwWAj eHmymvJa+4r3Brrnnjj9340V+3OnB26GB1HFOohqO4gdUXciYfEhyBeRx9y0Y7pG SSje8X/HymrXzJcOJOr/mfBzsnL7TGYbXH9qsU+pNWm4C03ZGK7o+ITYj0fwJxuZ DlqqXG9jjTaiIdLYwpetbFTH3d5nEnQmCh5MOD/6C/Dchs+vtjw= =XyTt -----END PGP SIGNATURE----- --83f6e9dfc46da42c4afe7fb111a4258e10f079b07429dbcb59380d138491--