Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1276101rwi; Mon, 10 Oct 2022 13:59:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5qlMuKitJ4HpIRCE1JdMNRJrPbMLnmWMlO958hBQDqV1fW5AxZ/J6u4pc4wsUDkbIUYiCf X-Received: by 2002:a63:c3:0:b0:439:72d7:7e1f with SMTP id 186-20020a6300c3000000b0043972d77e1fmr17900531pga.524.1665435561582; Mon, 10 Oct 2022 13:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665435561; cv=none; d=google.com; s=arc-20160816; b=xO1PjCMhhqwdAdSDEn0B5BoAh1W+qIxlzdKIY1XcLb6miQByWSPVmX71b1yPm/jBOW e2sezXprZst0lLRV39hyAxjDXN52IpD6m+YwuFqsyDNAEGGCzaUnJMeG4R4dvfF4M1kv j1vm2lvzIsHIbYj/vZGAx3aV/KPap27Vy4zy9+vX3n2MftbrUoqzsQOgf010iGnmaQlY RU6KVecrIgZVzttL4GJbTtFnlqVUJCOlQa4BqNPcDKcHfCiVGSnRD46Mw1d2LtnakVEC bc01b1jgRsWI6Gf7g8dlwkyGKRkBBROnnc0Tw8Oe7dVkCbofZ13EPGAKnqGn+Xla6QZ/ rwZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Hjyn8dqoIEtIO27l3MzacOUF4IDEr7dDUJYhUQFgMXo=; b=vvhZyqCpm+jQnxYO6gngk9LQTWAIJWB4aeiXHyh77tBNHjpIea4sJ/y2g1sslwNzdM Gzp8WrkdNTzGCKbGoFjTmTiQ7zLqviTG6YMwrYyfbTfqQYPWqJ5eU2AuwQA+MeWGu6Ob IUTYcHHy/6yKPluGMzbjo3XKtNPdR77X+pFTlQjrXYgtMPgYMZgpNtO20JFpjuqQdDIR ZLKITKspPWGcQbV0HyEt7+WPGRfXjdQBlrJdXSDZvbNjTgvXU2oZ9bkaBI3RUiHKux0m 9B3ekmyAqe8T+Tp7CBE89FAdvdsHmu8LbY5tCfuuqWucleWLGnb6rooQivEoI6cya8W2 TK2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=F8dZ+DVr; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i28-20020a63585c000000b0045c5a274ba3si13000815pgm.74.2022.10.10.13.59.09; Mon, 10 Oct 2022 13:59:21 -0700 (PDT) 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=@lunn.ch header.s=20171124 header.b=F8dZ+DVr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230090AbiJJUjG (ORCPT + 99 others); Mon, 10 Oct 2022 16:39:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230345AbiJJUin (ORCPT ); Mon, 10 Oct 2022 16:38:43 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8E50356CC; Mon, 10 Oct 2022 13:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=Hjyn8dqoIEtIO27l3MzacOUF4IDEr7dDUJYhUQFgMXo=; b=F8dZ+DVrjvmQ0TStDXpOGnk/sd O/3IcPkTalZQK7fEPgfOWlCFlN7txtkkDwqyn5jB+tA8vL1S9pa60z8zmuKzX8+8bxTIALJSSB1iE 7Njin9Y1I/oMulkxaZTXJn+6v7hNxpxR8bsEp4n2UADO5fPG54ay3+uGdf4UbBC2UycE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1ohzXV-001eex-BB; Mon, 10 Oct 2022 22:38:17 +0200 Date: Mon, 10 Oct 2022 22:38:17 +0200 From: Andrew Lunn To: Soha Jin Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yangyu Chen , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] net: stmmac: use fwnode instead of of to configure driver Message-ID: References: <20221009162247.1336-1-soha@lohu.info> <20221009162247.1336-2-soha@lohu.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221009162247.1336-2-soha@lohu.info> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 > - axi->axi_lpi_en = of_property_read_bool(np, "snps,lpi_en"); > - axi->axi_xit_frm = of_property_read_bool(np, "snps,xit_frm"); > - axi->axi_kbbe = of_property_read_bool(np, "snps,axi_kbbe"); > - axi->axi_fb = of_property_read_bool(np, "snps,axi_fb"); > - axi->axi_mb = of_property_read_bool(np, "snps,axi_mb"); > - axi->axi_rb = of_property_read_bool(np, "snps,axi_rb"); > + axi->axi_lpi_en = fwnode_property_read_bool(fwnode, "snps,lpi_en"); > + axi->axi_xit_frm = fwnode_property_read_bool(fwnode, "snps,xit_frm"); > + axi->axi_kbbe = fwnode_property_read_bool(fwnode, "snps,axi_kbbe"); > + axi->axi_fb = fwnode_property_read_bool(fwnode, "snps,axi_fb"); > + axi->axi_mb = fwnode_property_read_bool(fwnode, "snps,axi_mb"); > + axi->axi_rb = fwnode_property_read_bool(fwnode, "snps,axi_rb"); > > - if (of_property_read_u32(np, "snps,wr_osr_lmt", &axi->axi_wr_osr_lmt)) > + if (fwnode_property_read_u32(fwnode, "snps,wr_osr_lmt", > + &axi->axi_wr_osr_lmt)) > axi->axi_wr_osr_lmt = 1; > - if (of_property_read_u32(np, "snps,rd_osr_lmt", &axi->axi_rd_osr_lmt)) > + if (fwnode_property_read_u32(fwnode, "snps,rd_osr_lmt", > + &axi->axi_rd_osr_lmt)) > axi->axi_rd_osr_lmt = 1; > - of_property_read_u32_array(np, "snps,blen", axi->axi_blen, AXI_BLEN); > - of_node_put(np); > + fwnode_property_read_u32_array(fwnode, "snps,blen", axi->axi_blen, > + AXI_BLEN); > + fwnode_handle_put(fwnode); None of these are documented as being valid in ACPI. Do you need to ensure they only come from DT, or you document them for ACPI, and get the ACPI maintainers to ACK that they are O.K. > > return axi; > } > > /** > - * stmmac_mtl_setup - parse DT parameters for multiple queues configuration > + * stmmac_mtl_setup - parse properties for multiple queues configuration > * @pdev: platform device > * @plat: enet data > */ > static int stmmac_mtl_setup(struct platform_device *pdev, > struct plat_stmmacenet_data *plat) > { > - struct device_node *q_node; > - struct device_node *rx_node; > - struct device_node *tx_node; > + struct fwnode_handle *fwnode = dev_fwnode(&pdev->dev); > + struct fwnode_handle *q_node; > + struct fwnode_handle *rx_node; > + struct fwnode_handle *tx_node; > u8 queue = 0; > int ret = 0; > > - /* For backwards-compatibility with device trees that don't have any > + /* For backwards-compatibility with properties that don't have any > * snps,mtl-rx-config or snps,mtl-tx-config properties, we fall back > * to one RX and TX queues each. > */ Backward compatibility only applies to DT. Anybody using ACPI should not expect any backwards compatibility, they should be documented mandatory properties right from the beginning. Andrew