Message ID | 20230213185702.395776-7-frowand.list@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2515986wrn; Mon, 13 Feb 2023 10:59:48 -0800 (PST) X-Google-Smtp-Source: AK7set+/iYeQw1Wss5UpxiAsBzKT9vT0nQ3bWhmKBiOE+f6Kee6eptEu3OqDW3R9ZSsqoW56sVCL X-Received: by 2002:a62:1e85:0:b0:5a8:4ba7:583c with SMTP id e127-20020a621e85000000b005a84ba7583cmr14800316pfe.25.1676314788390; Mon, 13 Feb 2023 10:59:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676314788; cv=none; d=google.com; s=arc-20160816; b=XN4qJNUvlYwCrba3axa3Di5Nt7BLbPpDKE4Y+B2vFb4r6wjw1XQoCbf1umsdOqB2j7 bmEhUEzM8VdpeiUGhNM3SZ+pg0BDRdnzPmyDHV1AHWzbh4r7L1SFrNOZf999/vbNqfUr 05t/U7o79LVUICMqao4l2Ua0a8Jc7fAsnjT52n7/KV25jHJCm52YC4h6/WPrBuOTMMrF KTpQey3xKqzOud9/FG2uXccH9WX9yKfuGsHHR3Ss2AZbzmiDDYOaDlavzPngMau71sWu h+MonmldJuop5m3dCwo5lkE7bt4pRtIOiR8rew34VjCNKdOy+s4ORC3B/BHO987GPTnD 6u0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=70NV1ToQYw50ymKhliFnw04sCbSTdpnLCftKunJ8RHg=; b=gxb76/QPhUsJ2t93GLjycS0FVqYpV2nChn3AyBoePfjJr2ny94NsW/Z88q66o6zKUI xwQurvePN3kCBuG+MaX95OfnAR6zZ6scnq9S9gpALDSd/uxfOgaiazPOlBVL8ySTbKfl sX8EIeQD9tvlCDUwDVWczPArCaGnUfGmvKd2F/GMsuBISqyG1wSiKmHH8Mnsh/vBoz6f Kvm2xx/tQErY5XROf0yY39dE4l5bn4qgw7gI7SpW5EiMDPen4Qgk3aA444u6H+NwFceV cGyc0V8R4ZdBBf5OiFqn74BE3cE7EHu06bxerTlZaXP9Mm0NklbkhaJ6GBVcy+O6rhFR uBEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=g9sh5Qac; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020aa796cf000000b00593ea1c4e6bsi5625728pfq.88.2023.02.13.10.59.35; Mon, 13 Feb 2023 10:59:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=g9sh5Qac; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230372AbjBMS6I (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Mon, 13 Feb 2023 13:58:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230315AbjBMS5v (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Feb 2023 13:57:51 -0500 Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97482212F; Mon, 13 Feb 2023 10:57:48 -0800 (PST) Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-16a7f5b6882so16261904fac.10; Mon, 13 Feb 2023 10:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=70NV1ToQYw50ymKhliFnw04sCbSTdpnLCftKunJ8RHg=; b=g9sh5Qacww+llc+gZ856ZATND/GgMxZmJwDrrtBnaKgEjkHC9HhL54iHcxadntNZe4 GRl3VCNHl6m76J0dEebp8wkYjxq796dfRE1az472jTwiWwcTUY4buwcCj59n1ZADxf+y sD+qVetPtACRyLrtREXLIhnjO7Gzk9Rj1ikXBkJL3KKhhoTsvjJIBZYcPqAasR/IJAyP 5mA3P7Eiv4/c8Ty1/S9VKNG/i9nR+9zMfnPyqgGcKqu9cugjiItlBaBVKDQ6xUYwisVK 8tou11iSWFraZ1qBqqshAHKBu0RrdFVSbESIIuDSCWumnjWUuajZz5ZXiVQwQQjVEO9Y GD+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=70NV1ToQYw50ymKhliFnw04sCbSTdpnLCftKunJ8RHg=; b=UEX4beqUh/ySTAoGzvytlBfO/za9kg0fsjApiox0RbOf5ckMCPBblU8g5ReqfgPMIR FFM9BbYq5TlVP/k6U2nGkWwkHolvoM+pG4hpL306dNoH93F6lS6aRI+orsvDWSFmljhY ZexHPyfa+ydsU48vJVOrxQ6sVIBdNi8yLewv0QD5P5EUoShS6ZXpld1ZGMOwlZryG5CZ TNL6rERpenGAW0AlqvjkpIp6l4VdIGs/xRq3+fNXlxFmXJetQRUv4ik1Q42/xlPYfmRZ 3zOQVpR+58oPaFSvGYH3HU0K+fuF7eDzjF2rZ8QoW12jJS6sGPjoKvx7JiLcKNw8IU2o AA3w== X-Gm-Message-State: AO0yUKXNJHIg6tMcoiiOL4tVoEA3XkSTKg5OMh8NmZygcD7U+6YKiIDL N+1ZumBle1v6Bf5zIltpoqc= X-Received: by 2002:a05:6870:c68c:b0:16d:bbce:29d6 with SMTP id cv12-20020a056870c68c00b0016dbbce29d6mr6703085oab.25.1676314668277; Mon, 13 Feb 2023 10:57:48 -0800 (PST) Received: from xps8900.attlocal.net ([2600:1700:2442:6db0:5829:dabf:a50e:e9f2]) by smtp.gmail.com with ESMTPSA id ef15-20020a0568701a8f00b0016df97ab05bsm1654958oab.31.2023.02.13.10.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 10:57:47 -0800 (PST) From: Frank Rowand <frowand.list@gmail.com> To: Rob Herring <robh+dt@kernel.org> Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] of: add consistency check to of_node_release() Date: Mon, 13 Feb 2023 12:57:01 -0600 Message-Id: <20230213185702.395776-7-frowand.list@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230213185702.395776-1-frowand.list@gmail.com> References: <20230213185702.395776-1-frowand.list@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757743455883652467?= X-GMAIL-MSGID: =?utf-8?q?1757743455883652467?= |
Series |
of: unittest: new node lifecycle tests
|
|
Commit Message
Frank Rowand
Feb. 13, 2023, 6:57 p.m. UTC
Add an additional consistency check to of_node_release(), which is
called when the reference count of a devicetree node is decremented
to zero. The node's children should have been deleted before the
node is deleted so check that no children exist.
Signed-off-by: Frank Rowand <frowand.list@gmail.com>
---
drivers/of/dynamic.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index dbcbc41f3465..657a65006056 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -377,6 +377,10 @@ void of_node_release(struct kobject *kobj) __func__, node); } + if (node->child) + pr_err("ERROR: %s() unexpected children for %pOF/%s\n", + __func__, node->parent, node->full_name); + property_list_free(node->properties); property_list_free(node->deadprops); fwnode_links_purge(of_fwnode_handle(node));