From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f48.google.com (mail-dl1-f48.google.com [74.125.82.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29EDE3CF03B for ; Mon, 23 Mar 2026 19:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774294541; cv=none; b=NaDcnYHO+PcY6dJSNOp0nKwt3UmEX/tk77+SqVCxFcE16PlEUF/U1zIevOo2SxH2KxD2budr9VsFIfQONEu+gJx+tB0HHMFUcFAyAnJ/FpJeMEGLNnxYHO072VW7hCxD/z8Vc2Eh3jA8LTNsXuKf143JkVNOdrFx32oakv/EIUw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774294541; c=relaxed/simple; bh=kvZQfR6Ka8WnuKuT7mVazzZOQdLKZWJfub3aSBzO8AI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N2aRnqOJhBiLNLc3X3IQINeCgi+y1ABNX5bEiUMP9gCv7nn97pzFlXO+IqE5sq+MZmg0ZSykus8MFMNxEI6szeQHDOXmYPiO57bJqimQS6tA/V1IsyI0CrnCOCgaj4HDdRAmwlEIibu0mCpZ1PlfZw8HnQz4k8RuC7XsI+pOdvM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gER+PnsK; arc=none smtp.client-ip=74.125.82.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gER+PnsK" Received: by mail-dl1-f48.google.com with SMTP id a92af1059eb24-126ea4b77adso4712327c88.1 for ; Mon, 23 Mar 2026 12:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774294535; x=1774899335; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=hsALcZ16tevmJ3ng05DYY6tY5JjgfE8hJRfdYF/sgZQ=; b=gER+PnsKerawqjr5zJOkKJ7vn7s58hrCHWcIoAhdjFt27DESMOLN3wTgXJhso3fpuw 1oIvt7jwneWdajfhCwQDqxinICvxzdiLJJ/5pAuM8lzo8lJojssSseVj/Z+yYJb5ihRg inRz9ss6IPHd9r3dxgf4WL074mJb4Lm88olwtJtapzoFF22VtIJyuyr7hwvnGOHdnONy tEjrM6FVCh8Dtwy/P/cERijF+kdULjB1cPZoMXGhxXfatDide14gpc/ZqCDTHyxuym8S Z8C9QKkA8aT4bmERGg+MrjyS3lFoEcRuZG3AcARhSroaURJIFk3Gp4VEaPbydmm9/Djo tYvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774294535; x=1774899335; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hsALcZ16tevmJ3ng05DYY6tY5JjgfE8hJRfdYF/sgZQ=; b=QB59HSO7b+PfIvStmbCRNfrazKM+ZFVZq7/p3C2w52xbT0k8ZpStfktbrosRRE0Jms 1beL33hnlwy+/s1ACYcsotH2kwxNNs6dyaMJjCyVJ3bD2d++sfffJY329heDxhLYStPE rhIs6VShOCYtsujFQlR2cDNCT+Dn3bdHmNZVttAnyjG6zJq41ZjYiPUCZFvbjeVFAIZw bnGrYKt7QGw6DV45RUnyZMQpQgy8T51fuIyQ3dZzyXqTDnUeT1EB/XjJ3sND45LBU1My pdFNNyH/2vP+VqUuXJAOUHuoAgM2fcvLWv36fmY0NXU7yr+qoEnYQGPWUtPjTFvG3Qf6 SeRQ== X-Forwarded-Encrypted: i=1; AJvYcCUEqkjZO6UVAoaBdxbQ015yuINOP8VU3EL8sVDcYK6LLS0vc5fe0+JuEwaTm44g6vM++QrO2U9vZEPJWOk=@vger.kernel.org X-Gm-Message-State: AOJu0YzgW+Z3E4BC8zhtrbMQCX1MTl3T1bUzyn/O7FhIAxZR49e9GEFW RTYaWCe0mi5gH5ZOm9XBdsvv5zjthoAjfkhagPkYw7IaiuxV83k2N8Tu X-Gm-Gg: ATEYQzyJq2RLPzP8OBYBqsAYtt/2GLLsBmlrM07iK8kRb/zzbd3+Df1cLZVNd26h9up y8VUqCFx4LQ3EVLyjBRhqY1cXp0nMklMBojnmWS5LqHDWsgmOD03IaEQroNSsZ9iNqTBWmSFfl+ wh1AYn8k8PgDJ5xQ31rgSplgtiCMKzMSz1tMo1mnY70y9UYBMIt3cn0Q6i+3BidJP7c7PMIYJfU Ltv+4p86HVMXH1WL0m97mKVOAGRiYfWiW3M9XMzCtQXqXi32pK9lR3R5IAnvzpztGIJQ+2oTTWl TEfhMYjqnnGPvFxdHGCpxsL99NHk1Kl1AxtiN63dfmZjO6XyRnWURVsYHZd6luYr17gfEiHIGS6 dCXxCIDoHMyoelnxtOcGTJXtCSDcU2/PS3xOElAfgZ2zsZ7v1u9DIHeRvZ+XKsno+aPhAq4i0TJ nZwZid1YPhpRdJ0dk59VgCW8j0OL18BHKh7Npt8l2fDZmExN2RDoeR4J4ZcIUHs+fD X-Received: by 2002:a05:7022:6981:b0:12a:6ab7:3f9e with SMTP id a92af1059eb24-12a72671127mr5823640c88.10.1774294535335; Mon, 23 Mar 2026 12:35:35 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:a296:1211:5ab0:bc95]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2c10b17d1ddsm12967046eec.11.2026.03.23.12.35.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 12:35:34 -0700 (PDT) Date: Mon, 23 Mar 2026 12:35:30 -0700 From: Dmitry Torokhov To: "Russell King (Oracle)" Cc: Andrew Lunn , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Neil Armstrong , Mark Brown , Liam Girdwood , Lee Jones , Pavel Machek , Peter Rosin , Heiner Kallweit , Moritz Fischer , Xu Yilun , Tom Rix , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-spi@vger.kernel.org, linux-leds@vger.kernel.org, linux-fpga@vger.kernel.org, driver-core@lists.linux.dev Subject: Re: [PATCH net-next 07/10] net: phy: switch to using class_find_device_by_fwnode() Message-ID: References: <20260322-remove-device-find-by-of-node-v1-0-b72eb22a1215@gmail.com> <20260322-remove-device-find-by-of-node-v1-7-b72eb22a1215@gmail.com> <32679fc0-c388-4cd7-a030-5f5ed5abab78@lunn.ch> 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=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Mar 23, 2026 at 06:39:28PM +0000, Russell King (Oracle) wrote: > On Mon, Mar 23, 2026 at 11:33:36AM -0700, Dmitry Torokhov wrote: > > On Mon, Mar 23, 2026 at 08:59:52AM +0000, Russell King (Oracle) wrote: > > > On Sun, Mar 22, 2026 at 10:17:15PM -0700, Dmitry Torokhov wrote: > > > > On Mon, Mar 23, 2026 at 03:54:09AM +0100, Andrew Lunn wrote: > > > > > > - d = class_find_device_by_of_node(&mdio_bus_class, mdio_bus_np); > > > > > > + d = class_find_device_by_fwnode(&mdio_bus_class, > > > > > > + of_fwnode_handle(mdio_bus_np)); > > > > > > > > > > When you look at this, why is it better? > > > > > > > > I think we should move as much as possible towards firmware-agnostic > > > > APIs and use fwnode_handle instead of device_node or software_node or > > > > ACPI companion. To discourage this I think we better remove > > > > firmware-specific APIs where we have firmware-agnostic ones and > > > > eventually clean up drivers that use OF- or ACPI-specific APIs. > > > > > > Basically, no. This is wrong. > > > > > > It may sound like a good goal, but there's an underlying issue. This > > > goal assumes that the firmware description in OF and ACPI are > > > indentical. > > > > If they are different then drivers will make allowance for this, like > > I2C core or SPI core does. But most of the modern drivers use > > firmware-agnostic APIs (device_property_*()). > > What is appropriate is up to the standards bodies responsible for > the firmware. ACPI has a separate body, and we can't just dump > the structure we use for networking into ACPI. So no, you can't > just switch to firmware-agnostic APIs for networking. So I believe there is a difference between deciding: 1. What schema is being used on a particular system - it may be OF-compatible, or ACPI compatible one, and ACPI may support OF-compatible schemes for certain subsystems or individual devices, and 2. What is the API to access the properties. There is no harm to use device_property_read_*() universally as well as not having OF-specific APIs at the driver core level. What matters is schema matches the system type. > > For infrastructure where we lookup stuff by some kind of firmware > node, I have no problem with converting that to fwnode APIs, > because that doesn't transfer the DT description into other > firmwares without prior agreement of the appropriate firmware > standards bodies. > > This is not "foreign territory" - ACPI in general doesn't want to > describe e.g. the individual components of a network card, unlike > DT. I think we actually broadly agree? What you are arguing against is saying that OF schema is guaranteed to work on ACPI systems and vice versa, but I am not saying that (although for some things it may). But still most OF schema can be handled by generic APIs (either device_property_read_*() or fwnode ones). Thanks. -- Dmitry