Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp161975ybj; Fri, 8 May 2020 08:46:33 -0700 (PDT) X-Google-Smtp-Source: APiQypLdKAJWkWGDrbnSbpwLyxd4qEXcCZ5wOLuU4VlsQ36nN3Pp3MWwUq/0X0ofplXEllne2GhB X-Received: by 2002:a50:d7d3:: with SMTP id m19mr2690017edj.285.1588952792884; Fri, 08 May 2020 08:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588952792; cv=none; d=google.com; s=arc-20160816; b=HVO2OEdOCI9eXNs1yuSylTkBiXxjBfpyBliRcWgwRktk4AZiZ6fSzBd4bPahxE+vng t/EU0I8qJm6Kw57u2vqjwQK8q/6wsKbNyDgkYnMHldibnkwF3WMxmaUQMBLFwaYmNgBI 4javwvTidL5oN9I3GJjW2+7ZB+2k7ofHcdl9wwdZEZQc5iXJLScMEt29rgkCsfURlY98 RPOysrh9coTC/SyhnY84D7O9zqnfTNVFtmdTmJ+4wxrkpLVarFsEzhlUSQKrxiR7JVnx KauhPxjBdZezHHZY+jH8jFcPsw2KbM2Q9dmdWLna9i5UfyeRINl/qNsP/BFTeg4eXCOI ix6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=apty26PKenQlWMV0JF1247ejvm3kTVWlzQVThkF7gSE=; b=j0tUgMbUORpdbK5AxvZMyEdvsFfEv0Dtf9IPlfzV5yGoyM7iV0CpYybhQa1P3k0jCQ 6oyEFRZ7bwZ80DH+7s9iUPgXZfHdYt4kFec781IEWpRXu0IDP+y32nL30rayo+I2x5mY SF8BOJs6fEZmchqTUmDtaZlmn66I63uIW/2Ae8LNikzchzEjSZZGkeGMGmvJgtMS5dha qdo+h3YrLhrVBJpYBEURRWtYEcgEeM9NPnraUeA86RXdcW4D5St23yMPY8ThUzVhc8Fa OHEfX1b1tOmABGu1qdYASSGcKnKWWg6n3tq4nHisY9aZOTTRjjt7IKBAdYxk9jmeaJQJ XeJg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd8si1125480ejb.486.2020.05.08.08.46.09; Fri, 08 May 2020 08:46:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728387AbgEHPm3 (ORCPT + 99 others); Fri, 8 May 2020 11:42:29 -0400 Received: from elvis.franken.de ([193.175.24.41]:44977 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbgEHPmX (ORCPT ); Fri, 8 May 2020 11:42:23 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1jX58n-0005J7-00; Fri, 08 May 2020 17:42:21 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 106BCC041B; Fri, 8 May 2020 17:40:46 +0200 (CEST) Date: Fri, 8 May 2020 17:40:46 +0200 From: Thomas Bogendoerfer To: Sergey.Semin@baikalelectronics.ru Cc: Serge Semin , Alexey Malahov , Paul Burton , Ralf Baechle , Greg Kroah-Hartman , Arnd Bergmann , Rob Herring , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, afzal mohammed , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 19/20] mips: cevt-r4k: Update the r4k-clockevent frequency in sync with CPU Message-ID: <20200508154045.GA22247@alpha.franken.de> References: <20200306124807.3596F80307C2@mail.baikalelectronics.ru> <20200506174238.15385-1-Sergey.Semin@baikalelectronics.ru> <20200506174238.15385-20-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200506174238.15385-20-Sergey.Semin@baikalelectronics.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 06, 2020 at 08:42:37PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c > index 17a9cbb8b3df..f5b72fb7d5ee 100644 > --- a/arch/mips/kernel/cevt-r4k.c > +++ b/arch/mips/kernel/cevt-r4k.c > @@ -8,6 +8,7 @@ > */ > #include > #include > +#include > #include > #include > #include > @@ -250,6 +251,49 @@ unsigned int __weak get_c0_compare_int(void) > return MIPS_CPU_IRQ_BASE + cp0_compare_irq; > } > > +#ifdef CONFIG_CPU_FREQ > + > +static unsigned long mips_ref_freq; > + > +static int cpufreq_callback(struct notifier_block *nb, > + unsigned long val, void *data) please prefix function names with r4k_ to make them different from the other ones you implemented in kernel/time.c. I know they are static, but keeping different names makes looking at crashes easier. > + struct cpufreq_freqs *freq = data; > + struct clock_event_device *cd; > + unsigned long rate; > + int cpu; > + > + if (!mips_ref_freq) > + mips_ref_freq = freq->old; isn't this the same as mips_hpt_frequency ? Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]