From patchwork Mon Oct 5 15:26:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 268126 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 326E5C47420 for ; Mon, 5 Oct 2020 15:38:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE6C72075A for ; Mon, 5 Oct 2020 15:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601912339; bh=lX9O4hxvxd90v1IeDiyJoQVpOMMiA7ft8aBH2MqUH60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NIhgtqOWQk/cGy/ppuKEX5/7I+qksyw9SeU7M2jHfRSRyxIbgW3+KkVy0BkUw095y Xn0DQQR6j8DOl2BBRf6i1SzEDn4fmxbT5AEhpTP4b1E3XGroH7f0DttuT7t+dM4DbX oETohkCcpdwnxc+qTssX5cVs5FT5Yp9N9OENr0r8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727267AbgJEPas (ORCPT ); Mon, 5 Oct 2020 11:30:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:56522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbgJEPaK (ORCPT ); Mon, 5 Oct 2020 11:30:10 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA2D5207BC; Mon, 5 Oct 2020 15:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601911810; bh=lX9O4hxvxd90v1IeDiyJoQVpOMMiA7ft8aBH2MqUH60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S7zk5jhw8pMgeQKgRw+Bpt/fJhWM2128cuvBb3Xb3Vt1khauXwU+TBF95GzGLmVGO rmR6kLFiLDXSdBlHOnTqY+qagjlejMFxFyR8Q/Ci7Qr6LTrfHKL1xFFWyxbIUBmas8 vPn0nXp1yrPQQh5Ex7pnKAq5fxzZ6LVQQ4r+QWwU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guo Ren , Xu Kai , Daniel Lezcano , Thomas Gleixner , Sasha Levin Subject: [PATCH 5.4 16/57] clocksource/drivers/timer-gx6605s: Fixup counter reload Date: Mon, 5 Oct 2020 17:26:28 +0200 Message-Id: <20201005142110.580380989@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201005142109.796046410@linuxfoundation.org> References: <20201005142109.796046410@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Guo Ren [ Upstream commit bc6717d55d07110d8f3c6d31ec2af50c11b07091 ] When the timer counts to the upper limit, an overflow interrupt is generated, and the count is reset with the value in the TIME_INI register. But the software expects to start counting from 0 when the count overflows, so it forces TIME_INI to 0 to solve the potential interrupt storm problem. Signed-off-by: Guo Ren Tested-by: Xu Kai Cc: Daniel Lezcano Cc: Thomas Gleixner Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1597735877-71115-1-git-send-email-guoren@kernel.org Signed-off-by: Sasha Levin --- drivers/clocksource/timer-gx6605s.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clocksource/timer-gx6605s.c b/drivers/clocksource/timer-gx6605s.c index 80d0939d040b5..8d386adbe8009 100644 --- a/drivers/clocksource/timer-gx6605s.c +++ b/drivers/clocksource/timer-gx6605s.c @@ -28,6 +28,7 @@ static irqreturn_t gx6605s_timer_interrupt(int irq, void *dev) void __iomem *base = timer_of_base(to_timer_of(ce)); writel_relaxed(GX6605S_STATUS_CLR, base + TIMER_STATUS); + writel_relaxed(0, base + TIMER_INI); ce->event_handler(ce);