Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp659347pxv; Thu, 15 Jul 2021 12:44:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc1qM30T91wK1zm+5Oz3pUsfWuvp1yeplZx4us4xysA+kLqyC9iOGHifdEF5leYlwrcitW X-Received: by 2002:aa7:d143:: with SMTP id r3mr9382503edo.110.1626378247480; Thu, 15 Jul 2021 12:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626378247; cv=none; d=google.com; s=arc-20160816; b=N3q2MgSChI9QZUG0O2FjVTb0dDPOqSZWkZ3WAyyFPd7GJSE/q5DbtJzfkTgLrVUKjS DwcL0NDRfRXxTW9my2uxFPzR+EqkjYMf4A9JxOItHBL91WRnsLRk+xW4dughgZ/0GN81 v3fytoLY3jFqfpudQkY2p0XcszXtCNTjQigXl9KS5Amaa0bmDRw0aAIp5qIdvEs/PTjp aRsUtGh4643db/C6GGJP7yXIWbfQgrULdlpFVWbwkaXt68XurjM+/tKTAgsiPXNdfjkX lk6tDKquD2swjX3CB+Rtx8O/Nd4YtnjnA9nUS8HCHkaFU7Mk+5N5qQZdr9gy5nyVDRnk tFBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dpxCoi/w5jwvFCvC7KgqUH19PPuxkOYA5k/dqeH75pc=; b=MHi792JTBwQb6qamM+L4+n7quIYKaANU1NKc7DN6I1SD49WBR3l8bAsF5f8pb0Zpe4 8jOztSGkYjdYH6ZTVl647G6Xz3svSih2utWM/O/cNZwii5Sdg3aXlM8tnI77iFwivnSf 622dhrqCtGGpfQMhr3kIPkqAjJ4TwP3X7Pghzqutf9g7iTncgrLatZrvp7Nb0BTGn1B8 4wod/fhC3chbIYEaC9c/yLf8aLBUjqMSnmF7s2Ne5kLqgpI5xwpg0VNQVBkldwMEKsTr evsMbGQctjFtTLpoAFMGtk+EXOb9DXk3JBuWr2u2VqMBUKI0hZ8CyIEemMINYAmODZtR sxRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tZlr0OpE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m21si8813953edj.470.2021.07.15.12.43.43; Thu, 15 Jul 2021 12:44:07 -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=@linuxfoundation.org header.s=korg header.b=tZlr0OpE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345573AbhGOTpJ (ORCPT + 99 others); Thu, 15 Jul 2021 15:45:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:51194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241982AbhGOTPR (ORCPT ); Thu, 15 Jul 2021 15:15:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EA09A613D8; Thu, 15 Jul 2021 19:11:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376304; bh=ga9rDqtOYP4wQU5Pni8aPHOc48dTY08A9TqBMp22c9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tZlr0OpEDyRTYGJzVodLDt0rjAdX6Q3lu8FBLvsmV1KWZojdENZDnNn6nEwx2GcWE JpfOaWF8UsKOqFxBYaBjkOQSWwdlyGoZLS/xK1ESIuZCuAtD9K+FE4miiGjunT97xL VVQtTyz6mJBxaDWgsOYMdOangFgGBfP/iKfSB2U0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roman Stratiienko , Samuel Holland , Daniel Lezcano Subject: [PATCH 5.13 215/266] clocksource/arm_arch_timer: Improve Allwinner A64 timer workaround Date: Thu, 15 Jul 2021 20:39:30 +0200 Message-Id: <20210715182647.525008798@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Samuel Holland commit 8b33dfe0ba1c84c1aab2456590b38195837f1e6e upstream. Bad counter reads are experienced sometimes when bit 10 or greater rolls over. Originally, testing showed that at least 10 lower bits would be set to the same value during these bad reads. However, some users still reported time skips. Wider testing revealed that on some chips, occasionally only the lowest 9 bits would read as the anomalous value. During these reads (which still happen only when bit 10), bit 9 would read as the correct value. Reduce the mask by one bit to cover these cases as well. Cc: stable@vger.kernel.org Fixes: c950ca8c35ee ("clocksource/drivers/arch_timer: Workaround for Allwinner A64 timer instability") Reported-by: Roman Stratiienko Signed-off-by: Samuel Holland Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210515021439.55316-1-samuel@sholland.org Signed-off-by: Greg Kroah-Hartman --- drivers/clocksource/arm_arch_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -365,7 +365,7 @@ static u64 notrace arm64_858921_read_cnt do { \ _val = read_sysreg(reg); \ _retries--; \ - } while (((_val + 1) & GENMASK(9, 0)) <= 1 && _retries); \ + } while (((_val + 1) & GENMASK(8, 0)) <= 1 && _retries); \ \ WARN_ON_ONCE(!_retries); \ _val; \