Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1390091rdb; Wed, 20 Sep 2023 07:57:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcUJDXa2DyAK41lt0UqT7pWNCii4cBeQ3dyA1rRRYV2k7EevokwH1s4U74n9Ry2xmuY/XZ X-Received: by 2002:aa7:930c:0:b0:68e:369b:a123 with SMTP id cz12-20020aa7930c000000b0068e369ba123mr2877734pfb.1.1695221843032; Wed, 20 Sep 2023 07:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695221843; cv=none; d=google.com; s=arc-20160816; b=xXWQTPAiBWh8WmTlSEZXuQ2vuYC6UZFTGelNslmCMdrchCRJK53rZ4+BbxvgMpW5zz qsESo33maDtpca9qV1oUUB5S0IMToGPx8mlGe4Ru+ivfYKEhVZmMhdMT3wG6VSiKaFNb mWrfBEHa7rIQVU6Lb1G4KQIxT3QSpgaB5LgQy9iE9OMe/LF0x4KRxuOnH+/R370KAcRO jNfuTugK8uJVV9BlgIcHQfCjx2kjxvklhkH10MC+b+KsLlkbof59VlcZOhPADnbdQOXt 94gkA5MmdmGv/gNA/ZryHIUodoq3NSIXVVtuBtrEFjpHEiJAfhC0Sx4OatI9rgfZF1jm YwTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:references:mime-version:in-reply-to:from :dkim-signature; bh=NnQhFZ0YHcf11/hXVMOAl/6rPiXEQ3EoWGpvXe1OYp8=; fh=TliOclcX+iASwraFXA368rKc0I+PbUzoNOcoodApUHY=; b=hzxulF0P8tH5gekUZzEy7sY082gI6ckM6/95nvsP7Z872WUYuD6G4/yU77xAFkJVK6 cxwV6Z/8iI3oG+0hiTs4aQuFqa7xTtVLYGwWy/TrP7BGMHNc8CmVJZ9kQ3cXTUVZ8Qag p9MMbiAoRG5XCLina++M6MuCha9+xVM3xvLihWfE2o3Z4Jow4E3YT1/ds9Go2N8HrKG5 w4cHaQo/kNrtthmZkSkZRVJNmbjCW8ArGf0rAqB7CMVK3CoTavIY+1GjgDd54HHO0L30 n290nmbD4cy8BLw+PSgD78VjTLzv1N5FOOcXoFnycWux9Yf53tnJOJLBq9g9fI6ccdyt lolA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=XJhSV3ix; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id eb11-20020a056a004c8b00b00665c24182bcsi1701301pfb.219.2023.09.20.07.57.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 07:57:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=XJhSV3ix; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CACA881AC699; Wed, 20 Sep 2023 05:52:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235571AbjITMwG (ORCPT + 99 others); Wed, 20 Sep 2023 08:52:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235913AbjITMwE (ORCPT ); Wed, 20 Sep 2023 08:52:04 -0400 Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9782FE0 for ; Wed, 20 Sep 2023 05:51:57 -0700 (PDT) Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-45290cda80aso684753137.1 for ; Wed, 20 Sep 2023 05:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1695214316; x=1695819116; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:references :mime-version:in-reply-to:from:from:to:cc:subject:date:message-id :reply-to; bh=NnQhFZ0YHcf11/hXVMOAl/6rPiXEQ3EoWGpvXe1OYp8=; b=XJhSV3ix5WGa2tGIXkEfMYOFoqYWnIGYwKpZzXqI6MP82Yvsjyod6DFaV/xZfwBg9H 53nFpaGjIj0WIn0gtSe9/HnJpDd0uF5WsT7M5wDhkR3Bjx2eDkgccnDfBKIu0+wunq18 gQ8SMP+38l+GK8mE1wVDT3xGmZfkHgBckIGbBhJXVWSGwhkzmeL0g2wrLEeCOa4wsk7E 0L7OeCnAzXiQXBAQkyMCoqUaUsQW9vAWqlzEA5PBvgPW6m/B+NGmzQyXW0VO5szk4wf5 o0e7HLNvK6mJgqtHocsPrI0Sos2gEB6n3TyJzro14pJJA9WloESegKnMkUKBO6HRLV1f XKLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695214316; x=1695819116; h=content-transfer-encoding:cc:to:subject:message-id:date:references :mime-version:in-reply-to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=NnQhFZ0YHcf11/hXVMOAl/6rPiXEQ3EoWGpvXe1OYp8=; b=Tdt4OWFEIIlMaCyvJXCGvk1RR6DEF+tSQ2/ESTNPGwKOGHxDv0+Ezz5NTk5AT2rxQT XQrha+jThWm6O8CYvWi/A3z+1JaVgpSbWFkFxb1NGLa301WVoNo9GotIZLRA+lw3dl9X iFDGAC5CQuxd0U3xuHKnch4lvyYpN9D/RgY3HvD0PUtyox3WAqVIel37xNx1Mo0KRG/+ xCexYNDT3XcGyn4SCPCG3HvlvJiHslTqc6H+xmkwDqJo04zi+aOxGCDy76RC3yma170F gyNdyFQBpkP/0a31R8cpvfDmVNGttxMRa6Vo8A+9hn49Utg9dFaXJwyOwNUsigdiXOSH K7WQ== X-Gm-Message-State: AOJu0Yxwuam+B80oXGWpBHSE2JFk8OfOi2EirZHBA9Ddvq9vDsxOc92I Hzgat2nHArFuFlcyRamq91Wah5jDel6A1bEHBEOpXA== X-Received: by 2002:a05:6102:34d5:b0:44d:3d29:4940 with SMTP id a21-20020a05610234d500b0044d3d294940mr1520097vst.35.1695214316607; Wed, 20 Sep 2023 05:51:56 -0700 (PDT) Received: from 969154062570 named unknown by gmailapi.google.com with HTTPREST; Wed, 20 Sep 2023 05:51:56 -0700 From: Bartosz Golaszewski In-Reply-To: MIME-Version: 1.0 References: <20230920085639.152441-1-brgl@bgdev.pl> Date: Wed, 20 Sep 2023 05:51:56 -0700 Message-ID: Subject: Re: [PATCH] gpiolib: extend the critical sections of lookup tables To: Linus Walleij Cc: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 20 Sep 2023 05:52:06 -0700 (PDT) On Wed, 20 Sep 2023 12:58:58 +0200, Linus Walleij said: > On Wed, Sep 20, 2023 at 11:33=E2=80=AFAM Bartosz Golaszewski wrote: >> On Wed, 20 Sep 2023 11:12:58 +0200, Linus Walleij >> said: >> > On Wed, Sep 20, 2023 at 10:56=E2=80=AFAM Bartosz Golaszewski wrote: > >> > Can we rename this function gpiod_find_lookup_table_locked() >> > as per precedents in the kernel, to indicate that it needs to be >> > called with a lock held? >> > >> >> I think you mean gpiod_find_lookup_table_unlocked() as with this change = it >> will no longer take the lock? > > I think the pattern is the one I indicated: *_locked() means the function > is to be called with the appropriate lock held, cf > arch/arm64/kvm/hyp/nvhe/mm.c > > pkvm_create_mappings() takes a lock and then calls > pkvm_create_mappings_locked() which even asserts that > the lock is held. > Ha! I always though the pattern is to call the functions that *DON'T* take the lock _unlocked(). This is what I used in gpiolib-cdev.c or gpio-sim.c. I guess both conventions make sense in some way. Bart