Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp61650rdb; Wed, 14 Feb 2024 12:44:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUen4vHaxLSK0F1vBR5YTv7oJYSTTia/TmgTZezghcdAsFGutFNCjaQUqYsTXCrzgeazFBplWi0qSFQQLbBIKcSoC8B7njC5SaXuc2k3g== X-Google-Smtp-Source: AGHT+IFg9qE+e4qu7Ha723Lmler1HC9utkdHT3vqoxK4Bw52y+Bj1p4cCWpEoyQkTgonzm7iBGOu X-Received: by 2002:a81:91ce:0:b0:604:9c75:626f with SMTP id i197-20020a8191ce000000b006049c75626fmr3910875ywg.46.1707943458739; Wed, 14 Feb 2024 12:44:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707943458; cv=pass; d=google.com; s=arc-20160816; b=w8jXxCyvKIyy2tafsmFLnqhpoKu5SCG5z0Ly1guPEQ/Nws71+c514ir4JCJkgPY1ht G71SMfz5rEgiF4qtI1cCJeVjvWprzOWPZ601uuj4LYi9Ih+ESiQeyN71ItsyTopMHhEO nAlXK2n17YLQKTX7g1IWAQozpjqa5f+3HBXKRtbTIPzSV99dQzDnoq+vJ0ZnqItQUFZc M96qMd7lBvuJtRtXKEr+mGJVkQ1WCiHJhrk+Wpb44LwTihh6Qd4UjYYyUkbXxgLCKhzk yJGH7cDDyLuY2M8TfThIWr8WifePSparOvftwxA5abRlme1OHBIKYdPb0oxE7+qA7tOt 4gHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2kbQDX8o/mjCjevpV/c1e43dkNbsoH975iD2w0zDCCs=; fh=s9DFrjzQ5mdNYjISEVBZ7UbXteJXjFRmeYR4kLNH/mM=; b=PdKPjRfCUStusBKK4nj2vcdYEtwHekZMZA8jaQiZSZFRnyfnkuMO7myi9ee1kszc/y UB+IkQTtzRULAmS+3sV44N0/UjJhdBkS2ifmDbWuF6MLz0ouW5RfECp4M3XO3vRMgHf9 4wi3LVKniG4HgnAaXnOBxniOdSoBq6yvQCKQQ1jze29dLpNduai1eTAi80tbdkHOOO6H NyiqqG5PN4GqTDPkbCg4SFRG5mzAdHKbippVi+QxmPsbjRhgBVaRQHlv4VUkt/TAk0y1 VDUUnbWS/C7USyB/+ArxX2etES7zE4OphEWBLUnYyue47Q9Hc6l5vd/lvOB0+OSz8s+c zhqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P8SWL0AM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-65945-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65945-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUpCrO2q989kKGFWBpSFUJ6zvxhn+tXpSGi0kMNnxOP5a/C/LcvkZz6i4D0922Z8kSCseJ+DCRbrcOrNazAhOpoRoH9YssBcmyIzNV3gw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dz9-20020a05620a2b8900b00785c9abe3a3si11903292qkb.478.2024.02.14.12.44.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 12:44:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65945-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P8SWL0AM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-65945-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65945-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1516E1C2166D for ; Wed, 14 Feb 2024 20:44:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 373B1128831; Wed, 14 Feb 2024 20:44:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P8SWL0AM" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5E51455E45; Wed, 14 Feb 2024 20:44:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707943450; cv=none; b=PZm5V0NCpwuC62/rwuak1Tik5Do7o4zNY8K/GVypZQwXfUyjUcj6IqQTMylvZNLISsOlSVNMERubWkQatGkm+aLq2NgUDjybjbC8N3wOnqxySz2Cc37BBEVydn0/PZUJRlBLwdX94r850RlvHMJqbV3N+Ccs6K6a4UKUniWSOrg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707943450; c=relaxed/simple; bh=+z4R9GOfdgSWa79X71iBygTDc7cRtojjnHQFNVDBR/M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uwVuJUojSpwUCKRIIT6NVnqSHsHp5VRSxP6Bjg9qnxma5c7amGpXkFMvAvjd7rbavJKTZn9KPz319mPzXuRKNqMQ7HYmlN5YssWH1LcnWh9SDvbKFnoZIf2+46Qqk7clRobob2FLHH3eZrFzQVKq8e/XBCRSWUwzruYF04mywEo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P8SWL0AM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4E46C433F1; Wed, 14 Feb 2024 20:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707943450; bh=+z4R9GOfdgSWa79X71iBygTDc7cRtojjnHQFNVDBR/M=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=P8SWL0AMOgR0ZgwjSRfc8Nph5lcySi3a9sk80iyN7XMdEzpFEsBjNR+oKNOgse79k ZdpkTyXpsBmnNCBc5EkQtd0fgQ7Rndbv3/e0V/9zrv1+HkhcGauFMzv+XD5rJPCmA2 LMcDr0e2DJo5yijZPg7g4j4YfkUL4Kqd9YLsnL4vIg6Nxxv0SRIE4FHYpgG5Z7KChW LP8yI/gmnfsfTR2zniFcxaL6BmO3WKJzE0+AJ9iszMpD2sv3zHm48Ap6Q43PD/9P9E cvART3OM+TdZYtB8kEZqhOpjetVem5BrEkiWCpGQOvfYeVLeCIpn2YUedMJwH/weWi TgZ0Z56Huf6hQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 86886CE0D11; Wed, 14 Feb 2024 12:44:09 -0800 (PST) Date: Wed, 14 Feb 2024 12:44:09 -0800 From: "Paul E. McKenney" To: Bartosz Golaszewski Cc: Linus Walleij , Kent Gibson , Alex Elder , Geert Uytterhoeven , Andy Shevchenko , Wolfram Sang , Mark Brown , Dan Carpenter , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v2 0/4] gpio: fix SRCU bugs Message-ID: Reply-To: paulmck@kernel.org References: <20240214084419.6194-1-brgl@bgdev.pl> <4a08c610-c249-4b56-b09c-09e1fd07f723@paulmck-laptop> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Feb 14, 2024 at 08:08:33PM +0100, Bartosz Golaszewski wrote: > On Wed, Feb 14, 2024 at 7:44 PM Paul E. McKenney wrote: > > > > On Wed, Feb 14, 2024 at 09:44:15AM +0100, Bartosz Golaszewski wrote: > > > From: Bartosz Golaszewski > > > > > > Here are four fixes to some bugs in recent SRCU changes. The first one fixes > > > an actual race condition. The other three just make lockdep happy. > > > > For 1/4-3/4: > > > > Acked-by: Paul E. McKenney > > > > For 4/4, you are playing with fire, but I will assume that you know what > > you are doing. ;-) > > Up until this rework, this gdev->chip pointer could go from under any > user at any point. Now we have this gpio_device wrapper that provides > an entry point to using the chip safely while protected by the SRCU > read lock. Anyone who is still accessing gpio_chip directly (and not > being the GPIO provider themselves) is asking for trouble. There's > however no point in spamming lockdep splats in this case. I may end up > adding a warning to these routines. > > Unfortunately, it's hard to fix 15 years of technical debt. :( Indeed, life is sometimes hard! Thanx, Paul > Thanks for the Acks. > Bartosz > > [snip]