* [PATCH] MIPS: perf: Fix wrong check condition of Loongson event IDs
@ 2020-08-27 8:03 Tiezhu Yang
2020-08-28 8:49 ` Huacai Chen
2020-09-03 8:22 ` Thomas Bogendoerfer
0 siblings, 2 replies; 4+ messages in thread
From: Tiezhu Yang @ 2020-08-27 8:03 UTC (permalink / raw)
To: Thomas Bogendoerfer, Huacai Chen, Jiaxun Yang
Cc: linux-mips, linux-kernel, Xuefeng Li
According to the user's manual chapter 8.2.1 of Loongson 3A2000 CPU [1]
and 3A3000 CPU [2], we should take some event IDs such as 274, 358, 359
and 360 as valid in the check condition, otherwise they are recognized
as "not supported", fix it.
[1] http://www.loongson.cn/uploadfile/cpu/3A2000/Loongson3A2000_user2.pdf
[2] http://www.loongson.cn/uploadfile/cpu/3A3000/Loongson3A3000_3B3000user2.pdf
Fixes: e9dfbaaeef1c ("MIPS: perf: Add hardware perf events support for new Loongson-3")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
arch/mips/kernel/perf_event_mipsxx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
index efce5de..011eb6bb 100644
--- a/arch/mips/kernel/perf_event_mipsxx.c
+++ b/arch/mips/kernel/perf_event_mipsxx.c
@@ -1898,8 +1898,8 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
(base_id >= 64 && base_id < 90) ||
(base_id >= 128 && base_id < 164) ||
(base_id >= 192 && base_id < 200) ||
- (base_id >= 256 && base_id < 274) ||
- (base_id >= 320 && base_id < 358) ||
+ (base_id >= 256 && base_id < 275) ||
+ (base_id >= 320 && base_id < 361) ||
(base_id >= 384 && base_id < 574))
break;
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: perf: Fix wrong check condition of Loongson event IDs
2020-08-27 8:03 [PATCH] MIPS: perf: Fix wrong check condition of Loongson event IDs Tiezhu Yang
@ 2020-08-28 8:49 ` Huacai Chen
2020-09-01 8:44 ` Huang Pei
2020-09-03 8:22 ` Thomas Bogendoerfer
1 sibling, 1 reply; 4+ messages in thread
From: Huacai Chen @ 2020-08-28 8:49 UTC (permalink / raw)
To: Tiezhu Yang, Pei Huang
Cc: Thomas Bogendoerfer, Jiaxun Yang, open list:MIPS, LKML, Xuefeng Li
Hi, Pei,
On Thu, Aug 27, 2020 at 4:05 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> According to the user's manual chapter 8.2.1 of Loongson 3A2000 CPU [1]
> and 3A3000 CPU [2], we should take some event IDs such as 274, 358, 359
> and 360 as valid in the check condition, otherwise they are recognized
> as "not supported", fix it.
I think this patch needs you to confirm.
>
> [1] http://www.loongson.cn/uploadfile/cpu/3A2000/Loongson3A2000_user2.pdf
> [2] http://www.loongson.cn/uploadfile/cpu/3A3000/Loongson3A3000_3B3000user2.pdf
>
> Fixes: e9dfbaaeef1c ("MIPS: perf: Add hardware perf events support for new Loongson-3")
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> arch/mips/kernel/perf_event_mipsxx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
> index efce5de..011eb6bb 100644
> --- a/arch/mips/kernel/perf_event_mipsxx.c
> +++ b/arch/mips/kernel/perf_event_mipsxx.c
> @@ -1898,8 +1898,8 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
> (base_id >= 64 && base_id < 90) ||
> (base_id >= 128 && base_id < 164) ||
> (base_id >= 192 && base_id < 200) ||
> - (base_id >= 256 && base_id < 274) ||
> - (base_id >= 320 && base_id < 358) ||
> + (base_id >= 256 && base_id < 275) ||
> + (base_id >= 320 && base_id < 361) ||
> (base_id >= 384 && base_id < 574))
> break;
>
> --
> 2.1.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: perf: Fix wrong check condition of Loongson event IDs
2020-08-28 8:49 ` Huacai Chen
@ 2020-09-01 8:44 ` Huang Pei
0 siblings, 0 replies; 4+ messages in thread
From: Huang Pei @ 2020-09-01 8:44 UTC (permalink / raw)
To: Huacai Chen
Cc: Tiezhu Yang, Thomas Bogendoerfer, Jiaxun Yang, open list:MIPS,
LKML, Xuefeng Li
On Fri, Aug 28, 2020 at 04:49:37PM +0800, Huacai Chen wrote:
> Hi, Pei,
>
> On Thu, Aug 27, 2020 at 4:05 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
> >
> > According to the user's manual chapter 8.2.1 of Loongson 3A2000 CPU [1]
> > and 3A3000 CPU [2], we should take some event IDs such as 274, 358, 359
> > and 360 as valid in the check condition, otherwise they are recognized
> > as "not supported", fix it.
> I think this patch needs you to confirm.
>
> >
> > [1] http://www.loongson.cn/uploadfile/cpu/3A2000/Loongson3A2000_user2.pdf
> > [2] http://www.loongson.cn/uploadfile/cpu/3A3000/Loongson3A3000_3B3000user2.pdf
> >
> > Fixes: e9dfbaaeef1c ("MIPS: perf: Add hardware perf events support for new Loongson-3")
> > Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> > ---
> > arch/mips/kernel/perf_event_mipsxx.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
> > index efce5de..011eb6bb 100644
> > --- a/arch/mips/kernel/perf_event_mipsxx.c
> > +++ b/arch/mips/kernel/perf_event_mipsxx.c
> > @@ -1898,8 +1898,8 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
> > (base_id >= 64 && base_id < 90) ||
> > (base_id >= 128 && base_id < 164) ||
> > (base_id >= 192 && base_id < 200) ||
> > - (base_id >= 256 && base_id < 274) ||
> > - (base_id >= 320 && base_id < 358) ||
> > + (base_id >= 256 && base_id < 275) ||
> > + (base_id >= 320 && base_id < 361) ||
> > (base_id >= 384 && base_id < 574))
> > break;
> >
> > --
> > 2.1.0
> >
Acked-by: Huang Pei <huangpei@loongson.cn>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: perf: Fix wrong check condition of Loongson event IDs
2020-08-27 8:03 [PATCH] MIPS: perf: Fix wrong check condition of Loongson event IDs Tiezhu Yang
2020-08-28 8:49 ` Huacai Chen
@ 2020-09-03 8:22 ` Thomas Bogendoerfer
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 2020-09-03 8:22 UTC (permalink / raw)
To: Tiezhu Yang
Cc: Huacai Chen, Jiaxun Yang, linux-mips, linux-kernel, Xuefeng Li
On Thu, Aug 27, 2020 at 04:03:08PM +0800, Tiezhu Yang wrote:
> According to the user's manual chapter 8.2.1 of Loongson 3A2000 CPU [1]
> and 3A3000 CPU [2], we should take some event IDs such as 274, 358, 359
> and 360 as valid in the check condition, otherwise they are recognized
> as "not supported", fix it.
>
> [1] http://www.loongson.cn/uploadfile/cpu/3A2000/Loongson3A2000_user2.pdf
> [2] http://www.loongson.cn/uploadfile/cpu/3A3000/Loongson3A3000_3B3000user2.pdf
>
> Fixes: e9dfbaaeef1c ("MIPS: perf: Add hardware perf events support for new Loongson-3")
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> arch/mips/kernel/perf_event_mipsxx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
applied to mips-fixes.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-09-03 8:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 8:03 [PATCH] MIPS: perf: Fix wrong check condition of Loongson event IDs Tiezhu Yang
2020-08-28 8:49 ` Huacai Chen
2020-09-01 8:44 ` Huang Pei
2020-09-03 8:22 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).