Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4013758rdh; Tue, 28 Nov 2023 09:27:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAW+A8Wp8QmDU68MWvQcnQ8j1Rcri8ySrf47TcZMELk4WtGt0TOE3NCbYeGUxgSBxBXMzh X-Received: by 2002:a17:90b:180a:b0:280:a464:e9d4 with SMTP id lw10-20020a17090b180a00b00280a464e9d4mr14282404pjb.8.1701192423975; Tue, 28 Nov 2023 09:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701192423; cv=none; d=google.com; s=arc-20160816; b=WfRBuBalUUuUbgSe7wNCOvq/JQpgRwrujULDhxTfuwIwn8hMhEDpYR9XxwtVhBtzfW E3+ozkdtWwxO5BY9TH+EalAUdLwXDmcSJO0Z3sjetSO0a4F1TVPptYeQcJNrU8dxTYtl YztAsYbZKs2cQWUeCrWFfggAaRCT5ftoG2F0ye/xGrVGqe1onYG7AAmYi4Uj2I7M0H0M jyW9AdtuzBzveTk740lVXjFJJiSvafiL00+SZokOCHs5gFGOKUuRTMfywwS9xzhjJEvI ganSUYdHjvBZ5MGpKYCKoNntvKMOIlDK7+e3oJU6IR3D833Wd0Mq0XpF883zouG0Uprs TIpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=Bng8R5x/Jmq2SVxmDJwMSiwsK4vhqKDM3h6nqdBSV2s=; fh=9knkld/3OK0kaRt2fs7oRAUogM7cQw4mdbkdwN+Xr3I=; b=Dog7f5UNRZ/nfSXq4qrTl2IPOsioTvg6Zj6D52XdDvSDfG7kw8dPNsMd9wrxHXidZF 7JmuJxRRylwGQsrDQrWsfpb1ISCm1lK3IEjZPMMHlZoo3aT7q6z4Gz8ama7GEtyrHBqO Ni84ddygqzWtPhZTmlagC6wpw636SdS7Ydp/AZUTvFSFsb+M8bVF11FPt+NdnCkdk5Bx L4L3ZHF2DXATn73YZdRk8Zzwe8S1qVq+cGA+c7Wr/D185CQW77kq28+uJVrAFumn7N9J jFChj1zYyjhGN8WEMbvsaGQaN/gcbWO8f4mfmBvazNNxDVXc1/L0jPRFq7NF0d7vf5+J xOzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=AKK5qcPc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id mi16-20020a17090b4b5000b00285d8003bd2si4569417pjb.25.2023.11.28.09.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 09:27:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=AKK5qcPc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A9F408054ECF; Tue, 28 Nov 2023 09:27:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345317AbjK1R0k (ORCPT + 99 others); Tue, 28 Nov 2023 12:26:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230382AbjK1R0j (ORCPT ); Tue, 28 Nov 2023 12:26:39 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CC96E6; Tue, 28 Nov 2023 09:26:45 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D5DAB60005; Tue, 28 Nov 2023 17:26:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701192404; 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: in-reply-to:in-reply-to:references:references; bh=Bng8R5x/Jmq2SVxmDJwMSiwsK4vhqKDM3h6nqdBSV2s=; b=AKK5qcPcfM1hiW5bzr3BhkVuOFr724YPqPa74JpMexXiVIIJB8NpxTTx5iws+jqvFTmzKe spY8WrOUXoem/qgXMTVJ2910ttXabpuTGG70MuZp5z5dxN99O4e0PcyVI/8CNzzDK7J3J+ f1Zgd3K6cWN3DTLrkCj/pNHcg7nRF4dfaeQNz016qiFh4vNszeVlCdrSOvDdlNoqgYpm+P PD2N/3MCCql4071pAIpf1BRkJqTYm5tzprPYWkJlAj48bvJt3/Ccm5L5qbSZHuUsIAO+QB 6lOA9DMmFQYoQQaanpr3Z9ceucEwY881QiV9dW3Fe1r0jcmn2fr9WOQ1UX6MmA== Date: Tue, 28 Nov 2023 18:26:41 +0100 From: Maxime Chevallier To: Andrew Lunn Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Jakub Kicinski , Eric Dumazet , Paolo Abeni , linux-arm-kernel@lists.infradead.org, Alexandre Torgue , Jose Abreu , Maxime Coquelin , Simon Horman , linux-stm32@st-md-mailman.stormreply.com, alexis.lothore@bootlin.com Subject: Re: [PATCH net] net: stmmac: dwmac-socfpga: Don't access SGMII adapter when not available Message-ID: <20231128182641.7e2363c0@device.home> In-Reply-To: <50d318fd-a82c-4756-a349-682b867c0b8b@lunn.ch> References: <20231128094538.228039-1-maxime.chevallier@bootlin.com> <50d318fd-a82c-4756-a349-682b867c0b8b@lunn.ch> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: maxime.chevallier@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 09:27:01 -0800 (PST) Hi Andrew, On Tue, 28 Nov 2023 17:37:30 +0100 Andrew Lunn wrote: > On Tue, Nov 28, 2023 at 10:45:37AM +0100, Maxime Chevallier wrote: > > The SGMII adapter isn't present on all dwmac-socfpga implementations. > > Make sure we don't try to configure it if we don't have this adapter. > > If it does not exist, why even try to call socfpga_sgmii_config()? > > It seems like this test needs moving up the call stack. socfpga_gen5_set_phy_mode(): > > if (phymode == PHY_INTERFACE_MODE_SGMII) > if (dwmac->sgmii_adapter_base) > socfpga_sgmii_config(dwmac, true); > else > return -EINVAL; I don't have access to a platform with the SGMII adapter available, but my understanding is that we shouldn't error-out when we don't have the adapter, as some other component (like the lynx PCS) might be there to handle that mode. However you have a valid point in that we might want to check if we have either an SGMII adapter or a PCS, and if we have none of these we error-out. Thanks for the suggestion, I'll address that :) Maxime