From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D077C4167B for ; Tue, 28 Nov 2023 17:27:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YScAjo8LhflRHGausc8o7GmeBEkS/MIHIlct/p7qUZo=; b=TmfFOFGg9K4F0Z DtXWfqLwF7B4c6p0M4LSDMQmBL0Z6ob9kWZNY5/SHx53nKG0Dbj1enOehX40HE1hlMcUygaAPftku FWB6Y1RP2239sh9bKoBDT6Eq8IbUeLiCLkoeOoJAkhUEEmL41zo9QfqLKaRNIt5pQ0SWNQk08oG1/ OWBHs8nTrOWGFrfw/g4b1JpOK6rq+L3NmLpJHrElcbO0iUJlZF9bKSbHxt6oMA3BpNkLBXu8ba+bF rmuXb2x13kOoAr5fNYqs8ajvHpxraEn2Bicoi8WJMnlQnx7+1/8gLdAIH73irsJOZgPFFQYvPXtVj pDC+JBFV0xz1vtYHGH9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r81rI-005wBZ-2c; Tue, 28 Nov 2023 17:26:52 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r81rF-005w9U-2M for linux-arm-kernel@lists.infradead.org; Tue, 28 Nov 2023 17:26:51 +0000 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 X-GND-Sasl: maxime.chevallier@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231128_092649_898556_1DAB0829 X-CRM114-Status: GOOD ( 15.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel