Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4254385rdb; Mon, 11 Dec 2023 13:31:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWgs5tpTM0KqStgf8H71GrJubZoAJm1s9qbqYrmKRVkP5vwrNDlomjmbtS2pAeL6b3mJej X-Received: by 2002:a05:6a21:3398:b0:18f:d2a9:da50 with SMTP id yy24-20020a056a21339800b0018fd2a9da50mr2572808pzb.30.1702330319639; Mon, 11 Dec 2023 13:31:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702330319; cv=none; d=google.com; s=arc-20160816; b=g+Q3EcPGUSshI+9viMdm2lzqQsn7/yi/EhtuQJmyyvxL4xUdf2FjTzB7FZOjbPLRAj od9wYF94Ri44WA2uc1JXH2Po45OcoNd1TnQWNdVCwZ91XUnn8TSZvsjUYwL4TbZ1qIpJ O7Ar5lYXC+s1wKiBv22tSyDUjstBSsAxQNxKhtWjoctS1/Tg1i7G0PmIB5P6LmNdbZc2 SsWwPIbo02Ix1fUe0nUH4x74kLlJrgpNhBBTZVsUnvzq1/IqeRrLUoDupZDFCAAwONCE zhm4Mz9haeBFLURPPTS9Cm40jaBT/5RhHP013sewhuy94DI68jcbOj/uLAjYD9K9uNmV X7rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=3m2lRSq/x6O1AvE2D5Tmo4LBWE3DJjeKHdxsqLlOX9k=; fh=1Y5nX35coyO4igDVd7iwjrwViv6+rfvO+PB2pWweuxg=; b=BJqMO2hCpH5jdid76LqQShxqQukNti+dUQxDatzWU3SOX7HEDc8mhz5bd2P8R+9eQ+ M9cBJsDbVijKFq1LKY5OH/J6saRxCXg01L03aXgcwAEg+A6Tys58whoH9D6iAa2pbqAo WYFGXOjuIHBH2q+9/QKZgCgT0qqfTdwAZ3TWWNesBvrt32cweY4Dk4AFa6JDdAgl/dnz 2NBEfdpugXqZDyRv8r1SR4SQnWpaxsDorKjapZPiTNoZIjHQssF8xQJ65fdsKtWNaglp NVmIy764/iF8/2n5RPgWU0lT6xKDJU+fuVpRvU2sXHljf/1se0sJIJmVa04iig+V/1Q8 2lVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XSq9T581; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id kb4-20020a17090ae7c400b002871b0b4a11si6900093pjb.61.2023.12.11.13.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 13:31:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XSq9T581; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2E4D580967B1; Mon, 11 Dec 2023 13:31:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344937AbjLKVbn (ORCPT + 99 others); Mon, 11 Dec 2023 16:31:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230073AbjLKVbm (ORCPT ); Mon, 11 Dec 2023 16:31:42 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AE70CE for ; Mon, 11 Dec 2023 13:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702330307; 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; bh=3m2lRSq/x6O1AvE2D5Tmo4LBWE3DJjeKHdxsqLlOX9k=; b=XSq9T5819UXeCy2oCcVbcqkO/PEl5Xy3hWna1/qq4FdejdYPoNVKW98uZ5ksKSscY8kCuB vfSMMXVFtIZCjRfXRqN4MfFACaEHeLp5KzIUWQKTPjCm9n6dIBCo4tGpiqCAePaDLpG5KO G3i5untxB/se+NGqsAnMHJ/MUFV1aHE= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-OgT3NVCfNTqrN1w6xMuSAg-1; Mon, 11 Dec 2023 16:31:40 -0500 X-MC-Unique: OgT3NVCfNTqrN1w6xMuSAg-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-67aa2707000so70442456d6.3 for ; Mon, 11 Dec 2023 13:31:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702330299; x=1702935099; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3m2lRSq/x6O1AvE2D5Tmo4LBWE3DJjeKHdxsqLlOX9k=; b=mp9Ged/8CS1pXsRMWZ7i4um4+vpQzU9LAFwiMzHEzT7VfRfV0O7hKzSkN898PqMuE5 9nrn8D2SW99A9dSuLoGUPPAUwSBw+AVkJkserZeXy+Ezaz4yS6hd9wDLMCdaRTNBs2ot yJfuSfYx6zCJABut+QaOIbr0N6lCox3vQRnxwXKVV0VY+H+VOU0Qq4+BxuQ7Vg8I4QiG Yopqm+lKGNChQq/WvE2C6Ws8Rh+jw2umyLLhg0W9xgt1X5HZvoRd0f/oFv/yjUL2d+FA /9zVOSBHqhN30LM2l9wyoMLUxUzsHbmp66hG+h7BbDN4whOXlo2HllEu5MGf747U+07a o9XQ== X-Gm-Message-State: AOJu0YyNXGgh/NRabNvV6Pd8id4BZI2lM5Tm8rVS2nEHC4Z6+2tHXY6r xVyPlTlVtcvtjzVn9oRTbf587WJbbBDM5W7/9h29sPoRaWgs8jBbd2nomaO+3LPpWGh2PNdXbW1 k68dhP4uoPsYPXGrngT4rYTY8 X-Received: by 2002:a0c:fb42:0:b0:67a:98bc:4b45 with SMTP id b2-20020a0cfb42000000b0067a98bc4b45mr6325899qvq.25.1702330299795; Mon, 11 Dec 2023 13:31:39 -0800 (PST) X-Received: by 2002:a0c:fb42:0:b0:67a:98bc:4b45 with SMTP id b2-20020a0cfb42000000b0067a98bc4b45mr6325895qvq.25.1702330299614; Mon, 11 Dec 2023 13:31:39 -0800 (PST) Received: from [192.168.1.164] ([2600:1700:1ff0:d0e0::37]) by smtp.gmail.com with ESMTPSA id t18-20020a05621405d200b00677a12f11bcsm3579945qvz.24.2023.12.11.13.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 13:31:39 -0800 (PST) From: Andrew Halaney Date: Mon, 11 Dec 2023 15:31:17 -0600 Subject: [PATCH net] net: stmmac: Handle disabled MDIO busses from devicetree MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231211-b4-stmmac-handle-mdio-enodev-v1-1-73c20c44f8d6@redhat.com> X-B4-Tracking: v=1; b=H4sIAKR/d2UC/x3MQQrCMBBG4auUWTvgxBKCVxEXMfOrAyaRpJRC6 d0NLj8evJ06mqHTddqpYbVutQzIaaL0juUFNh0md3YXcSL8mLkvOcfEI+sHnNUqo1TFysGJDwo fko80Ft+Gp23//Y0KFrofxw8QHoykcwAAAA== To: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Giuseppe Cavallaro Cc: Andrew Lunn , Serge Semin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Halaney X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 11 Dec 2023 13:31:57 -0800 (PST) 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 --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 8 +++++++- 1 file changed, 7 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..a39be15d41a8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -591,7 +591,13 @@ 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) { + if (err == -ENODEV) { + /* The bus is disabled in the devicetree, that's ok */ + mdiobus_free(new_bus); + return 0; + } + 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