From nobody Sat May 4 14:25:23 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E5A0C77B7A for ; Fri, 2 Jun 2023 19:05:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237121AbjFBTF3 (ORCPT ); Fri, 2 Jun 2023 15:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237133AbjFBTFY (ORCPT ); Fri, 2 Jun 2023 15:05:24 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 788FCE76 for ; Fri, 2 Jun 2023 12:05:13 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-30aeee7c8a0so1879964f8f.1 for ; Fri, 02 Jun 2023 12:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1685732712; x=1688324712; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=If31y072xq4e6P4sxZ7wENONrwovu6qw7j2QcnCLwYM=; b=iw2od1eb1LLnTIiTck7tEolOQHlCSsiuiuK5Az1wQSsyQuGpmGKl+Ddz6oaTtYMOzE T5Pnesq+GFxqESCem3TjpoUlvFNgtO2PKO1B0wmLT590vpkWUz+hZIgTV49nhewaoPhO /R3iGhEYJouZbX9L1pxez8SCfqDXal7HKVE7A29/lYBlkkB14Z+itAmcRkIA7BlSJAZl iooncu6iVfqshI8TqaN7O8K152pq1VBbizt+FTAQSLTp9nsQ2Srm5C/AJJlUFwbKsC1K s3o/b2T4EwBTJ8ng314F/99Imw/npLH8nX8MwWUCryUxytFt+vMpaQRNOed9724L0UZZ LKzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685732712; x=1688324712; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=If31y072xq4e6P4sxZ7wENONrwovu6qw7j2QcnCLwYM=; b=i67HJEdbJLYasBiuI3PCGCB1w3EdVWtc4tytsNsbF2rHlPyltqDcLwrpYnx6N892O6 ncLw6VAg0V14RMB8UiVPZM3g5WrCBWvZM6ft5/wo9jY5Wa71bu9Y4jdnjkT/y7n8RsQK sx7eMfzCf3yrBBDJixDT1RYcaPGvKd/2m6KbuPa8BfrWA6ZOo0Hy4s5SwdTY7B8bOVVL BYeQ3W/DaluWXHisaYEIofPVyXoEC8cEN0uKeWBzo3W6tWW3jEdi9a0AkkMzQQ95Gs6T Ozv65JFSJ+zsvHU4sI4I+caFjrDJKTOn6kFTXN8Bg0ms3Dwh+wHoSx0ug5NFip/AtqnN C9DA== X-Gm-Message-State: AC+VfDysV/KsKxcEHujGkZBrq2mJn92apdhHvcltoIbB/h6LnWOVThnO Qq9fiJ7/OVB/VDgOSRtkCT0t3g== X-Google-Smtp-Source: ACHHUZ49cV0H3yp9vW9BOannfVeKeUwyqy/UKFpf4uPItZATZzhUiTC+cpJxJ2yN3zr/xYJXdhwL5w== X-Received: by 2002:a5d:6b0a:0:b0:2fb:92c7:b169 with SMTP id v10-20020a5d6b0a000000b002fb92c7b169mr585237wrw.10.1685732711749; Fri, 02 Jun 2023 12:05:11 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:7569:c0c0:3a0e:c54d]) by smtp.gmail.com with ESMTPSA id y8-20020a056000108800b002ff2c39d072sm2361029wrw.104.2023.06.02.12.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 12:05:11 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Andrew Halaney , Jesse Brandeburg Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH net] net: stmmac: dwmac-qcom-ethqos: fix a regression on EMAC < 3 Date: Fri, 2 Jun 2023 21:04:55 +0200 Message-Id: <20230602190455.3123018-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Bartosz Golaszewski We must not assign plat_dat->dwmac4_addrs unconditionally as for structures which don't set them, this will result in the core driver using zeroes everywhere and breaking the driver for older HW. On EMAC < 2 the address should remain NULL. Fixes: b68376191c69 ("net: stmmac: dwmac-qcom-ethqos: Add EMAC3 support") Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Reviewed-by: Siddharth Vadapalli Reviewed-by: Vinod Koul --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 16a8c361283b..f07905f00f98 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -644,7 +644,8 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) plat_dat->fix_mac_speed =3D ethqos_fix_mac_speed; plat_dat->dump_debug_regs =3D rgmii_dump; plat_dat->has_gmac4 =3D 1; - plat_dat->dwmac4_addrs =3D &data->dwmac4_addrs; + if (ethqos->has_emac3) + plat_dat->dwmac4_addrs =3D &data->dwmac4_addrs; plat_dat->pmt =3D 1; plat_dat->tso_en =3D of_property_read_bool(np, "snps,tso"); if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) --=20 2.39.2