Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6654774ybn; Mon, 30 Sep 2019 01:21:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOZ5ag12vhaF0TCyEYGScN3UgGZLENtmKnNxM8OKxrXP+KBRV0JcSn4C888m9n1XUn/01O X-Received: by 2002:a50:91d8:: with SMTP id h24mr18031972eda.61.1569831675343; Mon, 30 Sep 2019 01:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569831675; cv=none; d=google.com; s=arc-20160816; b=Aq+JKbDQHEPicmwZex+7jnHHd+BksIvzyIiT/yS8z/534ZTc3aaSO4K/FZ1oyl61LU EOFYVbzkFk0B32qJ1X9U0cJCj5Si1458RZ9EsTUzyZzvPQp1d3QYoe/qISE0gJN72ZX1 NhPqf9cC5dh9hq2LkIkG82yitZtQp6C1ocryYblJoWHO5NlM6dP9/1SUhdmrzQ5qVtu5 +iHlMR9MtOqpGVBq9gWaGdXs69Zm+KZkxBMrB5jG20J4dWDmimrfiyIJvSV/RfWMj7tm niMIlcFS1dmmZGHgjgPUbhEWcR5BpkXnT7/UjXJte3xahTqqxKE+DgfF3HWN3xVQElef 1S5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=594fsXPnRs/ltKjAuFAWE5+VgqQGFjeDWqzFG5SApiM=; b=Q2l5xUK9bcqkQBIi04Daew/Fu0C4rbAiPuEiuV1+JmzBksxhPHVLYgmsFn1bIAqh61 vX2Z8LsmtZaMrM5WFP54BhXyc/FKddo2ufOZYs7Tt9f6wCM+9USBAfshgED+knJF82qL S8vO1fkx6bN04GFAF9yWxker801nEe62IQX3z6B9S5NDHYZ65wL6P2EIqjK3LM3wxkAO y9dLmyb6GXccnQsblkK8tSGqgwaIvTrPpSrrZ+Zq1h2D9MzaErpQD0UCyJoEWbADJYbO p/twxGoRx8AqdjoY7YTsw/6EHgIqvSHbkaMv/tw1/ILBODo/NgeJHYm3wJEUxihBKj08 H4Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Kzw3waQE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oz19si6620166ejb.93.2019.09.30.01.20.51; Mon, 30 Sep 2019 01:21:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Kzw3waQE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730151AbfI3ITz (ORCPT + 99 others); Mon, 30 Sep 2019 04:19:55 -0400 Received: from smtprelay-out1.synopsys.com ([198.182.61.142]:46082 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730027AbfI3IT1 (ORCPT ); Mon, 30 Sep 2019 04:19:27 -0400 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 2C859C037C; Mon, 30 Sep 2019 08:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1569831566; bh=VsdVW+VCuIfZ9PxVxUbdgy4kpT/QeuAHKi9XUjOtZD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=Kzw3waQETCU/A0RcuxbLrk/MUiGKZ7IhDthDyr/vWbsCHXayfKVcOpeintm6YM2Q7 l6xkUCr006LClfeEx9HEX4LaO5Nwz8l0zCIETOPhsypUxOFxxMQgoebMCd1JhFiuRv fOwuNYl8hNa0/99nNybQFdqF4a4avPDtSGnxQ+4WovB/nLpU9+0TcYiN7HFgnjT4kt frOSOaZRcbRdDVFBTDgTwu3RWOtglEWEy29X+0N5fJwgdNWkV4Mti2uM6ATkpl0LXR LyyiUnpdQKQggIrPIJ7NzXHb8GmHGBVuwNOGMaGGVWu+n45nxm1UABNeKDSyEuQS+Q 1CFp/9yjmtVtQ== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id AA895A0091; Mon, 30 Sep 2019 08:19:23 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Cc: Joao Pinto , Jose Abreu , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH v2 net 9/9] net: stmmac: xgmac: Fix RSS writing wrong keys Date: Mon, 30 Sep 2019 10:19:13 +0200 Message-Id: <8879f74a8cc5dffdb14d553c321d64c63ea9fe2d.1569831229.git.Jose.Abreu@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit b6b6cc9acd7b, changed the call to dwxgmac2_rss_write_reg() passing it the variable cfg->key[i]. As key is an u8 but we write 32 bits at a time we need to cast it into an u32 so that the correct key values are written. Notice that the for loop already takes this into account so we don't try to write past the keys size. Fixes: b6b6cc9acd7b ("net: stmmac: selftest: avoid large stack usage") Signed-off-by: Jose Abreu --- Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Jose Abreu Cc: "David S. Miller" Cc: Maxime Coquelin Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: Arnd Bergmann --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index 4a1f52474dbc..5031398e612c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -523,8 +523,8 @@ static int dwxgmac2_rss_configure(struct mac_device_info *hw, struct stmmac_rss *cfg, u32 num_rxq) { void __iomem *ioaddr = hw->pcsr; + u32 value, *key; int i, ret; - u32 value; value = readl(ioaddr + XGMAC_RSS_CTRL); if (!cfg || !cfg->enable) { @@ -533,8 +533,9 @@ static int dwxgmac2_rss_configure(struct mac_device_info *hw, return 0; } + key = (u32 *)cfg->key; for (i = 0; i < (ARRAY_SIZE(cfg->key) / sizeof(u32)); i++) { - ret = dwxgmac2_rss_write_reg(ioaddr, true, i, cfg->key[i]); + ret = dwxgmac2_rss_write_reg(ioaddr, true, i, key[i]); if (ret) return ret; } -- 2.7.4