From mboxrd@z Thu Jan 1 00:00:00 1970 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 176DA346E63; Thu, 26 Mar 2026 21:03: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=1774558991; cv=none; b=AGrv5rwy69ZCxe0ocg/aMu8YX+EgIh5k7FGi1LMOpytl7OAnhHzvtycrciYQWXSmTqgQBpCDTL3wKeY27PfaWy4iXvBdr1mI3N1jPZrndAOS5EMbC9iC0uUVAenJh7+NHgjhdLRN/TtDDNAmxjhutK3OimS8w3YyzPUHVFQuT9I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774558991; c=relaxed/simple; bh=Oga/OddxY2WJCZhkLe7zcVGjS6Fu4I4k5/6EH62Urbk=; h=Mime-Version:Content-Type:Date:Message-Id:To:From:Subject:Cc: References:In-Reply-To; b=szeZkdJJEMaEKEac4/jeT1SsUEMRT55nf43o96zp0tzF4C0WskdEWf4Do1YrS0zir83x9XuewaUh6xPvnopAOvBxU18C/h+q6XCVThmbSeWtLBo55oJbX0nW8TKedAgWHjzOkk+wMsNUfkZyGPeEplpJHZwCwuG4U0d8EHEpmf0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gPAAIB3f; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gPAAIB3f" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9306BC116C6; Thu, 26 Mar 2026 21:03:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774558990; bh=Oga/OddxY2WJCZhkLe7zcVGjS6Fu4I4k5/6EH62Urbk=; h=Date:To:From:Subject:Cc:References:In-Reply-To:From; b=gPAAIB3fsENGAvoB1ls1d+lyJstfElum/pLWj2DuNK2WleRkSJpZzbuOcSRguNRex LE7yjFpGJeYqgeiTWSX6kkVoDPXfYgQsoiYvVNcYBuRy7Weff6IyhdJ7LJejW3y2q7 Lu58LJqd2qR99uWpkNGFPfJeYhdGTH7gmxUd9PImDf3hgeIKuz12xa1bfI6GtosZ25 zz/3VILPimPfvECimlah9QRnSQlerX84zqBcJ1XtWuuz4pCn2J3IQkAwYpmSsY+R6p Vq0PeeQgRdA6sV45AaVZZ3KVJItFvjXCg6L1WvlZQDmeunZRkvtTNmqHb/caoBZYIw rdfYLFPYbjpsg== Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 26 Mar 2026 22:03:02 +0100 Message-Id: To: "Douglas Anderson" From: "Danilo Krummrich" Subject: Re: [PATCH v2] device property: Make modifications of fwnode "flags" thread safe Cc: "Greg Kroah-Hartman" , "Rafael J . Wysocki" , , "Andy Shevchenko" , "Mark Brown" , "Wolfram Sang" , "Andrew Lunn" , "Daniel Scally" , "David S. Miller" , "Eric Dumazet" , "Fabio Estevam" , "Frank Li" , "Heikki Krogerus" , "Heiner Kallweit" , "Jakub Kicinski" , "Len Brown" , "Paolo Abeni" , "Pengutronix Kernel Team" , "Rob Herring" , "Russell King" , "Sakari Ailus" , "Saravana Kannan" , "Sascha Hauer" , , , , , , , , , References: <20260317090112.v2.1.I0a4d03104ecd5103df3d76f66c8d21b1d15a2e38@changeid> In-Reply-To: <20260317090112.v2.1.I0a4d03104ecd5103df3d76f66c8d21b1d15a2e38@changeid> On Tue Mar 17, 2026 at 5:01 PM CET, Douglas Anderson wrote: > In various places in the kernel, we modify the fwnode "flags" member > by doing either: > fwnode->flags |=3D SOME_FLAG; > fwnode->flags &=3D ~SOME_FLAG; > > This type of modification is not thread-safe. If two threads are both > mucking with the flags at the same time then one can clobber the > other. > > While flags are often modified while under the "fwnode_link_lock", > this is not universally true. > > Create some accessor functions for setting, clearing, and testing the > FWNODE flags and move all users to these accessor functions. New > accessor functions use set_bit() and clear_bit(), which are > thread-safe. > > Cc: stable@vger.kernel.org > Fixes: c2c724c868c4 ("driver core: Add fw_devlink_parse_fwtree()") > Reviewed-by: Andy Shevchenko > Acked-by: Mark Brown > Reviewed-by: Wolfram Sang > Signed-off-by: Douglas Anderson [ Fix fwnode_clear_flag() argument alignment, restore dropped blank line in fwnode_dev_initialized(), and remove unnecessary parentheses around fwnode_test_flag() calls. - Danilo ] Applied to driver-core-testing, thanks!