Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5070795yba; Tue, 30 Apr 2019 08:40:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNYfttiWyZ8Fgn/opBVKUkuqfiJ/eIiMsuza56Roqirl/afbF8jTHANLMTFakhfm84QqTy X-Received: by 2002:a63:6988:: with SMTP id e130mr5292829pgc.150.1556638858672; Tue, 30 Apr 2019 08:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556638858; cv=none; d=google.com; s=arc-20160816; b=Go4vY0U73wLhOCMrBkjFwf82KrSsQ5B2blXVwBWLGVvyVhzzkwukZPJ/XCWSqsnIah vdFZ/vabSkjjK/npn1q//hZHs6jOWFIUKBgSgKxJT8KsuKoHm0Ds5/MCR7EPJmPw6bvH ALE3Wu8xEh1cFdOYUHagAMLJUKR/6Bnecw0wrbnmeA5bGfO86OzLNSORHtUI/mdIBJPG SPP5BEo7oQFFmdoNnF2e+r9b8oXpiCvycmwr7oOClBMZJX2PJxYCuWt0zIlTB0z/z7sG Tw/LZDo3K+ybWin38XqtFsS7eX7I/TwoYLdXmuQlKfwv3/3Sjot1vV30K03FBCCvHQkH /tQQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=cnd1okz/HJfciCw21aQ/opOt1Q4N1rvx9a3zSdHbvQs=; b=lUnM/kHg1rLnqTlCO58Zu/fVy73F3sfgCekyYmMht81SKNgQK1SIS4r4GAVCibmPjn T8gxefT/bXKUKMtrBQnipfJHxHoBwiDj1j7vRtjllz6ePFZMhimAcGKkuhX6L8IEPZJk JLyYVwS2AzcByMs6mTLU+rx9JEr9xyWcc0orHU3L6wjg650KbCwdiXsCf1TEN51kwYk4 CJnTNM9j3C1o3Im/MJ9aCOiltuWCHc8uRkpqCXHfY2gXLUUpoig4b1hi91mssl4r8U6m 288cT8wiTW8JxI14vj+7stg/+WXYQBsKrwyi+fTMzpmklUMWPwFLNhHCacJXmQEu5Bkc I+8Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si26101001plj.417.2019.04.30.08.40.42; Tue, 30 Apr 2019 08:40:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726197AbfD3Pj2 (ORCPT + 99 others); Tue, 30 Apr 2019 11:39:28 -0400 Received: from foss.arm.com ([217.140.101.70]:49334 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbfD3Pj2 (ORCPT ); Tue, 30 Apr 2019 11:39:28 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A4DA4374; Tue, 30 Apr 2019 08:39:27 -0700 (PDT) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E89353F719; Tue, 30 Apr 2019 08:39:25 -0700 (PDT) Subject: Re: [PATCH 7/7] clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters To: Marc Zyngier , Daniel Lezcano , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Russell King , Will Deacon , Catalin Marinas , Mark Rutland , Wim Van Sebroeck , Guenter Roeck References: <20190408154907.223536-1-marc.zyngier@arm.com> <20190408154907.223536-8-marc.zyngier@arm.com> <2a60a031-1eab-2d5e-89ff-b5d516545eeb@linaro.org> From: Valentin Schneider Message-ID: Date: Tue, 30 Apr 2019 16:39:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 30/04/2019 16:27, Marc Zyngier wrote: [...] >>> @@ -372,6 +392,7 @@ static u32 notrace sun50i_a64_read_cntv_tval_el0(void) >>> DEFINE_PER_CPU(const struct arch_timer_erratum_workaround *, timer_unstable_counter_workaround); >>> EXPORT_SYMBOL_GPL(timer_unstable_counter_workaround); >>> >>> +static atomic_t timer_unstable_counter_workaround_in_use = ATOMIC_INIT(0); >> >> Wouldn't make sense to READ_ONCE / WRITE_ONCE instead of using an atomic? > > I don't think *_ONCE says anything about the atomicity of the access. It > only instruct the compiler that this should only be accessed once, and > not reloaded/rewritten. FWIW 7bd3e239d6c6 ("locking: Remove atomicy checks from {READ,WRITE}_ONCE") points this out. [...]