Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5301616rdb; Wed, 13 Dec 2023 05:09:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhCo1oeM94y1cq8q2AYT+YMJHgfO6snUdQy8Ecpu2M+SjnBiIm7vQ1sFi2IP6iOTIXRRk1 X-Received: by 2002:a05:6358:ce03:b0:16d:d0e7:e7ee with SMTP id gt3-20020a056358ce0300b0016dd0e7e7eemr8354820rwb.28.1702472974686; Wed, 13 Dec 2023 05:09:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472974; cv=none; d=google.com; s=arc-20160816; b=Y8p6iopD82VTLnlWHjbxLJBm+ZYEbKuxB/GoTpEqIJSIYD1uysM/6/N3PrDBMIA3LF HMLv9zRnSjMqsX4gg7fZNR1u2nAUDDK5veKC6IE5Y3J/u7Ph0uUQ0mqJ+ygd4iAyhVGU OqTPGLbrwilDQW8xDOkTG93WILkTjXhojHY/iDa5zYkHs7p5vrty/BYvULPjrXqq9Aev LUzc69V/zwnbS+QQ7cZca5gyLPzjGMIPr1ItTBOhRSjv9Xe07jmG++6c+gHd2PT1r8nA 37UhzRPqAqL5+jvDq/Yn0jJLVVt6OQ14LKYTqI9KNRQVH5u+ibCBTy56ZrnKMAx7yXJy Z9qQ== 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=2HJoRFEHz30zB0ZJf+EKks3Tvo/kzW6L5hkkeuaBBCU=; fh=oPnec/+L6JXG2Lj88Sc9HHl7jOQ+NW3ruZUc8IC4JSk=; b=sZ/lUf8U2bfXjRMzqt7DSmeSlmVuZmGHHUwJVGPsbWE20sAUyci63OVokPsrqgsh1K E4Io0H5l0UwCGUqOGF7AUTEd8Vlp5Fg8bR/CAk02FU6Ub8fm60XRJhxHFJLyYFlfklzT GZTfJJAXGLxHlm4LMANmMEmsl1xA5a+JB9n8U05Sm+Om9MsTU2izw9zSXwT1euBk9Af3 OHG1sAX+HFw0pePGXEsgcHrINnWfqHJUtTa+QqNEWftFrhVN9prl4fGvL50Dfx/+h5mH BJHy//3PHKHlLMz+xUnBLoO2efWOu1xMg6ym6mPTFCI3k19o5mHHzY77S8N1MZttkWDS o8dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NSxwU5wG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id dw5-20020a056a00368500b006ce6955fce5si9653349pfb.360.2023.12.13.05.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 05:09:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NSxwU5wG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F2419808D238; Wed, 13 Dec 2023 05:09:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379149AbjLMNJN (ORCPT + 99 others); Wed, 13 Dec 2023 08:09:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379083AbjLMNJM (ORCPT ); Wed, 13 Dec 2023 08:09:12 -0500 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B94BAB3; Wed, 13 Dec 2023 05:09:18 -0800 (PST) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2c9fdf53abcso66421891fa.1; Wed, 13 Dec 2023 05:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702472957; x=1703077757; 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=2HJoRFEHz30zB0ZJf+EKks3Tvo/kzW6L5hkkeuaBBCU=; b=NSxwU5wGzTjw+ytv8hERCHcgty6D8qJMkVzUlng7Z6BDH3NhWdKwFsTmvcxsYA7agw kFBhmc+tcPjhMypfzioqMrps+Yjd2p+CuZLJaQdh612o57OU1fF5mFzgdGvGr680rIOq kPEzE6il524kHXW0+ZtC4MmdHvkSYkCgaYHTQTl934vdhrYqGtYyVOoo6emNY4tagPRY lncSs1nGyUrfgVeRuvy/0upFMaVhiGdAljNGZ+lvUXnoknT6umk1GFrVYoW8+Z5CHlR6 EMSMNREWrKkEcVmqz/jBevTd3QWBoO39eNRR+qNKy5ExwenB+/2z/k0VIUPaQWG6iGId VNYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702472957; x=1703077757; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2HJoRFEHz30zB0ZJf+EKks3Tvo/kzW6L5hkkeuaBBCU=; b=lyOcCqgAG8DDQAUvzVM8hok97ik610p08IcKMehmJK5NImwrRE66n/iF1dU4wO0Pz6 VOt31K6DrvYaCh7wtt2yH/QqoaMcSrK3nw/VlBlFBxvekQVLZFJKuqgt8P799lmuMWQK R3472pNEXJbkaXs/M9MEGPEeh+s0tCbnRUrl/MOP/Q5NHuUpAPmu+B9Tr0ZHoA3MsjZl RMdTCfmOMIoTSt/EDlb87Eq9VPQu4IUY8tIXBzAhtVN0bhqIjrjXtq30aDu/9bUnCtI1 YwwSF6nJWUugFFfrszA2p/GY/IMRvxc/vgN0PkHa3tCYBU3MzgqQBf187SFhYMaJdnqS 9itA== X-Gm-Message-State: AOJu0YyGxrxe0tWxTe2fobuVOmNEia7t7lN+aq/SHDb24QMgyq5eUNTi Vltybq/mVYKfzwwxyqRDCRU= X-Received: by 2002:a2e:b742:0:b0:2c9:e940:6780 with SMTP id k2-20020a2eb742000000b002c9e9406780mr3993926ljo.22.1702472956648; Wed, 13 Dec 2023 05:09:16 -0800 (PST) Received: from mobilestation ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id m24-20020a2e9118000000b002ca02e43f40sm1840200ljg.74.2023.12.13.05.09.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 05:09:16 -0800 (PST) Date: Wed, 13 Dec 2023 16:09:12 +0300 From: Serge Semin To: Andrew Halaney Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Giuseppe Cavallaro , Andrew Lunn , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Simon Horman Subject: Re: [PATCH net v2] net: stmmac: Handle disabled MDIO busses from devicetree Message-ID: References: <20231212-b4-stmmac-handle-mdio-enodev-v2-1-600171acf79f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231212-b4-stmmac-handle-mdio-enodev-v2-1-600171acf79f@redhat.com> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 13 Dec 2023 05:09:26 -0800 (PST) On Tue, Dec 12, 2023 at 04:18:33PM -0600, Andrew Halaney wrote: > Many hardware configurations have the MDIO bus disabled, and are instead > using some other MDIO bus to talk to the MAC's phy. > > of_mdiobus_register() returns -ENODEV in this case. Let's handle it > gracefully instead of failing to probe the MAC. > > Fixes: 47dd7a540b8a ("net: add support for STMicroelectronics Ethernet controllers.") > Signed-off-by: Andrew Halaney > --- > Changes in v2: > - Improve error handling code (Serge) > - Fix malformed Fixes tag (Simon) > - Link to v1: https://lore.kernel.org/r/20231211-b4-stmmac-handle-mdio-enodev-v1-1-73c20c44f8d6@redhat.com Looking good. Thanks! Reviewed-by: Serge Semin -Serge(y) > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c > index fa9e7e7040b9..0542cfd1817e 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c > @@ -591,7 +591,11 @@ int stmmac_mdio_register(struct net_device *ndev) > new_bus->parent = priv->device; > > err = of_mdiobus_register(new_bus, mdio_node); > - if (err != 0) { > + if (err == -ENODEV) { > + err = 0; > + dev_info(dev, "MDIO bus is disabled\n"); > + goto bus_register_fail; > + } else if (err) { > dev_err_probe(dev, err, "Cannot register the MDIO bus\n"); > goto bus_register_fail; > } > > --- > base-commit: bbd220ce4e29ed55ab079007cff0b550895258eb > change-id: 20231211-b4-stmmac-handle-mdio-enodev-82168de68c6a > > Best regards, > -- > Andrew Halaney >