Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6839803rdb; Fri, 15 Dec 2023 09:33:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEb94eLyDHu3PZ8cF0gldBNmWTSo3Mk4Lc35P3qtcRVZ/m3U57nORIOMcYawLWED0ucim1 X-Received: by 2002:a05:620a:3712:b0:77f:3b80:2a73 with SMTP id de18-20020a05620a371200b0077f3b802a73mr20353373qkb.4.1702661620283; Fri, 15 Dec 2023 09:33:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702661620; cv=none; d=google.com; s=arc-20160816; b=ICM3g48WpXaT4rV49ALx5FRu9n/vVq5yFmvaWN4TDHAAc+qTSjnp4lhcwnVRuQkYDe faZ4/CcSNj+df5H70H3N9W5G9nyU1Lhv9I8L+7BVTSwX7nqq0QhA7r05xwL/LRBWhGuf YGOecx0vt61bDZOU9Hw9KodPBZtIUIycWpcefGcHb8agxqv6sjTqSBIMyO0CoAIlXToa 0enRBPoxprZlAJPdWe7AdqaGUu/AIbkssgarscpmf8q5LhmfWz8PtV+Oqd33VTX+sorW 0Y8GgBpUYnl/U+5mTM7KC9QQH8l8GwPpTwsGgPxlcufu42gOsGCtp201N4l0qjj6axfV kGnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=jKRuPV3O4DgqNCpAnwSA7wJldgG1foARE8r8BbnCHL0=; fh=TFQI+YzLUQlYl4kOcmLiE6H8IBxzIqYzJVz8pYCx9C4=; b=yAKSvxNmMB451UX2X6lh0RQqmRaD5moOydZIqIIuAsLIGhQgtHHlHFI8ueW8WumCYF m2fYdhiHaFH6Xt+dJGwHeDaEoRe/bNslZPAC6+aVQolPYulyggEryWrMBorxZKxZ42hr GgtEumHqsTqXeyjCfNpVHu1URpYBejTV5FGneztnrQW1R8xFikGzMF+dn2IQRxDpmRFR YOPDVxr/DMB/324y6xyU3iGGtf/lTvvtNdVoZ+/KBgsV4zBTqXV7w+7gBVI2KK30+2x2 yHINk1noyb9Mg48v5QswnJdW4i1YpVsGBE6pB1OvGeHvE1gVUJFSQz98jL9wDwP7rmaK wOyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=humko8g6; spf=pass (google.com: domain of linux-kernel+bounces-1426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ea24-20020a05620a489800b0077d75093ef3si19143095qkb.606.2023.12.15.09.33.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 09:33:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=humko8g6; spf=pass (google.com: domain of linux-kernel+bounces-1426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EE0861C243E2 for ; Fri, 15 Dec 2023 17:33:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DD7782ED7; Fri, 15 Dec 2023 17:33:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="humko8g6" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 357F982ECD; Fri, 15 Dec 2023 17:33:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702661611; x=1734197611; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=y3i9ObbG7YHUbC2/n+tb9zuNB3tXQIBP33yXqqK+ZoU=; b=humko8g6bZfV7iJ8C4Ukpp5x+PFcBF3Cz3dSQ5B47OHteyNIT4GU5K3m tY6cu3UxbMrw3V5AtRim3aI1d0RvSOhFSgflZWN3b/LzIHWx4PAOy160l K8jiRWkAguk8lreCH/NpIYjIBzBjm7t/KXXGvU916EhKy9gmmhlFcxklL bRnrPWGec95Tll7jTaLsloerbExEGeLALuql2t+ixlLgApsgLn+LtXgqc vmfWgPWeWpDRBWh0pHI7DadNkKQV0dN02JBe9D0nfr5o2IDkkgiW1m7Kg AzmHxhNppl165abnGEa0Iw0Nce7SmFE27Ok2drAUVOxTgLLpG8h/fKvLE w==; X-IronPort-AV: E=McAfee;i="6600,9927,10925"; a="385723422" X-IronPort-AV: E=Sophos;i="6.04,279,1695711600"; d="scan'208";a="385723422" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 09:33:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10925"; a="865473028" X-IronPort-AV: E=Sophos;i="6.04,279,1695711600"; d="scan'208";a="865473028" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 09:33:28 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rEC3x-00000006BG9-2tef; Fri, 15 Dec 2023 19:33:25 +0200 Date: Fri, 15 Dec 2023 19:33:25 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Kent Gibson , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v3 2/2] gpiolib: use a mutex to protect the list of GPIO devices Message-ID: References: <20231215155300.21186-1-brgl@bgdev.pl> <20231215155300.21186-3-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231215155300.21186-3-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Fri, Dec 15, 2023 at 04:53:00PM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > The global list of GPIO devices is never modified or accessed from > atomic context so it's fine to protect it using a mutex. Add a new > global lock dedicated to the gpio_devices list and use it whenever > accessing or modifying it. > > While at it: fold the sysfs registering of existing devices into > gpiolib.c and make gpio_devices static within its compilation unit. LGTM, Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko