Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6926600ybi; Mon, 22 Jul 2019 04:09:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYvnZZAO5ExXAD9r8a+1XMu0DWKlFyuwAp4wlLFl9cQTry0Kqv5KuIwTexJC094HmrBe0n X-Received: by 2002:a17:902:7781:: with SMTP id o1mr75017495pll.205.1563793742991; Mon, 22 Jul 2019 04:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563793742; cv=none; d=google.com; s=arc-20160816; b=pGCyZkS6jtCxCmcY/IYfqvWKOM/ZWaA4bJ6qOwiLAeznJcbnKzICVJXHn65qETdsFi 71O8ECuUoqxSNCSOdjGtaxOhynpmEhfrxQ4+G8m4kfrVxldtrq9wGgROWJ8YowAHybtW 9GbT3DjCBKFN/7zscLfO34upOaKXVu1kjvfh0DzZix4XbLa4i7C8mofwgPf4xTn5L+Ox 9mkTXPLeH5ume0AzpFl7XwbwlvCw6ZLQvTyzS/muoLFR7GwQC0ZX5Af2KWM3mZDyOCBu R/s4z6Vq0AAZ5xmLvM/9s2ciqYvNF/QzMYcu4KIM+8JxMZTousiypOudwCAlb9muqVHr mfoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=W4GuN2apm7v81zfbmf5wdl4aw+WkedvqsGGrvWy48do=; b=lnd5/CydFGBkrrzvoSHoWHkSzXs8TgrbpDhbcxbVXNCnyafewo9/mo3yTkgqpl4qUA bNS7ONtYtirl3rzImuE2nEj3HsnSR2/up1YvdCu4J7MIgII3Zudpm4le8P6XkhNx2/Gm n8Uu0YGyHUBrNSmebVR0tzjFv0ccA4eZ4Axa4pAxjJmNoN6zlPBkykPeaPjlBo9+Hl5m xQjd7vdldbHXq9E4kIo7HqL1yLSgDzJJx6uA6YE7fGQajNHoSfKHt6hYLaFxuo/AHaxF XgECvS2h8g3hX2ANvV3P0xuSN//ElLXNhDVUIs3KMfzluGYnj9VrescUQuRafQJ5qh11 czUg== 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 33si11061333plq.299.2019.07.22.04.08.47; Mon, 22 Jul 2019 04:09:02 -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 S1728918AbfGVJPX (ORCPT + 99 others); Mon, 22 Jul 2019 05:15:23 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:36042 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726918AbfGVJPX (ORCPT ); Mon, 22 Jul 2019 05:15:23 -0400 Received: from pd9ef1cb8.dip0.t-ipconnect.de ([217.239.28.184] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hpUPe-0002hE-2R; Mon, 22 Jul 2019 11:15:18 +0200 Date: Mon, 22 Jul 2019 11:15:17 +0200 (CEST) From: Thomas Gleixner To: Avi Fishman cc: Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Daniel Lezcano , OpenBMC Maillist , Linux Kernel Mailing List Subject: Re: [PATCH] [v3] clocksource/drivers/npcm: fix GENMASK and timer operation In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Jul 2019, Avi Fishman wrote: > clocksource/drivers/npcm: fix GENMASK and timer operation Don't repeat the subject line please > NPCM7XX_Tx_OPER GENMASK() changed from (27, 3) to (28, 27) Please do not write down WHAT the patch does. That can be seen from the patch itself. Tell why this is wrong and what's the potential problem. > Since NPCM7XX_REG_TICR0 register reset value of those bits was 0, > it did not cause an issue > > in npcm7xx_timer_oneshot() the original NPCM7XX_REG_TCSR0 register was > read again after masking it with ~NPCM7XX_Tx_OPER so the masking didn't > take effect. > > npcm7xx_timer_periodic() was not wrong but it wrote to NPCM7XX_REG_TICR0 > in a middle of read modify write to NPCM7XX_REG_TCSR0 which is > confusing. > > Signed-off-by: Avi Fishman > --- > drivers/clocksource/timer-npcm7xx.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/clocksource/timer-npcm7xx.c > b/drivers/clocksource/timer-npcm7xx.c > index 8a30da7f083b..9780ffd8010e 100644 > --- a/drivers/clocksource/timer-npcm7xx.c > +++ b/drivers/clocksource/timer-npcm7xx.c > @@ -32,7 +32,7 @@ > #define NPCM7XX_Tx_INTEN BIT(29) > #define NPCM7XX_Tx_COUNTEN BIT(30) > #define NPCM7XX_Tx_ONESHOT 0x0 > -#define NPCM7XX_Tx_OPER GENMASK(27, 3) > +#define NPCM7XX_Tx_OPER GENMASK(28, 27) > #define NPCM7XX_Tx_MIN_PRESCALE 0x1 > #define NPCM7XX_Tx_TDR_MASK_BITS 24 > #define NPCM7XX_Tx_MAX_CNT 0xFFFFFF > @@ -84,8 +84,6 @@ static int npcm7xx_timer_oneshot(struct > clock_event_device *evt) > > val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0); > val &= ~NPCM7XX_Tx_OPER; > - > - val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0); > val |= NPCM7XX_START_ONESHOT_Tx; > writel(val, timer_of_base(to) + NPCM7XX_REG_TCSR0); > > @@ -97,12 +95,11 @@ static int npcm7xx_timer_periodic(struct > clock_event_device *evt) Your mail client mangled the patch so it does not apply: patching file drivers/clocksource/timer-npcm7xx.c Hunk #1 FAILED at 32. patch: **** malformed patch at line 49: clock_event_device *evt) See Documentation/process for hints about sending patches with various mail clients. Send the patch to yourself first and try to apply it yourself. Thanks, tglx