From patchwork Tue Apr 1 12:46:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 877823 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 87AB91E47A9 for ; Tue, 1 Apr 2025 12:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743511620; cv=none; b=PkQ8Ye+vE6YUKX8WXQpuLOf8O+s90jm09QH340pdVfCVNqk1hlH2QwEh93Z8D37Ivo0jIqvIjiui59kwVhtMxA2vkrVH8H6fA43KlNa4TWsmLtGjotL2qBL7R13qDJEDgEQK+/v7KsFqLXucVW+RK5BeaONhjEHV+Gy00fLF1OA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743511620; c=relaxed/simple; bh=temwGwuAaoC5zTFBClo/qvp6AjaDT4RZkI46P4DarK8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CnQ0173a1bF/9MFUJvKNJp7RSCJJaU+I1Y/5wUIzGz8LF3vW0Z6W9iJd8iOdIJgcUsi9iYSbCjTTYzKN1yoftRn4ufnP0fRyW+R1eYGs24hfvvram5BO2vBORS25H8rjzbPr9OO0UOH57Z9K1EYsL0RBkpRUoST9Lcfmf+97q/A= 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=eqAcMubW; arc=none smtp.client-ip=209.85.128.53 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 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="eqAcMubW" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43cfa7e7f54so33684895e9.1 for ; Tue, 01 Apr 2025 05:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1743511617; x=1744116417; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xe7kdEUowiq8TBvJ84z72BfPVI79Uk7veEXXBETFIOc=; b=eqAcMubWKJ4gAC3rO+37fSR7TlLQ7k/fWNGqDef4ArA05UeyAczxmOQcyZ18aFt0wf 5qLyY/WGRvCEHAogvEVMGTI8GizsByFt4N6RN/VFGCxvc6haqqNYt6PZ5U3vvEvlN2Gy vmVRMKj4RpvdZf9GYPMUzGpMWUWwpUmWcb6Pu5L3gDAGrUopJxbga90w69ywmpTXlWA7 ALwOFCbJTmtzwUrq1h4qS4sCiSUwCjIpSrpvmQI16ye0U1YsNLp7Z38xSxa60KShB/ef ObhpWN2A9DATZ3lhIGa8xNdt+d2S70eUxJ0eMKVkNp8fKB5wJmog0TV/O6eGhuVnQ14Q h/oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743511617; x=1744116417; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xe7kdEUowiq8TBvJ84z72BfPVI79Uk7veEXXBETFIOc=; b=F3IOOPAyc+2OgbqISPqr2wEUY1W5LKagRHQ8tAij37TS/hsMinQa2O8BoWqfsMqWkg KH9xBuhI9qUVw4Kehc5pz+S9zNndEyo3OP1jS5RsHZIP/3oRjMUf9naELr/o843pLe41 R2RngfmrJ+m+rLZWBSAdSZ31pzNdRQD57gaK8vjCEph3P9SZ2lOW4L3seajOPICKFxcK vfxejsOfAgHJ0QvZk/oi8st1IwCXJINcYzN2fpF0/X/uyQ3BgztQyigXVPt5bRY5OLRE Z+Zm1WnekdCk9szDKDOIi9uH7yA01cIAGjVu4cYR3nuiRnnkmkEtgwFONzINUzVptJeu Tcaw== X-Gm-Message-State: AOJu0YzmfDTKmUpGM883R0/rx1kz4mmOm/VUtiELAqc1vFBJ5BdU7SMm er68YfvfNzMKFP1WWTISs2jBlgNW5fCviogo96uAwnB2zQeUlV7VzR0nqih+AzsVoxvnYXYHi3W a X-Gm-Gg: ASbGncsaBJeEmCc0tLkUvNEmeej28ezf93X7z7eJq8Ak5zZhUI99e9TF4J/cxZcoB6u +0OyLDsA/Yza1EhdtvUdetQH5F+pbYFW8xY8c/fT3j6NqzpZRFONX5k+OWPZUiOGWqrKi+eecCb 689XDiWBvLcpsMxVPTGqGy7HOKjuW/mLHwRuGir4Q9USB5kZQ4SCACuQIRrQGelBhrAuoM+A+LD wju9DxPvI8KgVIM41VVsMX2o4SnggDCl/qiowxeHiPzDn8BjKC82oWAPjioFSxWnzG0mhWA0fKb +J0RwgHS1BZAPqP0m7dybrbQtXqwwNQMZaF7 X-Google-Smtp-Source: AGHT+IGf0u46IWU3CO/BVxxVBOy8SucBu63MYXRuUp8B+WfcdRIPeQ6B7KQe1s4LIVosuvQteU9tqg== X-Received: by 2002:a05:600c:6b6a:b0:43c:ec72:3daf with SMTP id 5b1f17b1804b1-43d9118f70cmr145110815e9.14.1743511616731; Tue, 01 Apr 2025 05:46:56 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a1d1:bbb:e2a6:2a9c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d8fbc1889sm154711095e9.16.2025.04.01.05.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Apr 2025 05:46:56 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 01 Apr 2025 14:46:42 +0200 Subject: [PATCH v2 1/4] gpio: deprecate the GPIOD_FLAGS_BIT_NONEXCLUSIVE flag Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250401-gpio-todo-remove-nonexclusive-v2-1-7c1380797b0d@linaro.org> References: <20250401-gpio-todo-remove-nonexclusive-v2-0-7c1380797b0d@linaro.org> In-Reply-To: <20250401-gpio-todo-remove-nonexclusive-v2-0-7c1380797b0d@linaro.org> To: Linus Walleij , Bartosz Golaszewski , Mark Brown Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=923; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=Q2fStXzgr+tzcMl62MNu7piyURnbnFyqKrL7W40dDzY=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBn6+A+b3G/t7nNpboJqZXMuCSfP94fJXXp8nKTZ eJ1E6+JUW+JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZ+vgPgAKCRARpy6gFHHX cixzD/9nSVZXqJagl5jSQHjbsNryvTmOQsXiTQ0JT42XW8WAgd+yJi+SbFEv+z8viaawLoo6mTf Rf7qLG6rhFTV2idbRaXe3/YepxKRfP85PXbPqq8eoKHaruClgNG3x3heEDt1dFqRfuaEbvnovDE 3awvA2RHnuSWRsiohCpVToG34tUmQhgMRYkqC/fKuHIa5Ie3CDPpygXwDRn0Xbjmahvtt+5HNpT HOi8knpnYwRiC3mv29XzJ+YpGPAXuwiRo+HwHBE+9AJ6Yz0L9Fk03Wq7zaOlugwFAZSohhAqRP9 +EPTRivj40N9t/T4QkBkv3CC7ebd/BkeMowK/2Z8PeuKwWYdxxVdFOMWofyevKYoNmGu1Qzpjrd lhiAok2kdsFv0OcqRz16dU/QkcCoi/cpqCuV9umKdXNW4kDld3BmTLw5J5DBEV7mgh2oIYEU/Se mDOLE28+QBdylpgcr4F2ZDQtatXvCikmZLpHGe0ChLDDCZxC7oVkf5u2NfymRMO3ZwyV37N62B6 Reenbux3KkyuLLIpWleo6YLn5fTqENagSjVR6DrACPaSqrKIUjFlQISPn0rIgghzkL+RZVEJjc9 DDLofhQ8DQ0y0N29vsmymNWW0hzIbHInAfXsVlv4UosMFf0OBx7PG3qsFP8O3Hd1Mfac9k+Zb1m iSgISzMBWwYQhvQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski The non-exclusive GPIO request flag looks like a functional feature but is in fact a workaround for a corner-case that got out of hand. It should be removed so deprecate it officially so that nobody uses it anymore. Acked-by: Linus Walleij Signed-off-by: Bartosz Golaszewski --- include/linux/gpio/consumer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 45b651c05b9c..8adc8e9cb4a7 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -31,6 +31,7 @@ struct gpio_descs { #define GPIOD_FLAGS_BIT_DIR_OUT BIT(1) #define GPIOD_FLAGS_BIT_DIR_VAL BIT(2) #define GPIOD_FLAGS_BIT_OPEN_DRAIN BIT(3) +/* GPIOD_FLAGS_BIT_NONEXCLUSIVE is DEPRECATED, don't use in new code. */ #define GPIOD_FLAGS_BIT_NONEXCLUSIVE BIT(4) /** From patchwork Tue Apr 1 12:46:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 877822 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 08E881F2388 for ; Tue, 1 Apr 2025 12:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743511621; cv=none; b=J9Ux8fSAKDM58Gooh4lkTvbJ0LnXRqrRciswkpr5Qiilk0INAQj3UnY8/NZLOsY6rk0jJ54kGw3VWWLm4cHWx1HInC1UTqAhLmjvpv/zdUMiCLcMAxeIrichxyocGMqCVwn9XJyhZTyIK1TdMV/s5lISuJRLLabHAuAo/DdiIFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743511621; c=relaxed/simple; bh=AbV7U5pUCyJPC11rcx6UA9F6fd4wqEjqeKr5InyqrcA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l7ItQFDxzu/sSg21tTA6CFXt3wbnhwW91Tg9wgtGNV3MjE43kg4B76e2LNMTWxhxKOzUiIIPCAlkCNZCm0cM8ebSNWU815E88papJL76tNX61GK8yZe8KlR2jDh5kXa/JFT1vY9qeiuUhukvKCASR6py1aoCdmrhdnnVDYqmU80= 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=TJGzMwTe; arc=none smtp.client-ip=209.85.128.51 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 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="TJGzMwTe" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43cec5cd73bso35968885e9.3 for ; Tue, 01 Apr 2025 05:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1743511617; x=1744116417; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NXRKyXT3LiGw8+HSSKP+LYizolwv9vZJ9qmmSzI6jpU=; b=TJGzMwTe2ydsFJjMkm9jMevoDJ2PHOex7KkURzYbG9wU2pN6cK+xDnSWdUb/nJIbsV 5jYiYuNvAEhsz+ttfWOzG8rrFSsnkxsgVZPXh3vyOYFTR8854DXsvY8g/KN7VlAlwrRT RKW9fcQ5wJHOI959ba0921LvBooTdCrV5aCWqpXt22OqcJU0Jv4bxd+m86QTOlk/oUnA YAEqW3jlZD6LJ0HjNwS1R1xgnuuZuEBQI4WeGlhEN9MXk2zIo4m1vxcCXFo0y1IHhKse 3HS87PqEoSofTXWVi0jfMxbp+TFeHRQCOV7tOYKX1CzPs5LNtw7iZy8uCgxP4MZ5xz64 Ct3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743511617; x=1744116417; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NXRKyXT3LiGw8+HSSKP+LYizolwv9vZJ9qmmSzI6jpU=; b=iP0MDGkZwZAB1ec33saOTcz4BAyrpUHfAIGUrg2IcqgnzFSHMCYY0qSO7WR4PNBhCE nv5yLpWM9Sects3g7Ty2LpWnWQ87MOqN/eSfnKeRqO19nJIzVSE25XRfSgCrVyMg0CUO 9FvxSODDNDADMD3PxFlOdfFpfyz/l/ZfwRG8VS0DmxlWkuegEjsUlvhBaLvRqM9qV+wK WPhjw9PcPjjMHttOvhJuZYNYNkBRltF+5o+cH1rvT52lq2+4od9SodTgc2UZeHR0uqBL uzg+lLiZHraO5BIfgP40p411uq2qgzAP3klUhv93VoaMVq4JAc9bDYmcmhfQ+lSHP6YU AF9w== X-Gm-Message-State: AOJu0YzXOwP97OAQeO94tShhWBtdHe0N8g5BL3yi1PbFP1UqwuYCknqX c4XoZ2T2rg0O5YWWDYePSxnGYcsKtVJuc3h6Gdz5q6eO8uxRtq9LKSB2xn7Hk7o= X-Gm-Gg: ASbGncu0lqhOXTy1+cY1h5diTTKVwtme6VwNAu/LuFa0x4VGoxltc55g1v19lyeTfRg QXO4orYTwmsNd2K4ivF2YUigTpN+b41oykvyMkLm9jWIezB/KP1Amkh8vz/qP6r6lZercG/hIOq C2RVaLb0JZPC7z3m3U7c1pWgvksh60CeFnnpGX9J/VQuUeAQUEtvnSE0pE7KZgaUTNaILE968AV fcp3EGSJFdQQPclPvAIW/VlDQtnPMa/u8gln3MtF4jQnYpfgALTEYfUUSNpoDoWX6/KVhSC/ekG QQrisEnbAmc6KC96vfBrrvAikWwMrq7ttz3v X-Google-Smtp-Source: AGHT+IHaLlLegdzZ27WF3+EP/qqq6kVpqc4ibSdXPq8IpfN6BBr6SIN3vM0ZVDpugyRjl2BsAWhwEA== X-Received: by 2002:a05:600c:1c1f:b0:43d:7413:cb3f with SMTP id 5b1f17b1804b1-43ea1fdc23cmr53880905e9.5.1743511617320; Tue, 01 Apr 2025 05:46:57 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a1d1:bbb:e2a6:2a9c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d8fbc1889sm154711095e9.16.2025.04.01.05.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Apr 2025 05:46:57 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 01 Apr 2025 14:46:43 +0200 Subject: [PATCH v2 2/4] gpio: deprecate devm_gpiod_unhinge() Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250401-gpio-todo-remove-nonexclusive-v2-2-7c1380797b0d@linaro.org> References: <20250401-gpio-todo-remove-nonexclusive-v2-0-7c1380797b0d@linaro.org> In-Reply-To: <20250401-gpio-todo-remove-nonexclusive-v2-0-7c1380797b0d@linaro.org> To: Linus Walleij , Bartosz Golaszewski , Mark Brown Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1313; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=WbtXMBP/Lx9tJ7UhDb7HOi5xtDCb5dGgjCHO5zGis6M=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBn6+A+N4yVcT7sWbctWbTS7q1ERLNVyT6RkRHzD 9qh7g7uNlyJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZ+vgPgAKCRARpy6gFHHX chetEAC+00cV1S0cRNMEFzRJdv/r6HrmFnq3EGDYE9D5V0FjSjAKiBCAKSXmQjgYWx4RPzBGQDG uUFxUuTSC+5sYnvO6JssdDqKTX7KSvX3T/jIC7vgAfsDkfjLSOLD9Nj+jjKZtihQHKsLAiZhh5v r8ueH1nBOwMFimGEEiGPw9FHUu6uRO2NsLiUEEN1aLQcb3qo77XLZpHiVgcowqppSgS3fUbXHWt yOaRGKD3bIFTNmN2qy5QmBC3odQPS2R3J4M95Z0ySkfS2+KE8lGoeX3C9RwcDYXk1QPcgUBRSeR ZEgl2gphsjBBFtV67ZXv/U/+bpb99Xg3EebwCBeKUJftrWehPbD7gR8/jnyppQ0HLFfqEkzX7jw Qvsvcip8M90nI2C1MBkjCL2dV672xX3Atp/FwmMPRVCFhk5m87EXOfaCSnLFPrITM3SJtR5X46J 45GLuCPsRNkRcWGZGPgf3unddIpxBmqyV/VdkPjDfbW4p9FEe5nDmwXfdCxQD/HQ80b0MdCzNb3 VvyrVqTLYaSZldpUIlOSt0nKYTdgP3387GzpJ9vy7jg6GM38OaQQmnVlEjgfJlm8AWuImbInBfB MnLLQnil0z4QB2q6CVBMK6PCwc7wOfxnBYHYVDZSKL6lKG22vhYMsqKrG4bgnwtyfH3lWbQd03J 0EIxGF3F8QHILGw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski This function was introduced as a workaround for an issue with resource ownership in the regulator subsystem. Rather than passing the ownership of a GPIO, we should make the regulator core be able to deal with resources it didn't request. Deprecate this function so that we don't get more users in the tree. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpiolib-devres.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib-devres.c b/drivers/gpio/gpiolib-devres.c index 08205f355ceb..120d1ec5af3b 100644 --- a/drivers/gpio/gpiolib-devres.c +++ b/drivers/gpio/gpiolib-devres.c @@ -317,11 +317,15 @@ EXPORT_SYMBOL_GPL(devm_gpiod_put); * @dev: GPIO consumer * @desc: GPIO descriptor to remove resource management from * + * *DEPRECATED* + * This function should not be used. It's been provided as a workaround for + * resource ownership issues in the regulator framework and should be replaced + * with a better solution. + * * Remove resource management from a GPIO descriptor. This is needed when * you want to hand over lifecycle management of a descriptor to another * mechanism. */ - void devm_gpiod_unhinge(struct device *dev, struct gpio_desc *desc) { int ret; From patchwork Tue Apr 1 12:46:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 877539 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 A5FAF202C5B for ; Tue, 1 Apr 2025 12:47:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743511622; cv=none; b=gYTpnQXJ+NWgMMQDMoH/KMRrAuJv0aGsf1CYGuePtuoK6PEs372sZ6wh59ZHko5zQzXI/oEUMjdZ+H7BjG6IOMg12NSnjMICksMp4FMlnPcyTAx9or88b0aOmAYA3tiXH2PZsOjIkgb18dIXO5N9eXTEHw0SyN1MKFAt1sZumk0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743511622; c=relaxed/simple; bh=JkOG18MioYu8ChggNN0A+zNlGCZjt2SjnCv8Qzb6PLw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mTEgpnj0/FZh90c1OyD4NBKxtw3HvhKjlFnXjOg4kbNBt+KsCsLNEmTYtDcgPQ2vRoKli7OcjFj4IKJGlmCB0WaGWRXWofB+536e453cStsCQOv05L87sXOeaWnsYRj4O7n7rb30ti65db11kwTMkCwlQ6R/4MZ4takUReTnPk8= 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=xeQfMXP1; arc=none smtp.client-ip=209.85.128.42 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 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="xeQfMXP1" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43cfba466b2so55218375e9.3 for ; Tue, 01 Apr 2025 05:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1743511619; x=1744116419; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=O973o4r5OZyC9BZfOU3kqAN8fnVRgLDLcQzrk76LOqQ=; b=xeQfMXP1+fT/dsZ0xON4nKlAB108A1G3BTNUsTi3Zr+VhS0DJOIbMT+6/DQK3dKjdt Vm/X5dVOvqrsCRs7Sa894fJcv9sD8l1ZPPV3hlicjdJEM9h1hnhhtW4fTvBei5wsv3da THHFzkVzn+fF99o+aUt9trMfVsNyUH3/5+1P/a1OgjpzrbHwdJd/rRDOkBDFlUeEE5rO lmlyGk2gIy+fx/wMlbcjrIDzUxdwm7g6Q1BjNB3aLlbEQ9h30eqPECm/0NMOQVd9Dy7w NF1dEWJByf9SI1nG5RFsv6IzccGmXibQc0Nwq0qUTRJvnnsEeuqeSaqExCj+OZf4CykL ii0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743511619; x=1744116419; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O973o4r5OZyC9BZfOU3kqAN8fnVRgLDLcQzrk76LOqQ=; b=WmVF3FQk1Khftdyn0EKFXbFQ6HdY4EWjDS7wHHQK157Y2k99E/M00TOgYcUKX9mc6f 6O+P55IjGUH0ZHkqWsgjn46zPQTcjEFtNOGr0wAIjjctGuI3WAqhCXHvw7a25y+SIVlv yn0zUx71ixtbfDLwsbdYfjE4UJRvjxfSALOx3XFW8upEYhHxncLPwX7ata4NAIYbjzvx yWfU3Slu9/1bmhgwycGShkBZx4PnIctu5q13ILa6t/FNklLxVjTRvQBjhwfJGSO6E/Ki UFAhy4xIIQIg+izM6RaR7Z40lxyfCYwKr9sm8IeyvC0ndXOyFe/3cENBExqmlhOPqL31 LE8w== X-Gm-Message-State: AOJu0Yy/b9F5y4gYejUxyNAytNLo39rRefDehgCqV3MmDObWla0EobJo htCrmj4fwWDch9LeSGu3n/fnDxIZm62MqeEpoE6Y/qwtm8vxQCtigZyqWlE1ZAI= X-Gm-Gg: ASbGncs8fMT4AgOqLuJSREjqs5hDcP1RD8UlodN9tdnFW9mcl8lySyLeqCcPtOAZYoz X8RvIbqonHq6Aw2Of7fB/x5IniGkrnjL32zuokpLkE88tzL1scMH2aqexGq7411BT0qONjZC0gN TuSbhIkgRromG+A5cZNSZn7fSdU6siJ8zeGmHXj2NfDaPrioeKVBV1DdtDcghx0MbhxVtVm3a8Q gvrn//NJGbkyyWXwMGv0jlyAl26Bn9xt0oLaX+X8fVrv18mIE+uF972MnKjkr7S3hcFfY7WgqJT AzQAZKeumVce6LNKzFi8ldDYSx3k0XNjV7sx X-Google-Smtp-Source: AGHT+IGVViAJd2BFboWMnm9/8gwix+c7PzYTgEUC6yQjbYfGsDLLy/NtUnA6k9FYa+zAPP3wsDcCTg== X-Received: by 2002:a05:600c:4705:b0:43c:fffc:7855 with SMTP id 5b1f17b1804b1-43db6249861mr118603305e9.15.1743511618977; Tue, 01 Apr 2025 05:46:58 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a1d1:bbb:e2a6:2a9c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d8fbc1889sm154711095e9.16.2025.04.01.05.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Apr 2025 05:46:57 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 01 Apr 2025 14:46:44 +0200 Subject: [PATCH v2 3/4] MAINTAINERS: add more keywords for the GPIO subsystem entry Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250401-gpio-todo-remove-nonexclusive-v2-3-7c1380797b0d@linaro.org> References: <20250401-gpio-todo-remove-nonexclusive-v2-0-7c1380797b0d@linaro.org> In-Reply-To: <20250401-gpio-todo-remove-nonexclusive-v2-0-7c1380797b0d@linaro.org> To: Linus Walleij , Bartosz Golaszewski , Mark Brown Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=814; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=pMJ2ejTqSuURn65EkjVC6Jv3tiwHgCNsCp47X6QxcOY=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBn6+A/8aahbPoNTEGgiXVAM+kIMRz0Jj/rHociv ncxAtmlNaaJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZ+vgPwAKCRARpy6gFHHX cuVjD/9w9IWz2tPsJvuXLNlGXcEOwMrx5we5lWrKpa1ucn91TaKhbSMDIwDWLTFYTa8KVmecYoy GOJyr2FmbqiwVZpBAaTJujcL3bUOC/PjRJBKjwxRPgaQ29yJ6tKGtM3buP43qbO4k9/VErmP8H5 pD+MnyYa+weouY3ePnyogo/i3Q1eHLfzvRSq/alQkt2WtuaC4HvpJq9NXlst6NTn4wVhA+x+88p NApBI5Pe8Z6suGEMarymJLqcQaJGSPbvCPcPvnUgx4xBrdeEbUGCM0EAz1996YJt95nKsI4EGga xHi6zntJ140VEyEMkub5+ibTci+MpTRu2qNg4muvHXcA/gihai3tAYgrEL0pUjNB6sSCQs8Stwe gOQb7A/HysiJC4BqtPOSdHSxukW1SVd+KrZYkSyi5eNB5QZt5sU3FpqlD++mKp13Rgr2IOkysOG gD2HgnD9ddn/86bGA6Goy8vtLNrjEmDTFT4TX7ICMbYhZHGbHDmscbNP4EbK7SV29dak3RJqHaO w5vkvgXCQR1lJbZXJLPWbmf5z4gWkt/Ciao1Hj/m7itrrFAX3zj4A7KTuI2NURcG0iy1zmKLqIn NTuubW/CcR6L3A3wkhlkOEkz8h6dsFNSk00N5D338VQwNj2rBEVaFxs1rFaf73M66swsyesojZH 6AjiN4QHkfjMpRA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Add GPIOD_FLAGS_BIT_NONEXCLUSIVE and devm_gpiod_unhinge as keywords to the GPIO entry so that we get notified if anybody tries to use these deprecated symbols. We'll drop them from here once we remove them from the kernel. Acked-by: Linus Walleij Signed-off-by: Bartosz Golaszewski --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ce2b64f4568d..0ce265332577 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10151,6 +10151,8 @@ F: include/linux/gpio.h F: include/linux/gpio/ F: include/linux/of_gpio.h K: (devm_)?gpio_(request|free|direction|get|set) +K: GPIOD_FLAGS_BIT_NONEXCLUSIVE +K: devm_gpiod_unhinge GPIO UAPI M: Bartosz Golaszewski From patchwork Tue Apr 1 12:46:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 877821 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 AEA1E2036F6 for ; Tue, 1 Apr 2025 12:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743511623; cv=none; b=hRu2gL/KwpVgT4Kb4wZRCxc8+mQz5JQB+XCdrND4EH0N8Ng48SFHXMSHO0QiJsBRnY63OOv8H4DRXpj8t7DHRSnuZSd4EnuTQ3qRNMozXXqIxCi8CteRk04bPwLYBShYEbxWDT2ks38JmyJ+B7MIWOn9xsVcw7pxalAQztke7+w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743511623; c=relaxed/simple; bh=GnrucwK3wBDJOuGf993QhhGPNa9SjUynbuL3Y9sy9PU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ev3cAVZPbZPZyvRk0yX0/hlvu+GXrX3ctslUXY9Km6ZtcyNmiNuTNdMVq/Ri5IUqs6rPGqZrMnaRyWQIp7+LbYzlDyek4zlNqx+WswSr3+fOSfiEMCb+um/0mm11R2D5oDwXEyHcMiYF4CfOFY5Guuw5wmYIxlGc019CItYPy6s= 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=DVqHWIUW; arc=none smtp.client-ip=209.85.128.41 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 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="DVqHWIUW" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-43d04ea9d9aso25648965e9.3 for ; Tue, 01 Apr 2025 05:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1743511620; x=1744116420; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ru/kCs6fPOtEnmEL1xXoiZTrgpc2bJaLexsQ8fcTImU=; b=DVqHWIUWpie5gEHBtHKIqUDzasR+bZ0tE5zP2fEA6s0gk3xRR9h7sGO5f0pZL76iWE u0Of6kwnrmo0LthNMZNljJxNGysgmjJ37VAGUFtIIihIwzcfQVBikwD79W70oIljOkNu BNHWIgWlH756qkV6Bv8LmT86DMKny1A7DbbCIdgjTKTDbQIcuQ6K6FaQliPO8oZQ67uE XOTI6cmkWX2BzPL0qAh6tKAmxthEO58CwnRYPqX3+mMMfik8smdc1yNXhRLNWhj3BMxs bEy2u0oUSkgQ41MQI3u5gqqfxy6t9fvhKEDQPKdQZQcuFrappX0jnSrimabIIrg7PrZD S8kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743511620; x=1744116420; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ru/kCs6fPOtEnmEL1xXoiZTrgpc2bJaLexsQ8fcTImU=; b=fos2JnVaZ2Cnuh6af2NVgv9uvj/ME+WXINkuBcetc7JRI1jQUcAGAVa+IyA4j2hJBx rN1azKkUNghuUVJshoIVGKaTrgQvy/lBb5YQ9zfmNPIwFb7g2jITrwZRurB2CjyYCsaK tJEvsKqfoCAhsZfceWgnwSQ09bNO5m2k4hz2XKxWVw3ihwclNPbR1uidyjiYOoYawmXU aop7qmurruBfIg+KxmLfvHfOjwYmszUOlMX7QjtpV25OWvdzHEZFHXjsApHBSxvxqzhR A3T45nxRevLc5srHIwttT55EKmv98yZpVWjErOlbW9mSBXaH2ac4l7wigJ5Xkln6+j0R fnmA== X-Gm-Message-State: AOJu0Yxcx3XJwKg30vReQEpkTlURoTqtB3EYAMg1mwzNE3dygmZ1FxnE T0X28JWrcqXG4ARboTr+nhueOwHu+QHBlZOgxIrJ176ygplIFX5legFm/3nuyBMPIxSs8nLEDnq Q X-Gm-Gg: ASbGncu1p+qOygw6pldluZS5SGE+RY+T28eLSwxvbaMmTTxt/eshbvRxKnFl8hV4FSM zlC8dUHrFqB/e4PC5mDHny6RMdKW+tnaiGfmYY4DzhbRWTBBsojAXSKAc+qJ4+3KgAu79xspCHX uoCW9mNGAIZEXjo44mHpkUb0FzIu6pI+Xu6xJglx6wB1yA7ctPu7HZiY/fJaCgaE8fW0s1j0OmK PRjVYR+SFRiZIDZELCs1Ok5aoenA2wMVIiWMf+FIWIKsiFyQDVWqWfhEnuMxo5gjRUWxV7O/kOX fpHbycB/MBZr0EjyyQhQwl+0vHaj6pNi/Bcv X-Google-Smtp-Source: AGHT+IHItyHH2EZ4mRoUhQ9o3NHL0wZrgwkzTBEFAtYB1xr5BdYYW0bABHCjSUvE7hwZnh5gnfHZ8g== X-Received: by 2002:a05:600c:3d9b:b0:43d:10c:2f60 with SMTP id 5b1f17b1804b1-43db62b763dmr116400685e9.24.1743511619813; Tue, 01 Apr 2025 05:46:59 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:a1d1:bbb:e2a6:2a9c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d8fbc1889sm154711095e9.16.2025.04.01.05.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Apr 2025 05:46:59 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 01 Apr 2025 14:46:45 +0200 Subject: [PATCH v2 4/4] gpio: TODO: track the removal of regulator-related workarounds Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250401-gpio-todo-remove-nonexclusive-v2-4-7c1380797b0d@linaro.org> References: <20250401-gpio-todo-remove-nonexclusive-v2-0-7c1380797b0d@linaro.org> In-Reply-To: <20250401-gpio-todo-remove-nonexclusive-v2-0-7c1380797b0d@linaro.org> To: Linus Walleij , Bartosz Golaszewski , Mark Brown Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2684; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=zc1zKN3/KwCiY/o3NNRg2Y1Q2MbeVO4dJU8b/Lwp/As=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBn6+A/6+i4htRXdHudS4uj3buYx3Z220bI+AxQo xOYk8MMoxGJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZ+vgPwAKCRARpy6gFHHX cijsD/wJ7YiUVP0UYIZ8BUaAUNToJYtnpFiE0Pqy/HNjTu1WLJe+lXN891Vm80+KmsDxzq7zTYA vemMk401D7rmc7DcBQotzV2NVGEyp5RMiiQH7sLPFtICJaiLzQgOs4I7FPGuEy4hVmoxplm6Td/ 47rEpNdnIHBlV1LIF58v9iCTxXcuBxC837cyQglzUNQc+ZZVu9CjmS3axBO2UlaIFUe2iOsTTwk q+pOoQvNSqq2o68z2Mx9UdHBsIXXEYJziJcLhK3ocDTbcfglJmwd75muvbQ6aWUpeMzp+gE6tTP JBvJD1HyUCmaWpYoYdpnyZSFrhJ10ICG5gBxKVPdEjozOymJ65zXD0cTDWKerTs3gy7FqQF1Ey+ Gg28WcmVvMhE7Pwbt4ZMERl5vkfs7kOcT4SPeW2EDLk6Oi4Yg3MlF4lXX8YyMVlLsrc77KBI2Qy +j203DMerbur9A4o+KVf1FuiiJVFxIVikEtvgs553R0h5pcgCqgn4apCCxpf2Ky0rTiM78TpzKP ecbB3ntZ1ICjgQZytaW53GN+Eh7BsM8p6v7lvHu7lRRcb3FUsX6E658AvdgKA1PXvZLlCEtLvRZ BuUchLgz7YVK1BfVE+7GaAGMwVFnOjwR2EakSX40zTjg6fVv0WZTwChurOXRap+7i5YUxWhgktz BvcLoVlMI76pmig== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski The GPIOD_FLAGS_BIT_NONEXCLUSIVE flag and devm_gpiod_unhinge() function should be replaced with a better solution. The pwrseq subsystem is a good candidate. GPIOs themselves should remain a unique resource. Add a task for tracking the removal of these deprecated symbols. Acked-by: Linus Walleij Signed-off-by: Bartosz Golaszewski --- drivers/gpio/TODO | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO index b5f0a7a2e1bf..4b70cbaa1caa 100644 --- a/drivers/gpio/TODO +++ b/drivers/gpio/TODO @@ -186,3 +186,37 @@ their hardware offsets within the chip. Encourage users to switch to using them and eventually remove the existing global export/unexport attribues. + +------------------------------------------------------------------------------- + +Remove GPIOD_FLAGS_BIT_NONEXCLUSIVE + +GPIOs in the linux kernel are meant to be an exclusive resource. This means +that the GPIO descriptors (the software representation of the hardware concept) +are not reference counted and - in general - only one user at a time can +request a GPIO line and control its settings. The consumer API is designed +around full control of the line's state as evidenced by the fact that, for +instance, gpiod_set_value() does indeed drive the line as requested, instead +of bumping an enable counter of some sort. + +A problematic use-case for GPIOs is when two consumers want to use the same +descriptor independently. An example of such a user is the regulator subsystem +which may instantiate several struct regulator_dev instances containing +a struct device but using the same enable GPIO line. + +A workaround was introduced in the form of the GPIOD_FLAGS_BIT_NONEXCLUSIVE +flag but its implementation is problematic: it does not provide any +synchronization of usage nor did it introduce any enable count meaning the +non-exclusive users of the same descriptor will in fact "fight" for the +control over it. This flag should be removed and replaced with a better +solution, possibly based on the new power sequencing subsystem. + +------------------------------------------------------------------------------- + +Remove devm_gpiod_unhinge() + +devm_gpiod_unhinge() is provided as a way to transfer the ownership of managed +enable GPIOs to the regulator core. Rather than doing that however, we should +make it possible for the regulator subsystem to deal with GPIO resources the +lifetime of which it doesn't control as logically, a GPIO obtained by a caller +should also be freed by it.