Received: by 2002:a05:7412:b112:b0:f9:3106:f1c0 with SMTP id az18csp129433rdb; Mon, 18 Dec 2023 01:01:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGajM435wByPRltP7tCAA64FHci68fGlnvqGL1GejUlZsamAMXKlKvSceWXSadPwgvFiiB4 X-Received: by 2002:a17:902:74c7:b0:1d3:ac9e:3086 with SMTP id f7-20020a17090274c700b001d3ac9e3086mr2135893plt.28.1702890100581; Mon, 18 Dec 2023 01:01:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702890100; cv=none; d=google.com; s=arc-20160816; b=RvKIR+/TXqKP2+IN6BDtTjgAQJZYrsTOHTpHn68xIqHgUZ59UbP2jR94fYBgYwDwlh Gx0lnyPWbUjaEm2CZ33zzw6rLF0NKC9LtFxA/Lk0I1irfpKZ2eNxFJHVGjBP2K0b1qCc pHWeDzSoejnS45u8seq0jQhnds7671MtDkmhHuOQ1DxDkZLbhsaK2rEfVrManPgSvqMr 79dYZT/YlD2YO7AkSp5sF7GGyO8KeVM5Dw4IzBTB3zTSHWkZXWT85pWemwe+cYEafoqI aUrxjSdGA0bHZqJjAByDYDIFbad8CntUwTrdmtkoRopxInpd2/cU03DtZckVnZCfMCcm fPlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Dw026XAnMtLtxWNCzhpPAk2Qu2t2BiOON2FGMJeyr7g=; fh=NA2IZTsBFwjREUcds8Nt2e3faPWWUm3ShfnoxYpp9Xc=; b=MiTEwL7bwcBirXekIqHsub3q+d+Q9J3cgwfV8dZ8poRKm7/b8Ovs5LRyL0btgCtxQ3 4j1LNg+vVf2G3lIaskP67/zNC61GEAjO1N9U2xCA1jsofAjJAG8+7skVmCLR1Z9tQGUS Hj+GaC3A85AEHmMvpQmDyF2LTPEW7aWMht9gD2El1Wm5S7OZVTfe+G+LvHGvc3JH4V56 rehmqL/P3644J9z+PGWJxF1VoFsffmv9l0SCypEH1pM9pI6C9UhTo4bIJk5lwHHaabky xOHOPzXObyf0/+1WiKupceb8qgcT29Y55fw7CjumndsRvyTOmQkvB00bVUzbtMUdpugQ D+zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=PxrFdoT+; spf=pass (google.com: domain of linux-kernel+bounces-3199-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3199-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id jc21-20020a17090325d500b001d00ff4bf6csi1177857plb.466.2023.12.18.01.01.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 01:01:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3199-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=PxrFdoT+; spf=pass (google.com: domain of linux-kernel+bounces-3199-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3199-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EF5B3B21E5A for ; Mon, 18 Dec 2023 09:01:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D42C10A3E; Mon, 18 Dec 2023 09:00:54 +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="PxrFdoT+" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (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 A1C64125BF for ; Mon, 18 Dec 2023 09:00:51 +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-ua1-f45.google.com with SMTP id a1e0cc1a2514c-7cae6a42e69so1546334241.0 for ; Mon, 18 Dec 2023 01:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1702890050; x=1703494850; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Dw026XAnMtLtxWNCzhpPAk2Qu2t2BiOON2FGMJeyr7g=; b=PxrFdoT+DSIB6eEzateOpfY4/ZhLgx569COxdfk9kGK6c/eEMRhkTUspc4IPkyTELL WMuggvwAnC4BOplgrCIX0l4xPtOG/Va90wnPLaSwbVtw7m6ksYE7Ls7tvuycK4Tvodcn 6ptYHPi2TguKa4uoOxUidMZbczE/LfVVL0ovgV/Baihz7guz1IjjEVd3o4XJ6ma3xZ8u D8xE0EuPJsLsj0zsJTFBYw8wZzPFbikFL9OCbz4fPmgYWaPuy3GDFNzMh9kHCQzxP/yP fSY5VLPJr0aWay9WnROv/RA2jV5a7GFLi4N8dxKvvXO2gRkw7zKzFjrUHyXpiz38Z9Ls B5FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702890050; x=1703494850; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dw026XAnMtLtxWNCzhpPAk2Qu2t2BiOON2FGMJeyr7g=; b=HYgmj00GMT8H9gp7qQWCm6vFQ3fhUoApVC13WWsKD2fZ/EAnL8GSHLEtjRUx2mHAkn umXV3HYVUCJ3qTVpVupRmDX9OlBT1tubjAmtya/gD6wAA+jK91tKuC9Ou9QtKw55Rwyu EKLVl5fuzBwBlMz7oLgyS37IGvdwZ0VDPSxzdoitV4hXKjtZp/sCzW2g42sTO/A9Z1yv 812vgYwyuyPxFtGd0J7n4tPLrn7u0v0On6IfB4Aa540Q+VVATqU/Sf0z4a+9Nftyxqtr nbsxHVpoatN+zkZOL+inUw0jSiRVfHPc0eLeY8nMD5kDL1DHDZf6+12GFW25aVhqWlUw 73Xg== X-Gm-Message-State: AOJu0YySYtelI2LWDeVrKZGQQ/wEtEoCsJrTHNuU43fpoKr3Ojl9l/lt GJlJXy+u9jibQrCJw6ZlputKOx37ePrSETjsipG/Zg== X-Received: by 2002:a05:6102:2b82:b0:466:8748:1309 with SMTP id ib2-20020a0561022b8200b0046687481309mr1799507vsb.13.1702890050618; Mon, 18 Dec 2023 01:00:50 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231215155300.21186-1-brgl@bgdev.pl> <20231215155300.21186-3-brgl@bgdev.pl> In-Reply-To: From: Bartosz Golaszewski Date: Mon, 18 Dec 2023 10:00:39 +0100 Message-ID: Subject: Re: [PATCH v3 2/2] gpiolib: use a mutex to protect the list of GPIO devices To: Andy Shevchenko Cc: Linus Walleij , Kent Gibson , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 15, 2023 at 6:33=E2=80=AFPM Andy Shevchenko wrote: > > 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. > This part is no longer true, I'll remove it and apply the patches. Bart > LGTM, > Reviewed-by: Andy Shevchenko > > -- > With Best Regards, > Andy Shevchenko > >