From patchwork Wed May 29 07:02:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1106847 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=prevas.dk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.se header.i=@prevas.se header.b="Da5akzEi"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45DM8s3ps7z9sB8 for ; Wed, 29 May 2019 17:02:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726576AbfE2HCQ (ORCPT ); Wed, 29 May 2019 03:02:16 -0400 Received: from mail-eopbgr80132.outbound.protection.outlook.com ([40.107.8.132]:46729 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725895AbfE2HCQ (ORCPT ); Wed, 29 May 2019 03:02:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.se; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hDqI4gw6TsCCPEHj55g0+Qph0f44D3m90I0w3jUmyeY=; b=Da5akzEid+qHUJyqMD6RNjsJBK46VaGmqVxqg4eTiYgIqjE2v5c3q5CwiNh7cQkjBAVvzEBY47VAtl9UrZDzK8nPgjaEoozgn2Z8AP7ffZjwuLZWDIpcjU1a4zTf+GabMn7+gUBWumnDpdVyAyCfasYY5g0d5DtDxXRkIVnxcoo= Received: from VI1PR10MB2639.EURPRD10.PROD.OUTLOOK.COM (20.178.126.80) by VI1PR10MB2384.EURPRD10.PROD.OUTLOOK.COM (20.177.62.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.16; Wed, 29 May 2019 07:02:11 +0000 Received: from VI1PR10MB2639.EURPRD10.PROD.OUTLOOK.COM ([fe80::8844:426d:816b:f5d5]) by VI1PR10MB2639.EURPRD10.PROD.OUTLOOK.COM ([fe80::8844:426d:816b:f5d5%6]) with mapi id 15.20.1922.021; Wed, 29 May 2019 07:02:11 +0000 From: Rasmus Villemoes To: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" CC: Rasmus Villemoes , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH net v2] net: dsa: mv88e6xxx: fix handling of upper half of STATS_TYPE_PORT Thread-Topic: [PATCH net v2] net: dsa: mv88e6xxx: fix handling of upper half of STATS_TYPE_PORT Thread-Index: AQHVFexwewLvjBXjCUSJ0awhE0fnMQ== Date: Wed, 29 May 2019 07:02:11 +0000 Message-ID: <20190529070158.7040-1-rasmus.villemoes@prevas.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR05CA0211.eurprd05.prod.outlook.com (2603:10a6:3:fa::11) To VI1PR10MB2639.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:e1::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Rasmus.Villemoes@prevas.se; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [81.216.59.226] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 228cee14-80f4-4111-5f91-08d6e4039273 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:VI1PR10MB2384; x-ms-traffictypediagnostic: VI1PR10MB2384: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 0052308DC6 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39850400004)(396003)(366004)(136003)(376002)(189003)(199004)(66946007)(4744005)(66556008)(72206003)(64756008)(66446008)(2906002)(6486002)(66476007)(81156014)(186003)(8676002)(71200400001)(8976002)(478600001)(5660300002)(66066001)(71190400001)(6436002)(81166006)(53936002)(26005)(50226002)(54906003)(14454004)(44832011)(99286004)(36756003)(316002)(486006)(1076003)(74482002)(42882007)(7736002)(305945005)(14444005)(4326008)(2616005)(3846002)(6116002)(110136005)(52116002)(6512007)(256004)(25786009)(68736007)(73956011)(102836004)(8936002)(6506007)(386003)(476003); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR10MB2384; H:VI1PR10MB2639.EURPRD10.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: prevas.se does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: o3iAtRBr3sfWvoeY2+AGLIZqC2hTk+Rb5wtvhgafsG6SJLx3diB+f0sfn2AiTdTdLr9a2LTXbrAMHVoKhw0YkmqtHe3TAIcxFshSkT+lxfza74Oqb4t903YNJ1MZLCvSkQFOjncU5vPPeGtxnFVioYxcEfgxl9EwnMQXigDNm/t1K0xI+/TGj8xKKTCIS0aEIt6c72iASqZ5MKb0kA7MQmcz5ERtl7IBHQf2Ccy2re1Kb8PE7wpUJNZLh6k8sJbBTNcpKz75jA6EYeIE8enjWSmx5T+49m2IPiX0X+7i+KGuDMDJ8HWFwlRJqjnmSFMOXtRybFlw7gPFBh/Z+6sWH/ApljvfgWpLs0EPTz0yzdeoTpCpi0AnwaTkbBB0raTfT1dXoUPYH0qanlU2knnEJawA3+BzBkAGB4KSZY+zJDI= MIME-Version: 1.0 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 228cee14-80f4-4111-5f91-08d6e4039273 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2019 07:02:11.5821 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Rasmus.Villemoes@prevas.dk X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB2384 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently, the upper half of a 4-byte STATS_TYPE_PORT statistic ends up in bits 47:32 of the return value, instead of bits 31:16 as they should. Fixes: 6e46e2d821bb ("net: dsa: mv88e6xxx: Fix u64 statistics") Signed-off-by: Rasmus Villemoes Reviewed-by: Vivien Didelot --- v2: include Fixes tag, use proper subject prefix. drivers/net/dsa/mv88e6xxx/chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 370434bdbdab..317553d2cb21 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -785,7 +785,7 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct mv88e6xxx_chip *chip, err = mv88e6xxx_port_read(chip, port, s->reg + 1, ®); if (err) return U64_MAX; - high = reg; + low |= ((u32)reg) << 16; } break; case STATS_TYPE_BANK1: