Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp8062525rwn; Wed, 14 Sep 2022 08:24:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4qUyZU8PosP9Sh0UCqOojRkEoqrsmLj8ULie5Z77CDgc8lnxoOkCDRSbPvthbLA64oZZoK X-Received: by 2002:a17:90b:4a50:b0:203:1204:5bc4 with SMTP id lb16-20020a17090b4a5000b0020312045bc4mr5202183pjb.79.1663169071405; Wed, 14 Sep 2022 08:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663169071; cv=none; d=google.com; s=arc-20160816; b=eqBW2gWoP9dDjalDEZ9kxomWCXvmCLiBzCb792/tK6+uSL9LR4yU/wvn3s08n0ZyQl f94NZ9l/yVH9DnPJmIAPf7WJUaMU63qCPF6CTKsGlbYCisQkCwOvdxwtvJv0lTLbpgLp WJcGvQ43EeTMDcq57FU7bnhMySYNciShbrSLzzmWL67nd86wzv7gu3g1UxJhOJOTNtfh 9ygBBaGaI36haFxJWn64Vl5PEBo+D3kL1noS5782xnjj76tnPEjocYjWktUPD4aNHAH3 JFMHGgANCsiec0q2YPWiAU2tNF6bOeh8TvEWZdeRu/JDicT9oEjr5OOnQkdUV+oztJa7 Tbaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FDqshHngJe4QAJMkSfGxP7nqWYe+6Ouvyb1oeASj3+A=; b=mwI4OObF8UrVPnQ8xUaZOCKcNRwY72oiO6GC4/IzaADCJKEyrQ6Gzug3EJ76ztEDLP rsI8QZVnIhJkEHcqp1g9/F8rAajmIt2YVDIjhp+muuxeNWXc35VrBto4LGY1NgWHU0Aj ZXcXejhUSlLO4tYHe+6GcinfUwWH7Flp1xQFCfigbqU5waHwfZ19hmJGGHTRfth/wgca 0p08+EA9V0kN0xmkzRn35aeK7tE4rwUToSK9/Wa27wAh1Utq1bGkJElZg5b1Vyrfkczn cSKQ2NWjh8yJiDNRc5DegOT8eEfWlnqrvFKSwHjFgz/2uiSof6soDUJI5NVDjU90vAUB Yprw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=QkFnBx+i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m124-20020a625882000000b005381feef4e7si14230310pfb.320.2022.09.14.08.24.18; Wed, 14 Sep 2022 08:24:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=QkFnBx+i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbiINPMQ (ORCPT + 99 others); Wed, 14 Sep 2022 11:12:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbiINPMF (ORCPT ); Wed, 14 Sep 2022 11:12:05 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CEFC79EE6 for ; Wed, 14 Sep 2022 08:11:53 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id v185-20020a1cacc2000000b003b42e4f278cso12692338wme.5 for ; Wed, 14 Sep 2022 08:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=FDqshHngJe4QAJMkSfGxP7nqWYe+6Ouvyb1oeASj3+A=; b=QkFnBx+i96ZfmpkSO/5wXZ8RQ0Ypwl33j1ceEc+0l8HBCXloWYm3nH/wCya6WJ+dZe WNep9Abuk+TjW5Fz5L59l/Wtelshxxs2hbCuzzjWfx+zNGl42xIlOEnzb9ZW6lbX/HHK tZSV9/M6vGIE6h7fdQYjzgYttkqPOX6pUqHDVR5V9OpfCOGkbf8GVi8jWM49m3okPTwL dCTB/0COTN8P9rejIB9IcFyEduC6yeep33ENYBSfFYh5oWpJptyGZT9iNC1WvMuSfP06 xx5HHdquc9q78oxzMKvgDVTny3jWe488IPZnokjRc6tEGNI7Xl0OP9tdNO+C/mMzx6/5 +dgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=FDqshHngJe4QAJMkSfGxP7nqWYe+6Ouvyb1oeASj3+A=; b=GZfn6WOm0cbF+g0QOsgXZ2BYVr/2X/0X89fuSaUZuudNfgbXosir0QMPTh2043KK+Y z/UCWm3Lpus+0mcGmjkNAQjg1yoXTfuZMzzOxnX5xnL/AsVdwqrcYTW+R8VQICTdkOca 1lWf3xJSsJbiAyte3OCHtFGrTV43R4QU6FMsSVVnLjxdYMu7ciSiN3Z2dacaPm9bPFoJ J/RxE4WxIA3jbKuOVvt4gjdu9lQhpZfgntSlyBerisI8gvcdojsxg1BUPAeXicYiygrx Mf5qPxBK0/Jkq87cPvxIds/1Oh7L7DwcNK/gD2mjVDEthBiuSqkt2shNvsuYZDoIlg5E ADUQ== X-Gm-Message-State: ACgBeo3bWrB0ag9o0GCd33MdZfg4O4MJDeTJAssWR2iiMiE3BmOewYmR JrYaTRVEWgYP2d69JVTNXFMVzA== X-Received: by 2002:a7b:cc85:0:b0:3b4:9fc7:cd4d with SMTP id p5-20020a7bcc85000000b003b49fc7cd4dmr2759413wma.68.1663168311739; Wed, 14 Sep 2022 08:11:51 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:e580:6bb0:74a0:252b]) by smtp.gmail.com with ESMTPSA id b11-20020a05600c4e0b00b003b492753826sm8818481wmq.43.2022.09.14.08.11.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Sep 2022 08:11:51 -0700 (PDT) From: Bartosz Golaszewski To: Kent Gibson , Linus Walleij , Andy Shevchenko , Drew Fustini , Marek Vasut , Geert Uytterhoeven Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] gpiolib: TODO: add an item about GPIO safe-state Date: Wed, 14 Sep 2022 17:11:45 +0200 Message-Id: <20220914151145.73253-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds a new TODO item for gpiolib and can also be used to start a discussion about the need for it and implementation details. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/TODO | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO index f87ff3fa8a53..6ab39c5cec9d 100644 --- a/drivers/gpio/TODO +++ b/drivers/gpio/TODO @@ -197,3 +197,25 @@ A small number of drivers have been converted (pl061, tegra186, msm, amd, apple), and can be used as examples of how to proceed with this conversion. Note that drivers using the generic irqchip framework cannot be converted yet, but watch this space! + +Safe-state of GPIOs + +During 2022 Linux Plumbers Conference's GPIO & pinctrl BOF it's been discussed +that we don't have any middle ground between hogging GPIO lines and letting the +user (either in-kernel or user-space) control them. Either the lines are forever +reserved as hogs or their state is undefined unless requested. + +Currently the behavior of GPIOs that were not requested or were released is +largely driver dependent (the provider driver decides whether the line's state +is reverted to some predefined value or left as-is). This can be problematic +as the output state of a line can damage physical hardware. + +This item is about proposing a solution, most likely in the form of a new device +property called "safe-state" that would define the safe states of specific lines +(e.g. output-high) but not block the line from being requested by users who +could then modify that default state. Once released the GPIO core would then +put the line back into the "safe-state". + +While this could potentially be seen as defining policy in the device-tree, it's +not anymore a policy than properties such as "regulator-always-on" or gpio-hogs +themselves are. -- 2.34.1