Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4950448rdb; Tue, 12 Dec 2023 14:19:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDzHzFDWZRQYTgPAvqO+odOn//+2a3az+YUH2Q8Y7ZGoLH23SykaIcWKggr1qTPXKg8ase X-Received: by 2002:a17:902:7787:b0:1d0:c986:8ac9 with SMTP id o7-20020a170902778700b001d0c9868ac9mr3209991pll.22.1702419549447; Tue, 12 Dec 2023 14:19:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702419549; cv=none; d=google.com; s=arc-20160816; b=00rojvocoAorECgOx4QLOt46hFu2SrCYnDB4jYPHjP6lYZNGpY4lXOhyMHabqI53hR aHJ8jDUZWwBrfAauUMTEmzbPCSLPh4uo15yl+vn/VgzAVrRGje7s+t4v9KSeO8UIAdmr B8Pu7GWmJT6/4mCokB42/vKkLvrxfoZK+GbLwXubQlkM/9CA49AJu6V19/kw/CZ2vc2I 0zxmd8/xVIScl48qqMPc11v6vNttsyXPGYt4tFvwjZtLJWgY8dO1pxsQjzaqEea5LmFd VkgN/BBejECmSbTYObC+85qyStCx7ieLY3BmLIjB7rlbQ/vxtVLIUg0IDgxCriLheAzG 9KCQ== 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=niWso/AgTSlNDKs+hLJfqSanWTgF91oEfLP5s9hKVlo=; fh=FRu6Z+wupocylkiQXAaQXkKeNABS7VrJYS+sYubhJI0=; b=vJBytIuYO9apBwFlqB83QmBnZ6YH9ojKiVLxVQSR/Imkre4lUxsphBLqiBsv7h1B6r PkItY7M9fBtXb9c0vjCiXz7gYsC4rvpLTryFraQ3NKiFu6MxiwB6Uo1YNLFdb+6WoSN0 slMAn0MsAW1B61QhIYyxUTglfmCKO5TN1pmoSE5D6hz9VXHUL0hZ+UB248/pGBjZX42F NXW5+vt0FP7DXYbOZ+rf9MchgzX/VfTDR9gXgdejPvrzzBG5S+oaNGKn0NX5QGf4osvz H0LSvbDQwSbjSt3zuh66gR/FfGlPSeqWXi08vQAjPIZH2N7/Gm8cAOjNdT3QAbSjst6W PY9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZgtQM8mS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id s8-20020a170902ea0800b001cfba8ff230si8590247plg.268.2023.12.12.14.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 14:19:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZgtQM8mS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id C83C080B2D4A; Tue, 12 Dec 2023 14:19:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377768AbjLLWSr (ORCPT + 99 others); Tue, 12 Dec 2023 17:18:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377760AbjLLWSo (ORCPT ); Tue, 12 Dec 2023 17:18:44 -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 09714BD for ; Tue, 12 Dec 2023 14:18:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702419526; 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=niWso/AgTSlNDKs+hLJfqSanWTgF91oEfLP5s9hKVlo=; b=ZgtQM8mSySScnanpslZXhtJJ3hfJKVfFEAz7Chqirh4BAWsx0TneYgUVA6I8f7HgX8BIPs /f9P0Iz/viliQb9vDlp/XvYcUTCcaWQ0B25kB20iF+vvZdQ3XKMA88TmsDCAGpGxFnTaXx IZx0uEkuVfayf66KCfucdJaGWqzclVs= 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-528-PGNFMIjaNoaFWeR6KP790w-1; Tue, 12 Dec 2023 17:18:44 -0500 X-MC-Unique: PGNFMIjaNoaFWeR6KP790w-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-67ab0fa577fso83888196d6.1 for ; Tue, 12 Dec 2023 14:18:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702419524; x=1703024324; 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=niWso/AgTSlNDKs+hLJfqSanWTgF91oEfLP5s9hKVlo=; b=M7BqvIJEnkFy7/FGdNbpqV/seYVoRt4tAPdNca2HNThywtZEoFaK5CTay/X9LU8qxB /Ca/1K31FDI+0CkHYch8wN/9jV+J7zd1kZlrjCoMlpXDrXTXWAz4baa9Yzg3q/EyWJ6Q gvGRL1HljuNLSgyqoRRQvHRXNEkNvZsJf8cSq2Lc4c9g7Id/oHUpcbU2L2ed5dvF7EPA gWpK+ct4v8Ap9cPlIDKExSJNPjf+7HDLDsgwzRuMU6mmvZ0g0zY+FQb4fdH5hbCqyTRf 9ocrJDJGx0pXlUWbNLoJjHOf5X54kL3OTRvXe9IDljyQHcPuwg0eiEXYXG6k6Q8XpNmS x1mg== X-Gm-Message-State: AOJu0YxxRIyaJFvxOysCQRTcVftA9aIi7YkU5xZO9l5okBjRmYOKFEzh OgPtQpVwLbL7+1z36Jys8bITvLe5PGRA58jXD6zL/VpEccPTo6Ou5H52Lk2nRtUNUBfRq4S97bT usZI0iAYt4j14plwTo2HYKR7D X-Received: by 2002:a0c:c210:0:b0:67e:f58a:d6b0 with SMTP id l16-20020a0cc210000000b0067ef58ad6b0mr226803qvh.27.1702419524251; Tue, 12 Dec 2023 14:18:44 -0800 (PST) X-Received: by 2002:a0c:c210:0:b0:67e:f58a:d6b0 with SMTP id l16-20020a0cc210000000b0067ef58ad6b0mr226790qvh.27.1702419524008; Tue, 12 Dec 2023 14:18:44 -0800 (PST) Received: from [192.168.1.163] ([2600:1700:1ff0:d0e0::37]) by smtp.gmail.com with ESMTPSA id uw2-20020a05620a4d8200b0077f103c8ad6sm4050578qkn.82.2023.12.12.14.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 14:18:43 -0800 (PST) From: Andrew Halaney Date: Tue, 12 Dec 2023 16:18:33 -0600 Subject: [PATCH net v2] 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: <20231212-b4-stmmac-handle-mdio-enodev-v2-1-600171acf79f@redhat.com> X-B4-Tracking: v=1; b=H4sIADjceGUC/42NQQrDIBBFrxJm3SnRBCtd9R4lC+tMGqFqUZGW4 N0rOUGX7z94f4fMyXGG67BD4uqyi6GDPA1gNxOejI46gxzlJKQQ+JgxF++Nxa7pxejJReQQiSt qKZQmVtoqAz3xTry6z5G/Q+ACSx83l0tM3+OyikP9V68CBV4mK0c7z6smdUtMmylnGz0srbUfm X3voM4AAAA= 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, Simon Horman , 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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 12 Dec 2023 14:19:07 -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 --- 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 --- 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