Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4876499pjb; Mon, 27 Jul 2020 07:23:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXh6LfJtLkeQpoTFymvU8m8aNcV3ylU3RNsd19EzzeZ9r8RmnuJ3VqhvoRC8DDCTSOf/wy X-Received: by 2002:a05:6402:8d6:: with SMTP id d22mr14864947edz.285.1595859805944; Mon, 27 Jul 2020 07:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859805; cv=none; d=google.com; s=arc-20160816; b=BP7szV9lT/kkKa777md3AL5+3jK+YKVP82xyvP0534tDWj6y5ML9EcK4iw6DUH9XbW dPXIPPENHzDaan3F21LFR5SsPpBPOW56h7IMxLTfXpVMu+uvERb23yuN0nmihd+FvIWY 36Gv/Xdkq7xXXMFACP0FbV66mPDTL/Ez5QFEKh46KSghcr/O9AYHUuZp4GNI8wp23lye M7pxzQAZJxrKd3t4ssa7dJnYkt5qgTpVEQIsM+IMRqfwzwjandYYhulYTzfV9eTlh+Fx JsmUckTzcz2x931/hXxZCBxQb0Ofh0YtATzWf6BbtG3aYIvsAvVDHv040dQs8qz/ukAT iycQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=b8sC/DG8U/+WHP/mqRQ12F9qvk7Lg1rFW8pjAusmtBU=; b=Mj6KgR2bW3O+F+6dmbZMY1WruxoJzqZ4ccFzOXcAdnh5RQTWsWVS/deqY8Ve4f+lnu 9zsvZJ/8CMgq8VLeM9Ca1GGTFiUuUA+2rV9Oq+yx9bWR0s5ZCFH7izfTfTnUwKRX06KD wqGOePijqlVcDz3QwWxoHAPy7pSnnIVQ9zPod0ra7q/LmDlllciFdBSEE4uNe0iilXi1 F1AlCgsfLudgZQNh6Eex07Q1/85aC2IHOJHR5He0TzJCCZ3t4OCEnBqA5TpQRXM7v5Wn Oa8qqgZGhaBD7ie8hzbOUfge9cV2rycrXdYdc8LCxGevnxOqMHYF5juHDdAzrXvwOkOE ey6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="yB/zpXSP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si5576955eja.81.2020.07.27.07.23.03; Mon, 27 Jul 2020 07:23:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="yB/zpXSP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731773AbgG0OVk (ORCPT + 99 others); Mon, 27 Jul 2020 10:21:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:50302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730258AbgG0OVi (ORCPT ); Mon, 27 Jul 2020 10:21:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7153F2070B; Mon, 27 Jul 2020 14:21:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859698; bh=aJMqigb34Dubd5tY2sT5LEuMGU4M7GKg1c09Z+B65LA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yB/zpXSPQaLm2UVv7v1F7Uvdba7NrPf6b0Djk6ogpiGyUohiZSZ9xvMw6at4z+h59 cV4QnIWD0XjS1EhfYM1e+Zs/apXDXEJBKpCEVIrYZKEvvl05hpDJ38MgCf3H11vmzb XWNh25an7srSAPkcoytFAPe0cj5U/zPN+b9n7dJ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shannon Nelson , "David S. Miller" , Sasha Levin Subject: [PATCH 5.7 070/179] ionic: use offset for ethtool regs data Date: Mon, 27 Jul 2020 16:04:05 +0200 Message-Id: <20200727134936.091115895@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shannon Nelson [ Upstream commit f85ae16f924f92a370b81b4e77862c1c59882fce ] Use an offset to write the second half of the regs data into the second half of the buffer instead of overwriting the first half. Fixes: 4d03e00a2140 ("ionic: Add initial ethtool support") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c index 22430fa911e2c..63d78519cbc6f 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c @@ -102,15 +102,18 @@ static void ionic_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p) { struct ionic_lif *lif = netdev_priv(netdev); + unsigned int offset; unsigned int size; regs->version = IONIC_DEV_CMD_REG_VERSION; + offset = 0; size = IONIC_DEV_INFO_REG_COUNT * sizeof(u32); - memcpy_fromio(p, lif->ionic->idev.dev_info_regs->words, size); + memcpy_fromio(p + offset, lif->ionic->idev.dev_info_regs->words, size); + offset += size; size = IONIC_DEV_CMD_REG_COUNT * sizeof(u32); - memcpy_fromio(p, lif->ionic->idev.dev_cmd_regs->words, size); + memcpy_fromio(p + offset, lif->ionic->idev.dev_cmd_regs->words, size); } static int ionic_get_link_ksettings(struct net_device *netdev, -- 2.25.1