Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965466AbbLOU73 (ORCPT ); Tue, 15 Dec 2015 15:59:29 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:38014 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932443AbbLOU72 (ORCPT ); Tue, 15 Dec 2015 15:59:28 -0500 Subject: Re: [PATCH] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value To: Jisheng Zhang , tglx@linutronix.de References: <1448466169-5230-1-git-send-email-jszhang@marvell.com> Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: Daniel Lezcano Message-ID: <56707F32.3030405@linaro.org> Date: Tue, 15 Dec 2015 21:59:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1448466169-5230-1-git-send-email-jszhang@marvell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1032 Lines: 34 On 11/25/2015 04:42 PM, Jisheng Zhang wrote: > Let's assume the counter value is 0xf000000, the pistachio clocksource > read cycles function would return 0xffffffff0fffffff, but it should > return 0xfffffff. > > We fix this issue by calculating bitwise-not counter, then cast to > cycle_t. > > Signed-off-by: Jisheng Zhang Hi Jisheng, I tried to reproduce this behavior on x86_64 but without success. On which architecture did you produce this result ? Do you have a simple test program to check with ? Thanks -- Daniel -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/