All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-mips@vger.kernel.org, "Huacai Chen" <chenhc@lemote.com>,
	"Serge Semin" <Sergey.Semin@baikalelectronics.ru>,
	"Alexey Malahov" <Alexey.Malahov@baikalelectronics.ru>,
	"WANG Xuerui" <git@xen0n.name>,
	"Paul Burton" <paulburton@kernel.org>,
	"周琰杰 (Zhou Yanjie)" <zhouyanjie@wanyeetech.com>,
	"afzal mohammed" <afzal.mohd.ma@gmail.com>,
	"Paul Cercueil" <paul@crapouillou.net>,
	"Liangliang Huang" <huanglllzu@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: cevt-r4k: Enable intimer for Loongson64 CPUs with extimer
Date: Sun, 4 Oct 2020 22:12:49 +0200	[thread overview]
Message-ID: <20201004201249.GA8186@alpha.franken.de> (raw)
In-Reply-To: <CA420A99-C226-4A22-B3A6-4464DD8CFA1D@flygoat.com>

On Sat, Oct 03, 2020 at 02:25:42PM +0800, Jiaxun Yang wrote:
> 
> 
> 于 2020年10月2日 GMT+08:00 下午9:27:21, Thomas Bogendoerfer <tsbogend@alpha.franken.de> 写到:
> >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 ]

  reply	other threads:[~2020-10-04 20:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 11:02 [PATCH] MIPS: cevt-r4k: Enable intimer for Loongson64 CPUs with extimer Jiaxun Yang
2020-10-02 13:27 ` Thomas Bogendoerfer
2020-10-03  6:25   ` Jiaxun Yang
2020-10-04 20:12     ` Thomas Bogendoerfer [this message]
2020-10-04 20:49 ` Paul Cercueil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201004201249.GA8186@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=afzal.mohd.ma@gmail.com \
    --cc=chenhc@lemote.com \
    --cc=git@xen0n.name \
    --cc=huanglllzu@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paul@crapouillou.net \
    --cc=paulburton@kernel.org \
    --cc=zhouyanjie@wanyeetech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.