Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1874195rdb; Wed, 31 Jan 2024 11:41:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYDmejIfcjVALq+kTg4RyRIAM9ENaowijSJjRokINN+oU9BG2Se9tqS2jQvRJqU9bfwcyl X-Received: by 2002:a92:cdad:0:b0:363:80ff:6dd0 with SMTP id g13-20020a92cdad000000b0036380ff6dd0mr153336ild.30.1706730090827; Wed, 31 Jan 2024 11:41:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706730090; cv=pass; d=google.com; s=arc-20160816; b=YwTZZKAD3IJZfoN7Ez2hcXJ3EbHGUQB5v4nw1TQjH0oDERsvO8Gib5/uWmTLtJJSDM EFepRE2XFXGftpzGE7XDE92RuTqe3W6do6s8nbhISyKb1FC48GiF0SoiKaWgleeCEfnj WjC4zDm9l2rxCgGM5KIMLwdZtop32eoIzuR7yJIMLByH2gSQWV/0q4RnBxLJdPIc6y1m GMkXHzks6acQ9rjbByGMLyP8XhRwvDAtMwJisByrVoDJCLKzkvvt8fIkyYOVNw4+Av2y X5u1Dii928KSJer6DFKro75BBKJC8BU7+3sRuDX1WeZY8BxEOPOUSIntjN9HrSRrXGfy wBdA== 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=9Y68LgBRQij8he0Kr+gpbkEx5OCno/fS8uOwaqb+6rc=; fh=FT/0Vo7sI1/mdW7jwhnYRK0l0gCgsK6Gg9pwK0Ofi5s=; b=MGeAF8cNTca5j8CcjYRudeoDT+unR+QeyklR6Yd6NezOyNycE0j6ZM33fBn1o6UjEL /ypW5FLs5q7qOLWLeLiCQMZ57/FY1enlXjG6tSDCSiaeFxVHnFHBSd0l8S5vilmkmNrQ jq3rhsrmNDwGCsWI51qQ9goHCLgcR5A952c+aqOkPOMQ+/u5KerOoahlfO3FSeo9dgV1 BkbqfNqZ3ie5bc9lVyKKAMTpLFmoazsVmmZWQyhGlk7wDnzmKjYG2Sb8vHVN4an6flDG hlNS3bJGl+NcjbO3JEQws1EgL2U99mX/Q2mOEeDaKdy5r0VlKOdYGM0a8fF3D+/5ZNjg +Gaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rq/Ybn5r"; 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-47021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47021-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; AJvYcCUZrmZyWVk3gulSgve+4ibbEPaif6mg28ysV2s+3DvR9TFRrg2rCNkWbEx/SBqP87YoCgO9UIgbaVc6pBdyp34JtrVq6cG4SQVX4c0dQw== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s28-20020a63525c000000b005d3fa779f4esi7976570pgl.344.2024.01.31.11.41.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 11:41:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rq/Ybn5r"; 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-47021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47021-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D6834B26565 for ; Wed, 31 Jan 2024 19:36:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E639D3EA74; Wed, 31 Jan 2024 19:36:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rq/Ybn5r" Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (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 8B1F237143 for ; Wed, 31 Jan 2024 19:36:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706729778; cv=none; b=WxDYc0NM7J8p7rENueefx9MoV41b8L+r85zdojT6ciZ9QmhZ7tJ+C2OJbu19d3iiSthJkhGb/zCri8YrqMKXFj5fIhNCBFFGOaw56pDubtGsD2T4EIf1nbaFQYDZP5W3C7tHkrl6hsJX1OeHh/lw+5CBDGgpIj2I4G1L67w4hkQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706729778; c=relaxed/simple; bh=9Y68LgBRQij8he0Kr+gpbkEx5OCno/fS8uOwaqb+6rc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=OfyS/QXe0K8lLyKRjfgXqAaqv0enTwLmbS7c1V3Y3GZ0DrXQw0Aa20bYgRfYt6f9FEXlTZe/p8RX2Jj9FFra+6hBRknsoJw20zKEV5TLHR+iUaiaUunvU16gKWz9rvnyegyNv/t+yTC3oCGz6r5tQ2kFLxUms48XRGuECNRuoEs= 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=rq/Ybn5r; arc=none smtp.client-ip=209.85.219.181 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-yb1-f181.google.com with SMTP id 3f1490d57ef6-dc256e97e0aso76317276.2 for ; Wed, 31 Jan 2024 11:36:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706729775; x=1707334575; 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=9Y68LgBRQij8he0Kr+gpbkEx5OCno/fS8uOwaqb+6rc=; b=rq/Ybn5rpOzVhhw4w6sfxFOFqIIrU8jqTDC2rV8/4z1mx8EaH4r8HAfN/ceKTUB305 zK3H9iInHcK6tpTMj2WOjV5AkG1XHdZZO2m0B90SklleFFTuLdnSqGy5srkprh9IaKH6 +yw4EdsAxO81ocU3tvtr1PfjYGicev31zVntw+9a4bFut95ziTXA2R69X4EI69mDL/Vp x1O0GvMGhOGWKFZmyTTdajtdQyhMbfwArAErRLEwMoT0l3QORmjfbgnI6BwmWDIiuYzx 6E1vPdfZAQSZ3UtRILpuRGVwVJ/o5KbUWzMvN3j3Jeh6gfVw37Cn9KcpOBUxNvbHCKrr dvhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706729775; x=1707334575; 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=9Y68LgBRQij8he0Kr+gpbkEx5OCno/fS8uOwaqb+6rc=; b=krht4So5Ll6ghnQwBNkLW2YqAP0x8h2c6TawaTjFuYxPuGBce4dJPvfxX/IsA3MT0r s6qS8ia43y87Cski7yGjgMWPrt/NfWhao3R8xbdAxcayJUp2bK6M7ED8/8/OTw8ceVNV FspDLTxPZ/h3ahJ78SW7bgvAoxMtUZQdwj2jEY3a5lTjIAOJM5aZODmiZgfLYqh2vaaz hAtE4R1/UePSYwlNzXRhXcz1QizfaJTm6e+QUYCtMBn9BuH6pi37oUC0g8GqlrDB+Gmp DGD3+DGAdqH+1rBGcup+YxhhAo6w0jPA61SvJuyQk3Z6u5S90kVaVjJo+2TSVIRqHmA0 7KTQ== X-Gm-Message-State: AOJu0Yzue0SiiBMwL+f10c2YDNyKVzaOsyDUT664Er511cNQX8igbRH0 UtFWjv78NW3KD4W8+htPkcAyAZonLwzLQRGzS7EaJVEUMdQtvZ6DWgb09lyGR783bse5RJ6kwuZ tpMgQJW9I6aQ1Lf5ocIJbUWcOeOYZog82+jYiuQ== X-Received: by 2002:a25:c50b:0:b0:dc6:4a88:bd2e with SMTP id v11-20020a25c50b000000b00dc64a88bd2emr65585ybe.45.1706729773921; Wed, 31 Jan 2024 11:36:13 -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-5-brgl@bgdev.pl> In-Reply-To: <20240130124828.14678-5-brgl@bgdev.pl> From: Linus Walleij Date: Wed, 31 Jan 2024 20:36:02 +0100 Message-ID: Subject: Re: [PATCH 04/22] gpio: provide and use gpiod_get_label() 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 > > We will soon serialize access to the descriptor label using SRCU. The > write-side of the protection will require calling synchronize_srcu() > which must not be called from atomic context. We have two irq helpers: > gpiochip_lock_as_irq() and gpiochip_unlock_as_irq() that set the label > if the GPIO is not requested but is being used as interrupt. They are > called with a spinlock held from the interrupt subsystem. > > They must not do it if we are to use SRCU so instead let's move the > special corner case to a dedicated getter. > > First: let's implement and use the getter where it's applicable. > > Signed-off-by: Bartosz Golaszewski After seeing the clever trick in the next patch I realized why you do this. Reviewed-by: Linus Walleij Yours, Linus Walleij