Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3003858lqt; Tue, 23 Apr 2024 07:59:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW29y+ndFpfh1mldscTfA8SZFKtkLdoXgbqlGVQ7i1slrNTAoGbl5f5Q8i+CAg8IRdPSFE5BoDzASa1brnGfKu/Z9g6bclgvzAYAqmqPg== X-Google-Smtp-Source: AGHT+IFc7Wgz4YXCtnqGeE6c/J7Ts0UpeZ7wXumolT29rb+9+1Ul/DMRPK2i1lXzyIcAQ42Q3vse X-Received: by 2002:a17:902:bb98:b0:1e2:194a:3d22 with SMTP id m24-20020a170902bb9800b001e2194a3d22mr12616806pls.32.1713884349584; Tue, 23 Apr 2024 07:59:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713884349; cv=pass; d=google.com; s=arc-20160816; b=FNstmM+KGZY6tGP6Ty1ERKAaP+qCCQR4/vbomoucFH/Tk6S2hRzWbgNS0CETnWmIE0 j0z0iaGBKxIVJgMNqmMhIchAASV1syauJRrCVLyxExiT0/+I/NxvttkpzO+SjoW5w/Vi kD6HHjy3VZG2us2CUIg+1LqYWWz3SyYdrQTJEaZp8uUFSkqUB10B0w8qdU7e3TjXRL+L TN6HeVDHvPFfDykiqzpafbtw7yeJnIzCZc4Lfbyx12pKK9+OMZ2wtgkzzfbg36L5Xoxx JvNYwgIYyQ2xAFthgPgTPU0FUFuUKZIWLtd4ZF3SsnOYSXCWWedyBGc6qoCadX55KS/7 W2eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=7tCUyoWOieT3ct2HHWEZBi0piGX9UNgmmeXMfQxZhHA=; fh=ROcIojklfFMM3zu0Ox/HGEWSKz/14fwMhsoonSvZ8N4=; b=gm+VkDFbC6YXBI6szJ6uarjJgp0UEJf0gSDskFZTBGooKjCF+GL9G4Q9VDi0f8di4p r1qhMpEdjXaG+rz01WY/9BlKkTNqrVBeBCO8Y9Xsi1jUh8brkOY3CtKo2RWMBW2n0N0i H4tZ22moQKFGkeq+vtfdleVhNC6TX3o7fa9LBp5F7vcA7TZ7OC33HpozVDTrJTfNKaLu a/4VpkCMI1DFBoT+OCAr/74PObRh44XPhQGWgLkYQaUDALtZ1MUPFDbqBKzm69Ubh3ar VADz11GWUFfPGNrxwaZqMiaZDjfy/4dEq30CfqW44FYM0orQZ45TgSR8QR4s8cSzX6p2 xTsw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MX0nABRe; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-155402-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155402-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y22-20020a17090264d600b001e037850f90si9603423pli.533.2024.04.23.07.59.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 07:59:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155402-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MX0nABRe; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-155402-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155402-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 DA85328349B for ; Tue, 23 Apr 2024 14:57:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB8E984DFF; Tue, 23 Apr 2024 14:57:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="MX0nABRe" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 90D7413B582; Tue, 23 Apr 2024 14:57:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713884237; cv=none; b=EXzelHHfsE56T64eL+Xq5FBfGvHEuARlTG13KtNMHa9OMFRMXDFLBWPpnZRAnRun/eSRdCEcHvVESvcu6Cs+ByEz/N063ZK3Pp+sitXYPilgFEDRYJo7W020CCpC00i/7RsV5b7t2SS4tdRp1Q+4ah5gRRkldJLz6pVEkLPAF4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713884237; c=relaxed/simple; bh=DuawcNa/W9G5s+blYbeqO21xE2gDEz/xIRPspz04RUQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=t2RPosDMhLdLPML8wCWvEhTWndBx9CPMR5kJWV1eUm5oBAAxMUfEQzcBnNnj3tLeQjoWf8qCburf6bB+15PcaqIAzIq+PqEjko6+yB96mQaOejMoNbUP0FuhiGSF5+c/bqr3qMgx9MlftVkGsEwOkX/wE0Q1X1TrVlnrjsA1cZE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=MX0nABRe; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id 57A092000A; Tue, 23 Apr 2024 14:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713884233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7tCUyoWOieT3ct2HHWEZBi0piGX9UNgmmeXMfQxZhHA=; b=MX0nABRe/ITKnyAAk7o5jkcHQhRuiEml+n2cvJnfbuokoUMOHjRfZTL6tQiiu2cBVgAWRP F+90NGj8nG1vzj4CxenrzCpnmRPcyisu7b1QiEhJV3gFxLxpkMqxmW8geG0887DrP6ITiU izUwdiT72XvHjaFOK5cLq3UYViLoDA5WglvKLppzLJ70cTgrvqswf0CiBli3nk9C8FQJRn fGwyfhC3MRh/FpbM9asZKyLkHFvaEg5PHpBQAzTacrx3nXOIsJm5n2xTJ86ryHJpuNfTmg 7+j1q6Ifs57iTA00FmPTkT5JwATRB+Alrpc1AxelWkoX5Ed/mTU3TCgiI9T+7A== From: Herve Codina To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Bjorn Helgaas , Lizhi Hou , Rob Herring Cc: Max Zhen , Sonal Santan , Stefano Stabellini , Jonathan Cameron , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni , Herve Codina Subject: [PATCH v4 0/2] Attach DT nodes to existing PCI devices Date: Tue, 23 Apr 2024 16:56:57 +0200 Message-ID: <20240423145703.604489-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.44.0 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-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com Hi, The commit 407d1a51921e ("PCI: Create device tree node for bridge") creates of_node for PCI devices. During the insertion handling of these new DT nodes done by of_platform, new devices (struct device) are created. For each PCI devices a struct device is already present (created and handled by the PCI core). Creating a new device from a DT node leads to some kind of wrong struct device duplication to represent the exact same PCI device. This patch series first introduces device_{add,remove}_of_node() in order to add or remove a newly created of_node to an already existing device. Then it fixes the DT node creation for PCI devices to add or remove the created node to the existing PCI device without any new device creation. Compared to the previous iteration: https://lore.kernel.org/lkml/20240325153919.199337-1-herve.codina@bootlin.com/ this v4 series does not create the of_node sysfs symlink. Best regards, Hervé Changes v3 -> v4 - Patch 1 Remove the of_node sysfs symlink handling Update commit log - Patch 2 Update commit log Changes v2 -> v3 - Patch 1 No changes - Patch 2 Rewrap commit log Changes v1 -> v2 - Patch 1 Add 'Cc: stable@vger.kernel.org' Herve Codina (2): driver core: Introduce device_{add,remove}_of_node() PCI: of: Attach created of_node to existing device drivers/base/core.c | 52 ++++++++++++++++++++++++++++++++++++++++++ drivers/pci/of.c | 15 ++++++++++-- include/linux/device.h | 2 ++ 3 files changed, 67 insertions(+), 2 deletions(-) -- 2.44.0