Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp668884rwd; Wed, 7 Jun 2023 05:31:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7knE1GZQIuq8Yc+hNpxC3miVO02T2Px5AwwpGBLjNw2eezEShR0B0djkcjNHp+dipcvGq/ X-Received: by 2002:a05:620a:211c:b0:75d:117:1d8 with SMTP id l28-20020a05620a211c00b0075d011701d8mr1585093qkl.40.1686141065328; Wed, 07 Jun 2023 05:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686141065; cv=none; d=google.com; s=arc-20160816; b=eIjgXcCftANplXt9OcIBDDmRmpl/0D0VcK4olE98nVor42IU2h+a+FtCQBIs//kbfK Nrgh2gP2C/8AzdtbARsz/LSmQC59C3ZXNwlUSQwxc0S9sQzB671jsAgq2EKttTuzJmtT xPN0kv/rvGSOYijoqogtzunH4OTpKZkJiUXbz1xQec/7QHQQcVd2rcNaeTSh1hThDSMq AyzWof+r2Xd6cguyIF6R5TpFVlnBNDtBCLvP9fxSx1GH1K38TrJiYLjCzmWWcMu3nwxH JYZu9pIYhjeqchyalvOhMcSD5pBZ/TC8EcuecoKcCylV18f49f2xON4iR0h4h2R9UVM7 01vw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GrgFo3H2q3uXB3KxPepXLazZqm3F9wUP/Ceq11kw4Q8=; b=pRRHQhMBBFnU2FG52O+9n2nr6Oq/v2c/rL4s50lswjQjCmdRaIRshcXVdQdFLQkoja uIePHTHmA7TBp/z9G26jWCMVggMf377FUZ6O4PYfxSpsqwqh9qYwBEkS3m/1w/sqbTyY a2fCHXztHXv0PTOVwSBaze+z5DGHONkc9W9bveW0Mn42dk2JnaypTD099xXFleufmUk8 2D75kBFjbkaFXM10g0odRqEVaqOvk8ev9SMcZV0IHdXnjedANQqFaYWtCuGDa/dtiffk Fwf5FkysLOwj6gFE5k3SqY8S0xdRL8iVG0Q67f6KZqe99Te8Y/z4Q8qKdlnocG6iOv7N 9yZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=nm3p9FV5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il10-20020a17090b164a00b00259ae9b9fbdsi1089285pjb.21.2023.06.07.05.30.46; Wed, 07 Jun 2023 05:31:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=nm3p9FV5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240521AbjFGMJJ (ORCPT + 99 others); Wed, 7 Jun 2023 08:09:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240544AbjFGMIc (ORCPT ); Wed, 7 Jun 2023 08:08:32 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 603191BE6; Wed, 7 Jun 2023 05:08:29 -0700 (PDT) X-GND-Sasl: maxime.chevallier@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686139708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GrgFo3H2q3uXB3KxPepXLazZqm3F9wUP/Ceq11kw4Q8=; b=nm3p9FV59L0k4MrGfuiIlocHxtlxOZzyPfwuLhO6PHUtoWG0jIeVTzi63C4dLmHlIzmhWP HC4I3WsB1dkwCA37y5K9fl2xlurC93+5OeM7N9Hc9mamvRkgaElDfx846Rbhu39HgBoPnN eoU+89Wdvfu06pVv6cDMjU9DtJQ6vMpPDlIdOjhi+WuMfGwGQxRtKljK+tMB7YExKjjmKf IZg0cjpAgq8eazVFhPUh3vHZy1fsravHOhrgVo6zhIA7Zl6oauZcN7bf8T0X3+ymndnRHO 6/BN+g5frqE7XVHKTSlsbV7ggCya8VnZlWSs2CoA/OL6ZcWWBRuMYFOtprcezA== X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com X-GND-Sasl: maxime.chevallier@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 94C32E0007; Wed, 7 Jun 2023 12:08:25 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, alexis.lothore@bootlin.com, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Florian Fainelli , Heiner Kallweit , Russell King , Vladimir Oltean , Ioana Ciornei , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Maxime Coquelin , Jose Abreu , Alexandre Torgue , Giuseppe Cavallaro , Simon Horman , Maciej Fijalkowski , Feiyang Chen , Russell King Subject: [PATCH net-next v4 5/5] net: dwmac_socfpga: initialize local data for mdio regmap configuration Date: Wed, 7 Jun 2023 15:59:41 +0200 Message-Id: <20230607135941.407054-6-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230607135941.407054-1-maxime.chevallier@bootlin.com> References: <20230607135941.407054-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Explicitely zero-ize the local mdio_regmap_config data, and explicitely set the .autoscan parameter, as we only have a PCS on this bus. Fixes: 5d1f3fe7d2d5 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver") Suggested-by: Russell King (Oracle) Suggested-by: Maciej Fijalkowski Signed-off-by: Maxime Chevallier --- V3->V4 : Move pcs_regmap_cfg into a more local block, and zeroize mrc V2->V3 : New patch .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index 1fb808be843b..6267bcb60206 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -389,7 +389,6 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) struct net_device *ndev; struct stmmac_priv *stpriv; const struct socfpga_dwmac_ops *ops; - struct regmap_config pcs_regmap_cfg; ops = device_get_match_data(&pdev->dev); if (!ops) { @@ -447,19 +446,22 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) if (ret) goto err_dvr_remove; - memset(&pcs_regmap_cfg, 0, sizeof(pcs_regmap_cfg)); - pcs_regmap_cfg.reg_bits = 16; - pcs_regmap_cfg.val_bits = 16; - pcs_regmap_cfg.reg_shift = REGMAP_UPSHIFT(1); - /* Create a regmap for the PCS so that it can be used by the PCS driver, * if we have such a PCS */ if (dwmac->tse_pcs_base) { + struct regmap_config pcs_regmap_cfg; struct mdio_regmap_config mrc; struct regmap *pcs_regmap; struct mii_bus *pcs_bus; + memset(&pcs_regmap_cfg, 0, sizeof(pcs_regmap_cfg)); + memset(&mrc, 0, sizeof(mrc)); + + pcs_regmap_cfg.reg_bits = 16; + pcs_regmap_cfg.val_bits = 16; + pcs_regmap_cfg.reg_shift = REGMAP_UPSHIFT(1); + pcs_regmap = devm_regmap_init_mmio(&pdev->dev, dwmac->tse_pcs_base, &pcs_regmap_cfg); if (IS_ERR(pcs_regmap)) { @@ -470,6 +472,7 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) mrc.regmap = pcs_regmap; mrc.parent = &pdev->dev; mrc.valid_addr = 0x0; + mrc.autoscan = false; snprintf(mrc.name, MII_BUS_ID_SIZE, "%s-pcs-mii", ndev->name); pcs_bus = devm_mdio_regmap_register(&pdev->dev, &mrc); -- 2.40.1