Message ID | 20240202-fix-device-links-overlays-v1-0-f9fd1404c8e2@analog.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-49822-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp387754dyc; Fri, 2 Feb 2024 04:23:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdZwy3q3EOOw4mWRvCzZ8Ymj6Xy16xxsGJeUXPHi2ytzKCv1atezJxkBNMJMMImQ3Zwpa6 X-Received: by 2002:a05:6a21:3a84:b0:19e:3c4e:d097 with SMTP id zv4-20020a056a213a8400b0019e3c4ed097mr6509930pzb.31.1706876626212; Fri, 02 Feb 2024 04:23:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706876626; cv=pass; d=google.com; s=arc-20160816; b=KwoB2uDu2kI9/4Fy8p8i5YkaU1EXJ3IfsoF4x5k/sGRZJObEBENUGmhIPoM+Ng1Jzg ol4Ad3xREhWR2AyDAT8leGXbTI8qbjyVFl0hpTp4eqz/Oj1zLq2Fpq8F7K0R17mJ1WH9 YgZAZZnv0HSaJwxgcGT73QiPFD5MmLxrpStYiUoNZtTZ7CMjZpic2uoS25QUV1Oad8B9 rh0X/G+j0al2mtmdzK8XssejStn73ssxV53jcmjE6SGhNwWYszMDlL9RJqbUl4c7CIzS uw0zFuD+Pjs0ASUePPP85DMntH7v0jmTv/BffWf2bpLjy98GlFztIibsIyCE8kDInn4A yF+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:from:dkim-signature; bh=4I3Vr49CvF9S7eLpLdc8/biM1oFnNZCLDcyoVT0Jqgc=; fh=uSJIBbUwTCfHPcij4sxXvK57dbgqWvhmKkWy5lED+zA=; b=eQxHcP9BfMcRnXhZ/2a/KummBKsdnJ617WVhhVwxMdK5Nqcp7MP+8oFZ4pwiyDxZvJ 5BJgbV1rmhDiHOFCDH6VM1JGxvQ3T8nm3OhWM5aVJMa8eHrpnVJnjbYZi9nQ+J6Wpa7X oF6UTO1foc6som62P85gvypPMIEm+g22jD8pJKDCHDyzeCiKhJrstNkVsFmE2/l+SIc1 d+HzrRVdAXrAoURFGZpbE7NA9+UA4Jv1b8JYBlsuCtP0fpmrbTJ+9sWJTu4xZeAdGslt 20UppsHzRDzCYCLRMNl6sslwLomCb0NR/9SgLFZrtCEnJprzEifGP0pWLY8FGo0dKAt8 5Kkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sz7xU9rj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49822-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49822-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXeDrCW5Vi4n1ATRYq/Fd07GtkGfzso4gc3apehmqmtX2Skk7PsiOfNijIn+w4Z14oo1hUriOqJMUs0ZCG3eNC9zgEoGA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 5-20020a630c45000000b005cdc2cc9a15si1508115pgm.742.2024.02.02.04.23.46 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 04:23:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49822-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sz7xU9rj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49822-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49822-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CA60928BBBF for <ouuuleilei@gmail.com>; Fri, 2 Feb 2024 12:19:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC8531420B6; Fri, 2 Feb 2024 12:18:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Sz7xU9rj" 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 33DDB13F01B; Fri, 2 Feb 2024 12:18:22 +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=1706876302; cv=none; b=S7hEAf5v1bYA3gmzAOHm0jkU0bTaVW1CMTcvAh0P7Oh1Aqd+4gipg/eXlqBLgelG+UzFpzr2Bn/Ym7rXvtUMJmp3sgNKA/XtjLJmmpwIzIhjCRddzMnMxCfc2z6DqjlImYWCk4gw3gpo0FNdd/p9dOKfoBQt4/O6cUT6ayQTTbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706876302; c=relaxed/simple; bh=qaZRRanp9ZLnLiYxNViu6c8e7LEdLYpVq+TyVdfsOAc=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=XQSm6yiLTM9kuXE/nDqxVQutbdGtDPOauQS9HMK3vSiD2o7KLBbt5RoiV8pyKHMWeyNIcrZDh7j44IlPQ6h2J7wkN2Z+BHZKU3k4adtYmTk0NxrWLbVL2oHXQoSrIvBYocKHmTDJurlck5wVdzepngHBR+ThGFTdSjuijruc/rQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Sz7xU9rj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id D27E4C433C7; Fri, 2 Feb 2024 12:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706876301; bh=qaZRRanp9ZLnLiYxNViu6c8e7LEdLYpVq+TyVdfsOAc=; h=From:Subject:Date:To:Cc:Reply-To:From; b=Sz7xU9rjroP6ZEAh5LrlNan9JvTaMDY6mest18yANrItXNekEwbgjA1X0AxzKNX3R k5xxG9KiXrBu3JXTlHqC5+aaa7gxPXbcU47z3CgG/2Ie4j6O8uZ3+QkRUJUCCwwSQF ygRgvk2RSbo0K8CyutQq+S+Zm9K12n/2b8MUBzgW4wuJVlJUsqdKCjG/+qqc68xWtz nmFkU76t0vBZLE0TTXeyM3t873a4nIyw4FdxowlRIFmuzN5+n2n536Exww3HPyavUd 5B12/sbY/0T2kg2PnOZf7ojXtpLGcC6nL7pmloj+Gb2ogSpS7bEzd4wHGVuSkNhWn/ qjiICRquqolcA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C176CC4828E; Fri, 2 Feb 2024 12:18:21 +0000 (UTC) From: Nuno Sa via B4 Relay <devnull+nuno.sa.analog.com@kernel.org> Subject: [PATCH 0/2] fix DT overlays when device links are released Date: Fri, 02 Feb 2024 13:18:15 +0100 Message-Id: <20240202-fix-device-links-overlays-v1-0-f9fd1404c8e2@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAIfdvGUC/42NQQ6CMBBFr0Jm7Zi2IAmuvIdhMZQBJmJrWtNIS O9u5QQu38//7+8QOQhHuFY7BE4SxbsC+lSBXcjNjDIWBqNMo7SpcZIPjqVoGVdxj4g+cVhpi3h pjGFV16S6Acr+FbiUD/e9L7xIfPuwHVdJ/9J/rEmjxo6bqSVLNLT2Ro5WP5+tf0Kfc/4CNYu1E cMAAAA= To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Frank Rowand <frowand.list@gmail.com>, Rob Herring <robh+dt@kernel.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Daniel Scally <djrscally@gmail.com>, Heikki Krogerus <heikki.krogerus@linux.intel.com>, Sakari Ailus <sakari.ailus@linux.intel.com>, Len Brown <lenb@kernel.org> Cc: linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706876300; l=1394; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=qaZRRanp9ZLnLiYxNViu6c8e7LEdLYpVq+TyVdfsOAc=; b=lX31h/u07E3I6PjCqxD/6Q1IoZFzkQvco9yw5skg5t6FgawTdPYE3Bogp/xhHn/ZUmz2IzLRS WyTeA9lP/pfAxNLs/sQJKmuG7cI2P5gfIxzD0gA2Lw1SdjpUjE0XLwO X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: Nuno Sa <nuno.sa@analog.com> Reply-To: <nuno.sa@analog.com> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789789864937147701 X-GMAIL-MSGID: 1789789864937147701 |
Series |
fix DT overlays when device links are released
|
|
Message
Nuno Sa via B4 Relay
Feb. 2, 2024, 12:18 p.m. UTC
Link to RFC: * https://lore.kernel.org/lkml/20240123-fix-device-links-overlays-v1-1-9e4f6acaab6c@analog.com/ Changes since RFC: * Use a dedicated workqueue to remove devlinks; * Flush the devlink workqueue before checking the of_node refcount value. The following series is the result of the discussion I had with Rafael. To sum up the fundamental issue, device links drop their refcounts asynchronously and that means that the of_node refcount associated with the device will also be dropped asynchronously. Now, in __of_changeset_entry_destroy(), the assumption is that the node refcount must be 1 and that cannot be guaranteed given the above. I'm pasting again the link of the first time I exposed the issue where one can see the resulps (big splat) of failing DT assumption: https://lore.kernel.org/linux-devicetree/20230511151047.1779841-1-nuno.sa@analog.com/ --- Nuno Sa (2): driver: core: add dedicated workqueue for devlink removal of: dynamic: flush devlinks workqueue before destroying the changeset drivers/base/core.c | 33 +++++++++++++++++++++++++++++---- drivers/of/dynamic.c | 8 ++++++++ include/linux/fwnode.h | 1 + 3 files changed, 38 insertions(+), 4 deletions(-) --- base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d change-id: 20240123-fix-device-links-overlays-5422e033a09b -- Thanks! - Nuno Sá