Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6767669rdb; Fri, 15 Dec 2023 07:53:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMKKswn1MnUIRI4xW2Z2fhIZ/aCGBxwjPCtnyKxW2syfYnMXr6/KQtL3P0oeTY6FJ5j+Tu X-Received: by 2002:a50:d7d9:0:b0:552:7e03:91dc with SMTP id m25-20020a50d7d9000000b005527e0391dcmr1757820edj.79.1702655597092; Fri, 15 Dec 2023 07:53:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702655597; cv=none; d=google.com; s=arc-20160816; b=YeDhGZLS4sUjXz7KzgyHXa2rO0ejvCJg/DzmAOIeQ9iPn123ZAOFvQVSWOhhzr2vh+ mdg5xqXfggZm23k38rpkAp7Kv75HxPaWjFXUS4uDrnvgPWICMOwZCE9z7wM/Glojgl5c BoA17foS6EJvSrZ9FF4g84WwXePzSf3X2En5r0P+mAZxnbscVyiBOi34qmJrKFVfybB+ K/Kq+BjG/AEabd0FxeGeDQZt0vLhblWDpnrDKJIep298GWFfc2sOt3O7WjIR9xRwY/NL sbUE35lky4L/9vot86q0AgFRrf6y2x/xSmDerAVNKiZjanCugkDY76EZxxEuymYtY33n 9+Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=9SEVXozYauGChgmPl7/rsMQixOhRmREeWdQCs6iv/QU=; fh=u8rLQsUjk/DQ68o09SM+wx8FxqDFcT3zeQdKot9Eyy4=; b=EFR/BC9nwC1u3TFZDozbmWCtyn99T93lC1w0ypn7+Cu0os4CN0AB6e0/Qtjz46/MiU BleZ1f8i2e0XqNOt5EvMg2ChJ+nS2P/CZE4c3j3xZAgPx8wLaBWUPMYtIKP7DmYDTiai RiOqmgmDFuG35asSx+/f80pc4a8P2mahDUmA/60M56V1zrPnVHtIFav/2Z78fKe1Thyw SBwJv2ropgTFI+8L9dxEoKzqgS3M6JC99Wf/oX895BCT2UfdF6XO0WdFQYo19IY2rwvP eJv2x6gNRuCc8d3Jk4xb9h1oo/y1DNulgiDxyrmMtLSO5W7Q8trYxO4365ifSOK4b0YJ F91Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=yA2GZjEL; spf=pass (google.com: domain of linux-kernel+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v23-20020a509557000000b00551de84030esi2943955eda.335.2023.12.15.07.53.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 07:53:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=yA2GZjEL; spf=pass (google.com: domain of linux-kernel+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1234-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D0CE01F2181C for ; Fri, 15 Dec 2023 15:53:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2D6339FC7; Fri, 15 Dec 2023 15:53:08 +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="yA2GZjEL" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 B00AE374C4 for ; Fri, 15 Dec 2023 15:53:06 +0000 (UTC) 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-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40c38de1ee4so7876855e9.0 for ; Fri, 15 Dec 2023 07:53:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1702655585; x=1703260385; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9SEVXozYauGChgmPl7/rsMQixOhRmREeWdQCs6iv/QU=; b=yA2GZjELHXyNoUXVkdb1EdJeuXUYukm+e+Oe5h7tCIRPSPdLLeDQ++Rv+l7SX0koJI PFa5s2E41uC3qZrPazpmGJC/5SXvglVCxpUYSDnBkPjESaMNEs6Doqqz0Lp7LCOxxu44 emKDLOg0DParHvUjMsg7huwVFtM53cvAZ72BCLpf6CmukdY0ASpw7yK0SCSNJ6ZV15TX T/hcLzz7lpXM2Yh2DHucmL8AZv6a9LDDwJ2nEYabVEd2WZm7w2ARbQypbDYvmtLocp4K a4BZiYD+5/pCMPbRvqt1cUFHxka14CE6+axH0ALtEAf0bFuYQ8hvsEeUtj6xbzYbf43V FpxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702655585; x=1703260385; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9SEVXozYauGChgmPl7/rsMQixOhRmREeWdQCs6iv/QU=; b=ma796/3pMsxuUyhn7/PwydG6gmbdmV3EhX9uF4gJFy2lpKRksIdi74AERmOKqtlyQS IaITgy0F7swoF/uiYavE972QcwiOZw3xW6kO5t8ltxxVtOv/0mFMjbNxCfe5/36YKiil S3rET0kHeyD7bEZyD2ib3KpF9WfoGGgWi5Z2qcjeVDF3EVT5umqXyJUaHtw2nLGt/XL7 4/5yVIEumkB/c1zKn6h4rAzFVK9pKwY8lah5rKCQCc7W5AVcERDm+64n3HawIVU0dJba 2336M3eftjpm2JyvUrMTerTzaipeJU6TwzttOZdXJsn0+Zgm+LQAuX7mju7SDh+ZNDnw aWiw== X-Gm-Message-State: AOJu0YwbMBsC0apoG3KLqnAtNbdDU5f+3PxFAA+r98Q4sZjdeTtxFv7r e/eXewBBS0k8qCXd5sW1Ys0zjA== X-Received: by 2002:a05:600c:1e23:b0:40c:6c74:2382 with SMTP id ay35-20020a05600c1e2300b0040c6c742382mr527296wmb.105.1702655584835; Fri, 15 Dec 2023 07:53:04 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8672:e2c5:37d9:3743]) by smtp.gmail.com with ESMTPSA id bg22-20020a05600c3c9600b0040c6ab53cd2sm3110484wmb.10.2023.12.15.07.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 07:53:04 -0800 (PST) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko , Kent Gibson Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v3 0/2] gpiolib: protect the list of GPIO devices with a mutex Date: Fri, 15 Dec 2023 16:52:58 +0100 Message-Id: <20231215155300.21186-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Bartosz Golaszewski I figured that - since the descriptor locking is going to take some more time - we should at least start the conversion and protect the GPIO device list with a mutex. v2 -> v3: - move the new sysfs function into gpiolib-sysfs.c v1 -> v2: - add a patch renaming two functions - protect the list in gpio_device_find() too - coding style tweaks Bartosz Golaszewski (2): gpiolib: rename static functions that are called with the lock taken gpiolib: use a mutex to protect the list of GPIO devices drivers/gpio/gpiolib-sysfs.c | 45 +++++------ drivers/gpio/gpiolib-sysfs.h | 6 ++ drivers/gpio/gpiolib.c | 143 ++++++++++++++++------------------- drivers/gpio/gpiolib.h | 2 + 4 files changed, 93 insertions(+), 103 deletions(-) -- 2.40.1