From: "Heiko Stübner" <heiko@sntech.de>
To: atishp@atishpatra.org, anup@brainfault.org, will@kernel.org,
mark.rutland@arm.com, paul.walmsley@sifive.com,
palmer@dabbelt.com, aou@eecs.berkeley.edu,
Conor.Dooley@microchip.com
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
philipp.tomsich@vrull.eu, cmuellner@linux.com,
samuel@sholland.org, guoren@kernel.org
Subject: Re: [PATCH v2] drivers/perf: riscv_pmu_sbi: add support for PMU variant on T-Head C9xx cores
Date: Tue, 30 Aug 2022 17:02:51 +0200 [thread overview]
Message-ID: <3973491.N7aMVyhfb1@diego> (raw)
In-Reply-To: <3627040.SvYEEZNnvj@diego>
Am Dienstag, 30. August 2022, 16:33:27 CEST schrieb Heiko Stübner:
> Am Freitag, 26. August 2022, 19:57:33 CEST schrieb Conor.Dooley@microchip.com:
> > On 26/08/2022 17:35, Heiko Stuebner wrote:
> > > diff --git a/arch/riscv/errata/thead/errata.c b/arch/riscv/errata/thead/errata.c
> > > index 202c83f677b2..e6101eab25c8 100644
> > > --- a/arch/riscv/errata/thead/errata.c
> > > +++ b/arch/riscv/errata/thead/errata.c
> > > @@ -44,6 +44,22 @@ static bool errata_probe_cmo(unsigned int stage,
> > > #endif
> > > }
> > >
> > > +static bool errata_probe_pmu(unsigned int stage,
> > > + unsigned long arch_id, unsigned long impid)
> > > +{
> > > +#ifdef CONFIG_ERRATA_THEAD_PMU
> >
> > Is there a reason that all the alternatives use ifdef
> > rather than if(IS_ENABLED())?
>
> no real reason I guess - more like not enough thinking :-)
>
> Using IS_ENABLED also makes it way nicer as we can just do
>
> if (!IS_ENABLED(CONFIG_ERRATA_THEAD_PMU))
> return false;
Though at least for the CMO this is not possible, as the
riscv_noncoherent_supported()
is not defined in that case.
Though it might be nice to define a stub for the
not-CONFIG_RISCV_DMA_NONCOHERENT case
so that we don't need to #ifdef around it.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: "Heiko Stübner" <heiko@sntech.de>
To: atishp@atishpatra.org, anup@brainfault.org, will@kernel.org,
mark.rutland@arm.com, paul.walmsley@sifive.com,
palmer@dabbelt.com, aou@eecs.berkeley.edu,
Conor.Dooley@microchip.com
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
philipp.tomsich@vrull.eu, cmuellner@linux.com,
samuel@sholland.org, guoren@kernel.org
Subject: Re: [PATCH v2] drivers/perf: riscv_pmu_sbi: add support for PMU variant on T-Head C9xx cores
Date: Tue, 30 Aug 2022 17:02:51 +0200 [thread overview]
Message-ID: <3973491.N7aMVyhfb1@diego> (raw)
In-Reply-To: <3627040.SvYEEZNnvj@diego>
Am Dienstag, 30. August 2022, 16:33:27 CEST schrieb Heiko Stübner:
> Am Freitag, 26. August 2022, 19:57:33 CEST schrieb Conor.Dooley@microchip.com:
> > On 26/08/2022 17:35, Heiko Stuebner wrote:
> > > diff --git a/arch/riscv/errata/thead/errata.c b/arch/riscv/errata/thead/errata.c
> > > index 202c83f677b2..e6101eab25c8 100644
> > > --- a/arch/riscv/errata/thead/errata.c
> > > +++ b/arch/riscv/errata/thead/errata.c
> > > @@ -44,6 +44,22 @@ static bool errata_probe_cmo(unsigned int stage,
> > > #endif
> > > }
> > >
> > > +static bool errata_probe_pmu(unsigned int stage,
> > > + unsigned long arch_id, unsigned long impid)
> > > +{
> > > +#ifdef CONFIG_ERRATA_THEAD_PMU
> >
> > Is there a reason that all the alternatives use ifdef
> > rather than if(IS_ENABLED())?
>
> no real reason I guess - more like not enough thinking :-)
>
> Using IS_ENABLED also makes it way nicer as we can just do
>
> if (!IS_ENABLED(CONFIG_ERRATA_THEAD_PMU))
> return false;
Though at least for the CMO this is not possible, as the
riscv_noncoherent_supported()
is not defined in that case.
Though it might be nice to define a stub for the
not-CONFIG_RISCV_DMA_NONCOHERENT case
so that we don't need to #ifdef around it.
next prev parent reply other threads:[~2022-08-30 15:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 16:35 [PATCH v2] drivers/perf: riscv_pmu_sbi: add support for PMU variant on T-Head C9xx cores Heiko Stuebner
2022-08-26 16:35 ` Heiko Stuebner
2022-08-26 17:57 ` Conor.Dooley
2022-08-26 17:57 ` Conor.Dooley
2022-08-30 14:33 ` Heiko Stübner
2022-08-30 14:33 ` Heiko Stübner
2022-08-30 15:02 ` Heiko Stübner [this message]
2022-08-30 15:02 ` Heiko Stübner
2022-08-30 15:32 ` Conor.Dooley
2022-08-30 15:32 ` Conor.Dooley
[not found] ` <CAOnJCUKB2xu+RST2qh2zC7=vcLzBs_x7B3i49bTnkoBWu3-0xA@mail.gmail.com>
2022-08-30 12:00 ` Heiko Stübner
2022-08-30 12:00 ` Heiko Stübner
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=3973491.N7aMVyhfb1@diego \
--to=heiko@sntech.de \
--cc=Conor.Dooley@microchip.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=atishp@atishpatra.org \
--cc=cmuellner@linux.com \
--cc=guoren@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=philipp.tomsich@vrull.eu \
--cc=samuel@sholland.org \
--cc=will@kernel.org \
/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.