From: Will Deacon <will@kernel.org>
To: Jijie Shao <shaojijie@huawei.com>
Cc: jonathan.cameron@huawei.com, mark.rutland@arm.com,
chenhao418@huawei.com, shenjian15@huawei.com,
wangjie125@huawei.com, liuyonglong@huawei.com,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, huangguangbin2@huawei.com,
zhangshaokun@hisilicon.com
Subject: Re: [PATCH drivers/perf: hisi: 2/2] drivers/perf: hisi: fix set wrong filter mode for running events issue
Date: Mon, 21 Aug 2023 13:04:40 +0100 [thread overview]
Message-ID: <20230821120440.GB19617@willie-the-truck> (raw)
In-Reply-To: <20230816094619.3563784-3-shaojijie@huawei.com>
[+Guangbin Huang and Shaokun Zhang]
On Wed, Aug 16, 2023 at 05:46:19PM +0800, Jijie Shao wrote:
> From: Hao Chen <chenhao418@huawei.com>
>
> hns3_pmu_select_filter_mode() includes a series of mode judgments such
> as global mode ,function mode, function-queue mode, port mode, port-tc
> mode.
>
> For a special scenario, command use parameter "bdf=0x3700,config=0x3,
> queue=0x0", it is expected to enter function-queue mode, but event of
> config 0x3 doesn't support func-queue mode, then it enter port-tc mode.
> it's not up to expectations.
>
> It shouldn't enter any modes but return -ENOENT.
>
> So, add judgement of bdf parameter to fix it.
>
> Fixes: 66637ab137b4 ("drivers/perf: hisi: add driver for HNS3 PMU")
> Signed-off-by: Hao Chen <chenhao418@huawei.com>
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> ---
> drivers/perf/hisilicon/hns3_pmu.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/perf/hisilicon/hns3_pmu.c b/drivers/perf/hisilicon/hns3_pmu.c
> index 6a4d04cbae91..7f38a9e489d4 100644
> --- a/drivers/perf/hisilicon/hns3_pmu.c
> +++ b/drivers/perf/hisilicon/hns3_pmu.c
> @@ -1000,12 +1000,13 @@ static bool
> hns3_pmu_is_enabled_port_tc_mode(struct perf_event *event,
> struct hns3_pmu_event_attr *pmu_event)
> {
> + u16 bdf = hns3_pmu_get_bdf(event);
> u8 tc_id = hns3_pmu_get_tc(event);
>
> if (!(pmu_event->filter_support & HNS3_PMU_FILTER_SUPPORT_PORT_TC))
> return false;
>
> - return tc_id != HNS3_PMU_FILTER_ALL_TC;
> + return (tc_id != HNS3_PMU_FILTER_ALL_TC) && (!bdf);
> }
Sorry, but I'm struggling to see how this correlates with your example
in the commit message, which implies that it's the config of 0x3 causing
the problem rather than the bdf.
Please can you explain the problem in more detail?
Thanks,
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-08-21 12:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 9:46 [PATCH drivers/perf: hisi: 0/2] There are some bugfix for the hisi perf driver Jijie Shao
2023-08-16 9:46 ` [PATCH drivers/perf: hisi: 1/2] drivers/perf: hisi: hns3: default use hardware event 0 as group leader event Jijie Shao
2023-08-21 11:58 ` Will Deacon
2023-08-23 2:38 ` Jijie Shao
2023-08-16 9:46 ` [PATCH drivers/perf: hisi: 2/2] drivers/perf: hisi: fix set wrong filter mode for running events issue Jijie Shao
2023-08-21 12:04 ` Will Deacon [this message]
2023-08-21 12:08 ` Will Deacon
2023-08-21 12:32 ` Jijie Shao
2023-08-23 2:33 ` Jijie Shao
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=20230821120440.GB19617@willie-the-truck \
--to=will@kernel.org \
--cc=chenhao418@huawei.com \
--cc=huangguangbin2@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=mark.rutland@arm.com \
--cc=shaojijie@huawei.com \
--cc=shenjian15@huawei.com \
--cc=wangjie125@huawei.com \
--cc=zhangshaokun@hisilicon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox