Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7260434imu; Wed, 14 Nov 2018 14:25:16 -0800 (PST) X-Google-Smtp-Source: AJdET5eHCetyYQUCmfSYe4vlWK56Vf/Pe2Wo3JAtxbvY0jU/yS4GLwwYzqtS4v+0eOBpCOK1QUK0 X-Received: by 2002:a63:e348:: with SMTP id o8mr3398512pgj.158.1542234315944; Wed, 14 Nov 2018 14:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542234315; cv=none; d=google.com; s=arc-20160816; b=0oGGdAYCGja7XP1U2chzWC2JcjsfMa+KvUabCYtQ4L4MT4awCvw6rpXunK0czGmUZn t6ha8g/xfwXvOAifZnHQcWeHS1GxDxWbpbMADoQskErNQk/aAcEOIjH3lvH9lhhWVJs0 glxOZgpYt6HDfm+wC64XhqDqR0HUsEtq4uRlSTZnheQZem61hv0QBTRO7tPurd88nL5a i7bnxvQaZMkkFzc2Raivmj3WDVsdpDLsXZyPNa47YBZB2IyJ/XUTKks/exNYPuz36273 JhU21SL+5gFwUfZhl/H8itsIjIib0HOg4VgKHeOCl3092iLVibabOxpu6UhcsR79AdVS NeaA== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=rzpWGtBNTOHvJ8+3+cMmVU26T3sOiu/B5yy2m/7FF6I=; b=s2k274qBtYyoKd2NH1N9p8tSP+VuPyUT+PsNGi52XG9uqoKJxJAYasFPE7S9wejI5+ NdxNzQq4jBIfBs2gwxbG6r3jkH7VryhDuRCRr6Bso3haiBaYAXcTH46aQg7r95YP580e O6tGIwqrnn/g8Hsp8tYaqJ29P0VHixWCuZiakOQLd82YFZCkCLgjHU4P5S5oRWMD4pr0 f/6eBycB61gzbb8FqAwMwzgw3/kq32ad3ItnwAm4fXytK1e6mNtY64L3TgescC+oWCko 5zpp/jFXJuW44VVZYXOivZqA3GH+Wms8b4+uHJ2JToPr17LA76r3KtCQeg+VLiXBSTUA lT6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gbNvf99u; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si14588889pgd.88.2018.11.14.14.25.01; Wed, 14 Nov 2018 14:25:15 -0800 (PST) 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=@kernel.org header.s=default header.b=gbNvf99u; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732655AbeKOI13 (ORCPT + 99 others); Thu, 15 Nov 2018 03:27:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:34416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729087AbeKOI13 (ORCPT ); Thu, 15 Nov 2018 03:27:29 -0500 Received: from sasha-vm.mshome.net (unknown [64.114.255.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 20A0B2252E; Wed, 14 Nov 2018 22:22:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542234146; bh=H/UGnmYha20ZnbhlLz21yxKncy7PmtyJNaaQCUt9mZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gbNvf99u9MDjqY0yS7SZBlwAiBe72zLiy9Yj4ENR9pVk2AUQNvJwB8rFALCLYYccF zyKB/rqWUmlWU7izUMHrn8oxLcbQZNtKJj0cZlXoF6Tf5rFsKnCqpvkGuKoPnAZh5A 5z2IuZq8yAyhIjVr3uXT1HPjqtjD91CY/95JoJqo= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andrew Lunn , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.19 73/73] net: dsa: mv88e6xxx: Fix clearing of stats counters Date: Wed, 14 Nov 2018 17:22:07 -0500 Message-Id: <20181114222207.98701-73-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181114222207.98701-1-sashal@kernel.org> References: <20181114222207.98701-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrew Lunn [ Upstream commit a9049ff9214da68df1179a7d5e36b43479abc9b8 ] The mv88e6161 would sometime fail to probe with a timeout waiting for the switch to complete an operation. This operation is supposed to clear the statistics counters. However, due to a read/modify/write, without the needed mask, the operation actually carried out was more random, with invalid parameters, resulting in the switch not responding. We need to preserve the histogram mode bits, so apply a mask to keep them. Reported-by: Chris Healy Fixes: 40cff8fca9e3 ("net: dsa: mv88e6xxx: Fix stats histogram mode") Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/dsa/mv88e6xxx/global1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/global1.c b/drivers/net/dsa/mv88e6xxx/global1.c index d721ccf7d8be..38e399e0f30e 100644 --- a/drivers/net/dsa/mv88e6xxx/global1.c +++ b/drivers/net/dsa/mv88e6xxx/global1.c @@ -567,6 +567,8 @@ int mv88e6xxx_g1_stats_clear(struct mv88e6xxx_chip *chip) if (err) return err; + /* Keep the histogram mode bits */ + val &= MV88E6XXX_G1_STATS_OP_HIST_RX_TX; val |= MV88E6XXX_G1_STATS_OP_BUSY | MV88E6XXX_G1_STATS_OP_FLUSH_ALL; err = mv88e6xxx_g1_write(chip, MV88E6XXX_G1_STATS_OP, val); -- 2.17.1