Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3003137lqp; Mon, 25 Mar 2024 16:28:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1bHym1SPRRWuGs5bM7KjoXgNAJJ7wJ5oEd2mvE3j2bMKvYzP2RnOiiLCusAuDzmX5qX9tLzSrEYDLFjq6TULPxUGJ947Fi8x8Nkj1NA== X-Google-Smtp-Source: AGHT+IFmrEvaL7apd03CaeGVJkhSQ5Urpyq/53lK2ee0tt8DEOOr2syIBYWZWhKE9QOHuMZ7k/EH X-Received: by 2002:a17:902:ea07:b0:1e0:b60e:2901 with SMTP id s7-20020a170902ea0700b001e0b60e2901mr4961405plg.32.1711409332962; Mon, 25 Mar 2024 16:28:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711409332; cv=pass; d=google.com; s=arc-20160816; b=l7eo2TUTXlSR1WVh3mS4arc+JZ4s7pi00qmi6l0kG2s1fgRo+LYWhTIpRU/cSP4+fU 5hILfbblwVRCbTOTMjFBXKxU6yf/EE4ohHdAUpHw+usPehIIei/cKDIg3uFr3P6XT3Qb a+bkRI7aZPoaafB7WVCU1nJetzoXlsM2RUJkDIj/giNRMQxq1kIm4FVHGQpGH0D5lHE9 716BITFf6EH46zmvdDK4YnM3IN9UjJP/cEInBqQ27ddiW1PzXfJQprhEd2o1cEe1ioIP AWgmhxdskgjX+/yHkfB0p2/DNzq4V2Rd0sUP9PD9g+ENtwyeQGUr6SVNEHp6wfbbwKfQ L3gA== 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:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=3m0PtOuLhnJ+6DNxPBawU6YU38hlNjYHLn/3Vg64K5g=; fh=pKjp7pSIVrcOlLrsyOpI6GMvzeaZoZXo5UKrD/jH9sY=; b=X+vWNaDptBA71jFVjztqQOufYrtqpIlFMM4Vkm6nWFHAny0SDlkumtbvsPLmwx9pU+ NVNTtUnZ6Mla23a4DfJxDxzaEakD3SxbPPq8+lk+J8gTT5NDADaSMGwc8fbsPpyNGHaQ D1ToiRe9zWh0q74x2DotOtsYR79ZbZe9aVX/0tSYN75sLY9qpjEzwBM5unIsipxhCEID SMnsOI7Ax6xqvdncy3qEFDvDhUn5a2k8WGtoPPwC8UZyZgktpSP/gE7wjQW9HX8nOiFD hzKoONOgFjgdqDDMRCBp9huj+4cV3fHfx3i9OeD0CWyvf5har8PQUhjfAXR8RSaC0Lz/ qQag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=UTx2Wt1B; 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-117422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117422-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p10-20020a170902e74a00b001e0d630f345si1295819plf.645.2024.03.25.16.28.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 16:28:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=UTx2Wt1B; 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-117422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117422-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id DACE1B2214F for ; Mon, 25 Mar 2024 17:17:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBBA715356D; Mon, 25 Mar 2024 15:57:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="UTx2Wt1B" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 9DA4CD272; Mon, 25 Mar 2024 15:57:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711382235; cv=none; b=BNJTN0vdUoJGEcQ3Or+RMCVkwyhCVPT1mwEay4FFPPfCl8aL8Ai2+i/btAv01KHG6dUaZEpus8nA1OtIsgcU3+0ibrdEbzmZ1rG3Fq/iExN2Xs2ZY5azK0qLy6Wno/LqDU+VdJeWEYpTgpkFopE+rxP3+XIbeuFmyCyGQcrxrRg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711382235; c=relaxed/simple; bh=rqfE9xcntcYQ93Gam/45NyhYzJafmljtmywYwC1FnIE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XAYcA6eZs6jmquRELwoVnGhQ8cdum0LwtTtYfC2ZxlYujqI0ZayjP65kdQ9hR67Z3bAt4J8hZfIPu0HayfPv8f4IJl7G7rIYXlO7EFPZMDhn2ZBPWj7TFeem7v0ltSPyJlUvwykHfEgF9gmNjIi0RM7K1ykHck/nyR/eblgZyTM= 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=UTx2Wt1B; arc=none smtp.client-ip=217.70.183.194 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 ESMTPSA id 114FA40005; Mon, 25 Mar 2024 15:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1711382225; 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: in-reply-to:in-reply-to:references:references; bh=3m0PtOuLhnJ+6DNxPBawU6YU38hlNjYHLn/3Vg64K5g=; b=UTx2Wt1BeEb+vr7yg+TJnPWeYXZqUTeHZJvTluJb9LqJ6iIHX04FLkAODJwfzlAt6nRhZc wcY07IpEkA31mXG8UueekNvuWp5+nctcpVdGrokgpBRLZTN8nLgol0GWkK8QslaaDOHZwq WSH8t35OG2GmOoBQ+ZNN/MFAjswFPiDNIizKNjnWZbA9ixd9TvP7UWfYooI/ErLf1c4nph Jp342vvXZWfX7WPLqp5CosoXQ34fwRObVXxA0fafWG557lOpuKekBG+v9ZC3KulVfagQMI pyTtjPbROpwIrKH/+jBsaeR2gp1GYRmucUXIJ1qDpHyHAFwIaYpHlEGS8H1msw== Date: Mon, 25 Mar 2024 16:57:03 +0100 From: Herve Codina To: Andy Shevchenko Cc: Vladimir Oltean , Sui Jingfeng , Jonathan Cameron , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Lizhi Hou , Luca Ceresoli Subject: Re: Implementation of fwnode_operations :: device_get_match_data() for software nodes? Message-ID: <20240325165703.7486eac2@bootlin.com> In-Reply-To: References: <20230301143625.7kdnzujlv4psbhla@skbuf> <20230301152527.khyzifds4w3rkebt@skbuf> <20230301171845.oliqbso7v2vmyqr3@skbuf> <20230301174309.5nqul7vg5uygwtpy@skbuf> <20240325161627.1c0fc955@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) 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 Andy, On Mon, 25 Mar 2024 17:39:03 +0200 Andy Shevchenko wrote: > On Mon, Mar 25, 2024 at 04:16:27PM +0100, Herve Codina wrote: > > On Mon, 25 Mar 2024 15:41:19 +0200 > > Andy Shevchenko wrote: > > ... > > > > > I agree we don't want to have multiple approaches of doing the same thing, > > > > but I debate whether I am really doing the same thing? > > > > > > > > If software nodes are not designed to be a good fit for my kind of use > > > > case, then what are they designed for? > > > > > > I think the hardware should be described in the respective format. Yet, you > > > have a point that it's too verbose to the cases when we know the layout of > > > the attached (not-hotpluggable) devices. > > > > > > There are discussions [1,2] on how to enable DT for the cases when > > > non-discoverable HW needs to be detected and enumerated. > > > > > > I don't know which solution will eventually be accepted, but my personal > > > opinion here that we would like to distantiate from board files as much > > > as possible. > > > > > > Btw, for the internal (board files) code we may also use property to > > > go with (see how spi-pxa2xx uses that) to distinguish configurations. > > > But it might be not that straight as with driver data. > > > > > > So far, I haven't seen the code (am I mistaken?) which makes use of driver data > > > for software nodes. > > > > > > [1]: https://lore.kernel.org/lkml/20231128084236.157152-1-wenst@chromium.org/ > > > [2]: https://lore.kernel.org/lkml/1692120000-46900-1-git-send-email-lizhi.hou@amd.com/ > > > > > > Aux topics which might not directly be related (in order of declining relevance > > > from my p.o.v.): > > > https://lore.kernel.org/lkml/20231130165700.685764-1-herve.codina@bootlin.com/ > > > https://lore.kernel.org/lkml/DM6PR12MB3993D5ECA50B27682AEBE19FCD67A@DM6PR12MB3993.namprd12.prod.outlook.com/ > > > https://lore.kernel.org/lkml/20240217010557.2381548-1-sboyd@kernel.org/ > > > > > > > I work on PCI DT overlay support. > > The idea is to have a PCI driver that loads a DT overlay to describe the > > hardware embedded in the related PCI device. Some features related to this > > topic are already upstream. > > > > Rob did a presentation of this topic at the Linux Plumber conference last > > year (https://www.youtube.com/watch?v=MVGElnZW7BQ). > > > > IMHO, your use-case is pretty much the same. Of course it is not a PCI > > device but a SPI device. Even if the device beyond the SPI bus cannot be > > memory mapped, the idea seems pretty much the same: describe the hardware > > embedded in a specific device. > > > > You mentioned that you need the '-@' option when you compile your base dtb. > > In fact, it depends on the resources you need to reference from your overlay. > > On my case (DT overlay to describe a PCI device), I don't need any references > > to a base dtb from the overlay. I don't need to use the '-@' option. > > Even more, I started (not yet upstream) to use all of this feature on an ACPI > > base system and it works. > > > > My PCI device is a Microchip LAN9662 PCI device. > > The Microchip LAN9962 can be a "traditional" SoC with CPU cores and several > > IPs but also a PCI device. > > When provided as a PCI device, the internal CPU cores are no more available > > and replaced by a PCI endpoint IP. > > All the accesses done by the SoC CPU cores are replaced by accesses done by > > the host PCI system through the PCI endpoint. > > Drivers were already present upstream (traditional SoC platform driver such > > as i2c mdio, clock, switch, ...) and are used without any modifications for > > the PCI device. > > All the wiring (mapping) between the PCI world and the internal device > > hardware is done using a DT overlay. > > Thank you, Herve, for looking into this. As far as I understood, slowly but > successfully the required changes for your use case are being landed. If so, > it makes driver data for software nodes approach even lower priority. > Yeah, some more changes are still needed to fully support my use case but everything is on the right track. Best regards, Hervé