Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1874429rdb; Wed, 31 Jan 2024 11:42:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZgFA4s8WOedw8V6KIGAYaAR18bwnX+MxsTDSAuU/Eg3SjeLts5+DjgxSnn/pXr1H44RqK X-Received: by 2002:ac8:5b8a:0:b0:42a:86b9:9f1a with SMTP id a10-20020ac85b8a000000b0042a86b99f1amr5956540qta.43.1706730124194; Wed, 31 Jan 2024 11:42:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706730124; cv=pass; d=google.com; s=arc-20160816; b=ez8/rALrHVPz+3fiZdYbtmN/lZI5Qa4iaZmlcqDF31vClUWU6SIk9AgyZgs9ZPgStH dHbGDiz2aHdDBO1VFd+QtVw4CZmOAD1rCzGSp7Wxkw28NTpjOyfLQCodr0fVUuD+9QFc AThmXwWEjydNFChW5PRQD5lnMObAtz3iIkrzw7U5eJxNJgQKv4X7ysBz8YCGZqfcs5ha OdYCfRAQ851oe9rnc4vFLzBhfSNEVyiPpr/uhG2j2OruxsFgXZA82IzMwvb52pVBSbju Lvn6utIYr9YsPwPlCea/UUuO/zQujm78fkhN15aiBq8UQd3Ld2qdJEbhDkPVUKWDY/Z1 dGpg== ARC-Message-Signature: i=2; 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=OnoQHvAbASaPoVdTyGlmKQC9N2Jh1gEDxnnkfJ0ZHb4=; fh=apOuOryZzKwJ3F+GgYsI3Pmu8jTPVVkTD+QxcmRH/kU=; b=M5+8x6YNYJOnwBqndfeo3a6DGk6FIGiBphUyYyA8kjObh7TEYoXruSwHaPCLFvHU7l rHrTM78SHY8X7pW67QysEt1uselfMOpTAZ8qaO1CBp53kq50q8WSbO0Zj0XJ9+m6lm+U ZXmq4uB0U2nu7Z1TyKysY7dU7RnEEsTm7jmzHI1lfxqqaICs/TG5DYj5oB+qT/rzCJn0 KrRqGWDnnZx4OPucKh3KzfPmBUvp5hxBSx0xbRj7xYe2skyWC1qUghFxsl73YdAZo0oO /NqFJDerueaOi7e0W5HpYdkQbajWIcIbs5PxyqFyrXS0UExsQug7uCQDJdMLVkZwokhu XOsA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YMdiFHmX; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-47025-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCV3oQGIlje/7g0ot3C4AUVo2o7BLINtiAXfUV+8A4f7HGerF71PXsP3xjnS3OTbc8sk4ctkjHmynGkvkpc6LNzBcFngXkbHol+/4Gd94Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e11-20020a05622a110b00b0042a2e12d5d5si12384161qty.230.2024.01.31.11.42.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 11:42:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47025-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=@linaro.org header.s=google header.b=YMdiFHmX; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-47025-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 19EEE1C250A9 for ; Wed, 31 Jan 2024 19:42:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D80BA3EA76; Wed, 31 Jan 2024 19:41:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YMdiFHmX" Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com [209.85.128.170]) (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 762C63FB17 for ; Wed, 31 Jan 2024 19:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706730107; cv=none; b=ZYic2XY25klDrN19UrBxkO3FdpStzIq7txY9j1lYipqhhnJW5VczenizCwJXNxMKnrrGKVhyjpADBry0QLBuDX6kC5Sh1QhrEXTxWizR8u2pMgfssCWNfoCNgX/At2F43KC9r8zcMBI9RNOVDaIwngLc/g/fx22cGyHHalSfFq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706730107; c=relaxed/simple; bh=OkhClyqGGM5gqjlWyitEvXIZetTvRXEOIznDvqpU1TI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=CoIKPDC8NduQ0wV9se18wwsBp9cY9dkHCWlECZr+AmJkyMDSaWZ2DSs/qDPPEWqjIC4UWCsZFCT3Y26P/a0CRbmKPK4I+CyPm3IJv4cyYLoYhR5tE0J2i0VfIgKSzp/QU2YnRyiVmMmYVXnIn45HVSLJvCtTrmbD59OKQTHND5k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=YMdiFHmX; arc=none smtp.client-ip=209.85.128.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-602c714bdbeso803577b3.1 for ; Wed, 31 Jan 2024 11:41:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706730104; x=1707334904; 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=OnoQHvAbASaPoVdTyGlmKQC9N2Jh1gEDxnnkfJ0ZHb4=; b=YMdiFHmXZ4YNZ83hJFGTVaJFVgCJN1eKBI0DLd8/m6U73fU/N4RryPGL56IaTHmRss EG5f10CeHJa9CzpxPHTG2q6DQe7hvF2kgOYkTYa0PSy2o2rrKfiAcjU2bFIGQq71QqZh 2eDYl4jKfEN5FLu2TMjfaNFUvzeQzVfzDVB6rnFGOheXFWy4m1DIty9vCoFTOzqRVkge vyIhIN1WsYtDCxqoRM7hkxUS9bJtpDBx0/SHxlD5JH5UknYQ5YHbIkACoKN01PSEF+ZN ZVtT9/emgPH6b4Iyc4fHEnX5tGUZAUu0cnGSt1o3l4XgMFcgAN/IyMPKROkcRsIlVomW XXfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706730104; x=1707334904; 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=OnoQHvAbASaPoVdTyGlmKQC9N2Jh1gEDxnnkfJ0ZHb4=; b=Q6UXnec5k2IIEEi0249wFzvSaA5CQRLnygx3fDqNSySpG1Xi+8yc8xtoGgPBNgLbMJ Ju6UbuoxOIMk2bwOMYKHTyLnKMbTjH+uaqhdgA2Tk8ayKz74tJsW8Q2r9xbZkHq+WArO j55BKsPrWgjDCM+p6UOallAREdncR9f6CC6QPPwPL0szGmv2dNcFWhQMFl2F36mhY6Cu o39I5no7Zg+F7ip+PiTBd6G+LeELuZJ6AlmmwsOTNCvn9uVZqP/bANfFAz7rllbAUaGC kJ8QP5+CuxfPRqod2MXSM2FunTVVwoaxi36qeJKxxe5oKgInlqEGBaO3GCfrgw43mLKG w1lA== X-Gm-Message-State: AOJu0Yzf4RtywMpIRbULyZvZTt2hobDKEgjLTr4/QQoeVo3YlYtodqO2 XvFGoiO3daIuXbR54HAFz451lUdV1oco+C2Jo0/VOWIqjegyA/Mf1p/NKLhAtaqOXiLgAyD9xPz Eb4/vVC15zYf2HVcskzQ8L9F9TQoAnJzpFxth5g== X-Received: by 2002:a81:83cc:0:b0:604:1277:d759 with SMTP id t195-20020a8183cc000000b006041277d759mr1317173ywf.20.1706730104368; Wed, 31 Jan 2024 11:41:44 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240130124828.14678-1-brgl@bgdev.pl> <20240130124828.14678-8-brgl@bgdev.pl> In-Reply-To: <20240130124828.14678-8-brgl@bgdev.pl> From: Linus Walleij Date: Wed, 31 Jan 2024 20:41:33 +0100 Message-ID: Subject: Re: [PATCH 07/22] gpio: protect the descriptor label with SRCU To: Bartosz Golaszewski Cc: Kent Gibson , Alex Elder , Geert Uytterhoeven , "Paul E . McKenney" , Andy Shevchenko , Wolfram Sang , 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 Tue, Jan 30, 2024 at 1:48=E2=80=AFPM Bartosz Golaszewski = wrote: > From: Bartosz Golaszewski > > In order to ensure that the label is not freed while it's being > accessed, let's protect it with SRCU and synchronize it everytime it's > changed. > > Let's modify desc_set_label() to manage the memory used for the label as > it can only be freed once synchronize_srcu() returns. > > Signed-off-by: Bartosz Golaszewski And this conclude the previous patches by protecting the inevitable label with SRCU, very clever. (I wouldn't have been able to come up with it...) Reviewed-by: Linus Walleij > -#define gpiod_err(desc, fmt, ...) = \ > - pr_err("gpio-%d (%s): " fmt, desc_to_gpio(desc), desc->label ? : = "?", \ > - ##__VA_ARGS__) (...) Now it is clear why you were minimizing these helpers. (Maybe add to the commit message of that patch? "We do this because all functions need to be changed later".) Yours, Linus Walleij