Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2816686pxk; Sun, 4 Oct 2020 13:15:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVGBrsMIn9DJS3/k/pp8F3f3p0EvoBOXUmnWdseiUyyEUmrjYjkCtv/Bh/g2rylUbXEILH X-Received: by 2002:a17:906:8297:: with SMTP id h23mr11836981ejx.383.1601842508413; Sun, 04 Oct 2020 13:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601842508; cv=none; d=google.com; s=arc-20160816; b=KMjLVjOLUun5wIiftcTKaWVCjbDwHsiCCwKqXSTso8DZcY13cS37g1rpe20HDb4gkO FILnDcu2dX25BWbDt6esd3cMh2QXiWJ8RN+ojWLluPsZGw3HE89DaC0VmIm7NivMRv9K piN2MfXf2JggyfGL6gwj4ffTs3SUrAZ7nJzF9fkvTbb71G74P4o4Io+njB4pw0pagclY 8AsDBbww9TcDdCDqSh1IJjmVCDuPqcKDLZp4jkjTGNxxmTpPwteO0elDC/uvt/DmpWmC a0hXv3bkIKAcMD1zzQFbji7DAi/QnPkvaMs/KDvxiVb+LZsbV4pmlB2coQsAnUJx/CyZ OnhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=MWB8C87pblYXlo8XFD29oqF4dVUv+pkCRcW7wEl5oAk=; b=mYrCZ1PvbGufzT5dfRfAmiBvW7ff0JyqSRY/eSldDKpxDFv3n4yEUW5gMw7E+OsSrm ooCrVt5I+SWRD44KL3Czwh6inb0JcdTkwQjBAvmmxUQ1T9XVqCV+CC6wWL+DY5xNeWS7 SP4hYZsaezoUwAqkC8U3F4FhZaYtLncPmD1Fu61IqvsmKO/onbCZIKbSM/f0PAVllH6J Jp/h1DDaQR3KLjZodcDSuIk5/YdYW78Xex3KqJofMcUXfYRdCsm8t0LLtN8I9XXl5Rfa u2VVOGcIiHgRlBIK+YG7zB5I0LK0jitd0Pm362RxkFuuAgyoyL6RV+86Yf8dv8iHqZCq VcHQ== 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 lr3si6315472ejb.744.2020.10.04.13.14.44; Sun, 04 Oct 2020 13:15:08 -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 S1726442AbgJDUNm (ORCPT + 99 others); Sun, 4 Oct 2020 16:13:42 -0400 Received: from elvis.franken.de ([193.175.24.41]:43926 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726288AbgJDUNl (ORCPT ); Sun, 4 Oct 2020 16:13:41 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1kPAO0-0003iy-00; Sun, 04 Oct 2020 22:13:36 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 773EAC10D8; Sun, 4 Oct 2020 22:12:49 +0200 (CEST) Date: Sun, 4 Oct 2020 22:12:49 +0200 From: Thomas Bogendoerfer To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, Huacai Chen , Serge Semin , Alexey Malahov , WANG Xuerui , Paul Burton , =?utf-8?B?5ZGo55Cw5p2wIChaaG91IFlhbmppZSk=?= , afzal mohammed , Paul Cercueil , Liangliang Huang , linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: cevt-r4k: Enable intimer for Loongson64 CPUs with extimer Message-ID: <20201004201249.GA8186@alpha.franken.de> References: <20200923110301.58125-1-jiaxun.yang@flygoat.com> <20201002132721.GA12295@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 03, 2020 at 02:25:42PM +0800, Jiaxun Yang wrote: > > > 于 2020年10月2日 GMT+08:00 下午9:27:21, Thomas Bogendoerfer 写到: > >On Wed, Sep 23, 2020 at 07:02:54PM +0800, Jiaxun Yang wrote: > >> > >> +#ifdef CONFIG_CPU_LOONGSON64 > >> +static int c0_compare_int_enable(struct clock_event_device *cd) > >> +{ > >> + if (cpu_has_extimer) > >> + set_c0_config6(LOONGSON_CONF6_INTIMER); > > > >why are you not simply do this in loognson64 board setup code and avoid > >the whole cluttering of #ifdef CONFIG_CPU_LOONGSON64 over common code ? > > Because I'm going to add extimer support later that require dynamic > switch of cevt-r4k. another case of misdesigned hardware or why does this need to be dynamic ? > This callback is required. please find a solution without #ifdef CONFIG_CPU_LOONGSON64. I dislike the pollution of common code with all kinds of #ifdefs and in this case there are better options. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]