Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3979348rdh; Tue, 28 Nov 2023 08:37:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvHDdlRF4ijZ2nVvdxleGQcFJX6qNEKZZSoU4bZwXQraAf9vsl1UX3BAej7ttOdQyKfbPh X-Received: by 2002:a05:6a20:9145:b0:18b:5a8a:4333 with SMTP id x5-20020a056a20914500b0018b5a8a4333mr16760445pzc.19.1701189471118; Tue, 28 Nov 2023 08:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701189471; cv=none; d=google.com; s=arc-20160816; b=zYLigcuegahBwmIo49zLTPx54qiKjOxt7BAkXxIg8l4W7/VskISEVXGjDsW8QUrGdd MAtHcEWinjX1IO7O4c5YglkD+kgc0gCpcfBYQBjFQHHg7TYDN71+hco07Tce1dEfmT/p uCT4Iy580N6XJ4EM1yHIjInLQE9znK910pDUdWRadvsSytxikNIevY1DYeS/v83TX6Js hwcy2nppWn0vc0mpCDdIBiLPRDTWu+ZBuFtoOoRpKq2uZ3Ddwn7cgVeQJ+8/7gwFppAF DaCsFX+Dz8P7KVh2anOObFyW8lmP8PSDptQf1pMW9hvDJGWR6y4XFeo3ApgSW2aQOPUf Gkng== 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=rFUp8aL5AaK6GjDSBIX/cd7crb+WCO19wYlvW6clkBE=; fh=tltoP5BBQyD1N8QQaWaEvzT1OVc3+OTOcpkIYldifbo=; b=h4ak2OSPgBIS59Nrml7IYB8CNU77jWgRKxfhFUamVfeSnedwPFlSEtCdmFLv/splBw SnmhP7FXWU67QhNv8tcz3aK61hjIw586boQqNp1sfh44rdi3cOK8r2JxMOnxjDbBIpYV L8xl4mbJG5CQXb1rsUNglokPkmmWmr53j8OGntbHXF+Ds7z+Uwu3KaCdpe29a59cRgyC C1WccjnI329od028FD8V1wUwzpE0CDxX60xnXwx1S9/uEego6/l2faoXCF00aSN7Q4Es dtiYhHULPeLUTZV7TIpfGRkaHYkuoYHRpdQyEOjH+wzGEr76SYfsp/tFv4sLYyoQP0Me w3rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ohfKZwKN; 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=lunn.ch Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id w32-20020a631620000000b005855f67e491si12556029pgl.696.2023.11.28.08.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 08:37:51 -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=@lunn.ch header.s=20171124 header.b=ohfKZwKN; 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=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id DF9D380A0574; Tue, 28 Nov 2023 08:37:48 -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 S1344457AbjK1Qhe (ORCPT + 99 others); Tue, 28 Nov 2023 11:37:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbjK1Qhd (ORCPT ); Tue, 28 Nov 2023 11:37:33 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16183D51; Tue, 28 Nov 2023 08:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=rFUp8aL5AaK6GjDSBIX/cd7crb+WCO19wYlvW6clkBE=; b=ohfKZwKNKJ4S2OyweVT6DzxqDw J8E8HPPRFTOGE+wwx7vHBjhIlLoEmeGXtfXhSGW5YiDO8+mjVG5ix3NBrEGxbJ4v9otJy3095sWPU JFPFcfvjO9VqMaJeh3fyJPw4EVBtxnfoa/fovwnz1+uwH5aZruCTruSH5NdAbfl1oG2A=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r815W-001TUQ-TO; Tue, 28 Nov 2023 17:37:30 +0100 Date: Tue, 28 Nov 2023 17:37:30 +0100 From: Andrew Lunn To: Maxime Chevallier 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: <50d318fd-a82c-4756-a349-682b867c0b8b@lunn.ch> References: <20231128094538.228039-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231128094538.228039-1-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 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]); Tue, 28 Nov 2023 08:37:49 -0800 (PST) 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; Same in socfpga_gen10_set_phy_mode()? Andrew