Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5048858rwb; Tue, 17 Jan 2023 08:34:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXtYGa44TOJAHYxTrkFgg7e4ewOpKwq3wsuUTsHYtRWqw5pDZ0iv8zVacxyk/fd2vi4uLEHq X-Received: by 2002:a17:906:b215:b0:871:2060:c4c4 with SMTP id p21-20020a170906b21500b008712060c4c4mr3900635ejz.68.1673973246450; Tue, 17 Jan 2023 08:34:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673973246; cv=none; d=google.com; s=arc-20160816; b=Uw1plV4BctWQtqe2yIUf7BdGKC7uePK4vyaP6UgDZuBilLNkR7q3AoYAP27Y9GXNJK wTmB2D+aDetzrp2By6EVOApue3cp/O+e/Cqk8eZdnsTn+JT6iOKv9cqRKLGBOREJ2hV0 Ko08EWz0Jl901nFItRtemliSEpFLQbAJvrJhiHjIUjBkRxt2PH0i6YeDDWV7pXA6ojlL iPUuTPuo2+ffEIbqvjUtk9p8JKOQGEzU/OWoqux/e5krp0zjwtXaYzUWKhMmMuqPZD6r UExa6baPbD+7jnFdZ+PN7c12/uWhe+MZ3CLMYzPxyGpmcN/A3ccxAksQBlxGHe5o/qPG hmnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4EfAchFh2XqfMOv5AF2Sfa5iQg29dDmyouMrbdYKJR0=; b=k/e5A5A8Hj0lwIgRiVIDhtspogbSLPEMGXGwIF7WI8v+tqZPvl3Rlc0fAyp6XSFtgb 8cUkfC60Wb0UXG/BQs8YoK4+cDFLQD0euKzeYLvnvvhLIZBtfEFImX5etJ7h1xMIQYiX 1ESoallYN8c7XqlwENVpQrzQDImJOxjPVTcCMpXyLAdR9vTva3nHwnVYy4xlkF47QsnP GHw5/YxQ6v0wdpt6kSQmJnmHIxSj9ZgKFnVasebUYHH6tm/NyW+DxZGDfbJwnjBlOwyX SCVP9PSFL+mU97RGuIddP0a48oDk/lzFM0YQVpKs1RF7HphpV34yYmGtxcWLQ3DevF4n EYjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=Evh4xGot; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=semihalf.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh42-20020a1709076eaa00b0087329ff5934si1687325ejc.0.2023.01.17.08.33.54; Tue, 17 Jan 2023 08:34:06 -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=@semihalf.com header.s=google header.b=Evh4xGot; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=semihalf.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232024AbjAQQGP (ORCPT + 48 others); Tue, 17 Jan 2023 11:06:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231515AbjAQQGJ (ORCPT ); Tue, 17 Jan 2023 11:06:09 -0500 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D209386A1 for ; Tue, 17 Jan 2023 08:06:04 -0800 (PST) Received: by mail-oi1-x231.google.com with SMTP id j130so26273890oif.4 for ; Tue, 17 Jan 2023 08:06:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4EfAchFh2XqfMOv5AF2Sfa5iQg29dDmyouMrbdYKJR0=; b=Evh4xGotkD8K7/YI0wKm8LM4Bm1q9bxjAviJg6SXzmcPYwVIFvYspgAf+EiJ8JpdK2 +icEBqN5gdrXJSc7kJSmmI+4m7KzoG/vIhs9X+jRo+H+JXFu69KruiGH2gN+FMlWUYl3 JDMjpdeWohnVxTRBoeU4W+D/WRlq1k0YlC36ahRxFci3ttgSQPdxw+NpVrXpTTPZ4TJE /ikn2hHuaPWDfvmSM8wN5oT99L8XAl4MK1zQVXJGrvWo5ueIfAaPxP3CFx/WNyT3qV6H TcKp/fGF9wf2djy2JJPsVuVuviPvVNwlEKqyw///y8287ZmtlxJnnAm02L688c2rebm6 S+vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4EfAchFh2XqfMOv5AF2Sfa5iQg29dDmyouMrbdYKJR0=; b=wpWdEWkIYgffo5oPgEMaKPOIgh7sfxjKFZoBXyDk8yhOau0st1xpuzSXyRGoOy2WrU QC+cymGqGcXvJoisx6nwlWEXPabHLvYdmX4s7uONAi/XKulhFkBGwbDSLFXnF5egZLw+ JoOSGzfnowXB8XaVQ7/yCrV9llqYavmSwOmq30HpCWg88cUxROawtgblw6MH/ADflaIf G2PbEm3ELO7OGWbMKZtHUfDtkqC7We4RQNvUD6qdYH9x2wKWHQnucCiP4p0k6nHUV/tW 26Z5dAbrbz4v3FjlTNLvLZgnKPWoIv3mErjY099hD9ktjlW+UzT8fPZbWlwS5wCiocu6 29pw== X-Gm-Message-State: AFqh2koThoNcIGl46fKoUqGDoz3W9HS1TRYSoS8m/IxkpFE1mq9pVQJu SLjtzUQBvUAOjlIiEHDhEkjAeJnosBFBFGLkIKhdAQ== X-Received: by 2002:a05:6808:124f:b0:35e:18a6:10ea with SMTP id o15-20020a056808124f00b0035e18a610eamr239009oiv.239.1673971564010; Tue, 17 Jan 2023 08:06:04 -0800 (PST) MIME-Version: 1.0 References: <20230116173420.1278704-1-mw@semihalf.com> <20230116173420.1278704-3-mw@semihalf.com> <20230116181618.2iz54jywj7rqzygu@skbuf> In-Reply-To: From: Marcin Wojtas Date: Tue, 17 Jan 2023 17:05:53 +0100 Message-ID: Subject: Re: [net-next: PATCH v4 2/8] net: mdio: switch fixed-link PHYs API to fwnode_ To: Andrew Lunn , Vladimir Oltean Cc: "Russell King (Oracle)" , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, netdev@vger.kernel.org, rafael@kernel.org, andriy.shevchenko@linux.intel.com, sean.wang@mediatek.com, Landen.Chao@mediatek.com, linus.walleij@linaro.org, vivien.didelot@gmail.com, f.fainelli@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, hkallweit1@gmail.com, jaz@semihalf.com, tn@semihalf.com, Samer.El-Haj-Mahmoud@arm.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew and Vladimir, pon., 16 sty 2023 o 23:04 Andrew Lunn napisa=C5=82(a): > > On Mon, Jan 16, 2023 at 08:16:18PM +0200, Vladimir Oltean wrote: > > On Mon, Jan 16, 2023 at 05:50:13PM +0000, Russell King (Oracle) wrote: > > > On Mon, Jan 16, 2023 at 06:34:14PM +0100, Marcin Wojtas wrote: > > > > fixed-link PHYs API is used by DSA and a number of drivers > > > > and was depending on of_. Switch to fwnode_ so to make it > > > > hardware description agnostic and allow to be used in ACPI > > > > world as well. > > > > > > Would it be better to let the fixed-link PHY die, and have everyone u= se > > > the more flexible fixed link implementation in phylink? > > > > Would it be even better if DSA had some driver-level prerequisites to > > impose for ACPI support - like phylink support rather than adjust_link = - > > and we would simply branch off to a dsa_shared_port_link_register_acpi(= ) > > function, leaving the current dsa_shared_port_link_register_of() alone, > > with all its workarounds and hacks? I don't believe that carrying all > > that logic over to a common fwnode based API is the proper way forward. In the past couple of years, a number of subsystems have migrated to a more generic HW description abstraction (e.g. a big chunk of network, pinctrl, gpio). ACPI aside, with this patchset one can even try to describe the switch topology with the swnode (I haven't tried that though). I fully agree that there should be no 0-day baggage in the DSA ACPI binding (FYI the more fwnode- version of the dsa_shared_port_validate_of() cought one issue in the WIP ACPI description in my setup). On the other hand, I find fwnode_/device_ APIs really helpful for most of the cases - ACPI/OF/swnode differences can be hidden to a generic layer and the need of maintaining separate code paths related to the hardware description on the driver/subsystem level is minimized. An example could be found in v1 of this series, the last 4 patches in [1] show that it can be done in a simple / seamless way, especially given the ACPI (fwnode) PHY description in phylink is already settled and widely used. I am aware at the end of the day, after final review all this can be more complex. I expect that the actual DSA ACPI support acceptance will require a lot of discussions and decisions, on whether certain solutions are worth migrating from OF world or require spec modification. For now my goal was to migrate to a more generic HW description API, and so to allow possible follow-up ACPI-related modifications, and additions to be extracted and better tracked. > > I agree with you there, here is little attempt to make a clean ACPI > binding. Most of the attempts to add ACPI support seem to try to take > the short cut for just search/replace of_ with fwnode_. And we then > have to push back and say no, and generally it then goes quiet. In most cases, the devices' description is pretty straightforward: * a node (single or with some children), resources (mem, irqs), mmio address space, optionally address on a bus and a couple of properties The DSDT/SSDT tables are very well suited for this. In case of separate, contained drivers that is also really easy to maintain. However, I fully understand your concerns and caution before blessing any change related to subsystem/generic code. Therefore ACPI support addition was split after v1 (refer to discussion in [1]) and will require ACPI maintainers' input and guidelines. > > Marcin, please approach this from the other end. Please document in > Documentation/firmware-guide/acpi/dsd what a clean binding should look > like, and then try to implement it. > This is how I initially approached this (original submission: [2]; a bit updated version, working on top of the current patchset: [3]). We then agreed that in order to remove a bit hacky mitigation of the double ACPI scan problem, an MDIOSerialBus _CRS method should be defined in the ACPI spec, similar to the I2CSerialBus/SPISerialBus/UARTSerialBus. I am going to submit the first version for review in the coming days. The DSA purely ACPI-related changes would be updated and submitted, once the method is accepted. Best regards, Marcin [1] https://www.spinics.net/lists/netdev/msg827337.html [2] https://www.spinics.net/lists/netdev/msg827345.html [3] https://github.com/semihalf-wojtas-marcin/Linux-Kernel/commit/e017e69c0= eda18747029bfe0c335df204670ba59