Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp375539lqd; Wed, 24 Apr 2024 05:21:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXg9IJp3GzxKM1dh2xVGVhrD5rDCi1cZrUqW1gRwTXUTXqEJjOSaeJUNQ6+eKp/AyZz8AqgaBBY4iteT3OwYBpRjO4l64iQWGnmEGs+Yw== X-Google-Smtp-Source: AGHT+IFlVA8GOdLItXq2OPyumn7iizYkAurAgqvjrVg3FJ4ruIJt/Y9L3dhlH7SxeLaHmxicoecM X-Received: by 2002:a05:622a:14f:b0:43a:42f:3ad9 with SMTP id v15-20020a05622a014f00b0043a042f3ad9mr2479943qtw.7.1713961310405; Wed, 24 Apr 2024 05:21:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713961310; cv=pass; d=google.com; s=arc-20160816; b=PjlQO9+uqW/ad/KKZBYI0t0MLnd3bo/CvekhQfdJ2hS4KjaKGF+Lbln4C8RKkZYoVe 8yWDdLoZom/gtM3jpnkPPjtoc1wEik8HVJ3DYrIiE62lMuPqzz5q7Og8S6WkUrXAnR7z cfsWQ+qT65L9sGHvdDcxrOaCmCz9qWkx0gLv30aT3mi6YDWoaLmjU/vrALZZFxDDWMxA PPdWgsqAM6p6w3AyeqpF4OC23gUi1lvO4hnzPGVqJimVfE0tnsy1CxkZ4ucq5rMvMI3i qr4k+9mub9P0hEqrLdF52khnzG6t4e5PFqNGqZofx3J/3sbTOHgYCiVrQAggI5o+mgNH to2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=0WdXEQJeti9xObmiI3NOcA4xzxVIiBqdDHBEiYkiDJE=; fh=eNDX9qT4eRNS4+IXHMfSBk4dckNbnctMQ2yAgJG44Mk=; b=f20ygrN4IkYS7DSOeTuvuMAekgfQjUjTisrVbKnHQ8nK+8KN2eNfR45ESOZLdfxCxK GdOXw2unwrqZ10X0Ca+fL4F9cIXCU1grIAmuzpqBOFXyBrHnLfEw3NMeBrNWaj0m5Po/ MPq4YL59v9q9it7bktxoQoS3JbDfv3ATBYXWFrPf1xcsVGzXp231LEIVrfD7Y2vm2oxu VaYfGk5IjCjr8uzQ19JPkHGy05l7qOwH3HzHgmKQFsyFhapbcOkWusVIaokAQsiTUoaq XHPGN+xameK6u6973Hv/A9kd0GlvNzCPw12KmHQA59AKv4zWR6BER62B8YiiE5OUEYD9 C/Xg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Eo45agJf; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-156853-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156853-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e17-20020ac85dd1000000b00434614f21d4si15739141qtx.766.2024.04.24.05.21.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 05:21:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156853-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Eo45agJf; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-156853-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156853-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 25AB11C23C75 for ; Wed, 24 Apr 2024 12:21:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5CBB15ADAE; Wed, 24 Apr 2024 12:21:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Eo45agJf" Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 A732C15A4BA for ; Wed, 24 Apr 2024 12:21:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713961302; cv=none; b=jYUeKet2WCXgzrPY4fa9FCmyAp0TBiGfr/lEZiXg7ft/M/P+3dslsEju6aTuqH9BxMxMKlAxL6k7Bp19B5I7gZMGaGAGZ/25sRGnhkV8NQodZ+jUpgztr1ZSazS38Ta6XdE5Fcg1fKtGv0P5gQzuH1ux8jM6L/xwZ1FlJGykvc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713961302; c=relaxed/simple; bh=YxtpFFX7mHzwaAbOxjF4cbEoH2y8B5Deda1fqi3UAx8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PUY9yo6ooCQadcIy7+eEct55DRzXbsABg61d0seU+37/OJ5+DdtQWZZGKe0mMuByQApdBA1AuYGarND+gRSeEg/ul3rG7YAiG17dqg9ToeNBt342pVfwlu7e2vyYKOB01MVaoxvJRW9egpeIr0vHY3EJQ5biGxHYbtxVUtHsobc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Eo45agJf; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <32690d46-facf-4548-8915-d37604d2f54e@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713961297; 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=0WdXEQJeti9xObmiI3NOcA4xzxVIiBqdDHBEiYkiDJE=; b=Eo45agJfdnNkfpNmv/kQe73FfGgL2Myav7WMwL682HSubexjghgLAS10l7CBvwCXPoCKF/ y5B3Eb0GNXdL7fE5fLP7H0AyGsqO4lYMaVK+ZqmcRXhN5RGdiFDDMgYxucNIBNbpzmC96R /cnf+LaxdT7G3Sa9hrdZXlhZ2coD2k4= Date: Wed, 24 Apr 2024 20:21:30 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v2] software node: Implement device_get_match_data fwnode callback To: Dmitry Baryshkov Cc: Andy Shevchenko , dri-devel@lists.freedesktop.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" References: <20240422164658.217037-1-sui.jingfeng@linux.dev> <22979e28-ed48-467f-a5cf-82be57bcc2f7@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sui Jingfeng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Hi, On 2024/4/24 16:39, Dmitry Baryshkov wrote: >>> Sui, if that fits your purpose, >> That doesn't fits my purpose, please stop the recommendation, thanks. >> >> >>> please make sure that with your patch >>> (or the next iteration of it) you can get driver_data from the matched >>> platform_device_id. >> No, that's a another problem. >> >> The 'platform_get_device_id(pdev)->driver_data' you mentioned is completely >> off the domain of fwnode API framework. You are completely deviate what we >> are currently talking about. >> >> What we are talking about is something within the fwnode API framework. >> >> You can hack the device_get_match_data() function to call platform_get_device_id() >> as a fallback code path when the fwnode subsystem couldn't return a match data to >> you. But this is another problem. > No. I was using this as a pointer for having non-DT driver data. Whatever. Whatever how does it going to be used by you, or whatever data the pointer you use to point to. Just remember one thing, it is not relevant to my patch itself. > As I > wrote several paragraphs above, other subsystems use their own > driver-specific match structures. Fine, but on the DT systems, they mostly probed via DT. Thus, the so-called driver-specific match structures won't be used. > Reworking subsystems one-by-one to > be able to use generic codepath sounds to me like a way to go. Fine, you are encouraged to do whatever you like, you don't have to told me. > Adding > "compatible" property doesn't. As I have told you several times, software node is kind of complement to ACPI, it's definitely need to follow the style of ACPI counterpart. Software node can be secondary node of the primary ACPI device node. With this understood, please read the implementation of acpi_of_match_device() before express objection. Or you can read several relevant commit such as 4222f38ca3b7a ('ACPI / bus: Do not traverse through non-existed device table') for knowing some extra background. Beside, users of the software node backend itself can do whatever they like. The value of the "compatible" property is *just* string, programmers are free to name their string property in their driver. It is not you to say no though. No offensive here, I means that both of us are not good at this domain. Especially me, but at the very least, I'm willing to listen to what expects in ACPI/swnode domain say. One day, you become the top maintainer of specific domain, and when I go to contribute then, I will also read to you reviews message carefully. Back to the technical itself, the "compatible" property is a standard property of ACPI _DSD object. This is written into the ACPI Spec. The value of the "compatible" property is just string, store it at 'platform_get_device_id(pdev)->driver_data' or in 'of_device_id->compatible' or some other places doesn't really changes much in semantic. A device driver can be platform probed, DT probed, ACPI probed, I2C probed, SPI probed... Take the driver of I2C slave display bridge as an example, it can platform probed, DT probed, I2C probed, in the future, there may have programmers want to add acpi_device_id, then, it will gain the 'ACPI probed'. If each of them introduce a driver-specific match structure. Then, that going to introduce very heavy maintain overhead to the maintainers, not to mention to achieve your cheap slogan: "Unifying DT and non-DT paths via generic property / fwnode code". -- Best regards, Sui