From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81DD9EE4993 for ; Mon, 21 Aug 2023 12:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VZZd4+fmXnOB0XSvpLMsjuFcp6jZLH2xTrR05YcSgPM=; b=NWnOgTcWuaZOYg NyMNib9geh2syxJ0Vqgjkd87VAq6Furz6DhZj7curvU//t9IyhgNfXaKcRWhe8tuZ08xGm4v8xXGI eDSp0wNzsblt/FRTo9BBlBP9CpUtAQt9wCkiPx4qx11p7CYKkOvh70cvmPXXewph41SBO6F7pdsQt xR5AoR0kVC3FTE+RkEQv0DJF55+l0hPAFSW1KMgFRopF8kqRsClC7rlcH1Xe5hUKogq61ZL9m7b+y qYHXaTa/rE9M4fOyfzgQ33fsCsUjIV4PS9QIwc4xfBrmg4WeJ1H4HrXNxjiQY5EfiCuG17mQloP7U 2KxURMGF47v2CBpeg8Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qY3eT-00Dw9l-1Z; Mon, 21 Aug 2023 12:04:57 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qY3eP-00Dw7P-36 for linux-arm-kernel@lists.infradead.org; Mon, 21 Aug 2023 12:04:55 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E83BB632F3; Mon, 21 Aug 2023 12:04:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2983AC433C9; Mon, 21 Aug 2023 12:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692619486; bh=ku0b1PSf0bDhMBqqwhIxMLwB0rhuhLByM8FxU1qMgxQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xq2ZYtAPJaUbsccqXtaw0kX6XBsUs/5/JqQXOCC+cbMqLwqqJt8XR9Vce1Q0vdQYb d43l2Kqfrbw6RKb8munNFk1MwcNsqnQLtA62bQU/ksPRjHaO960AwU3Te+NUNzBpgt FmIdi9UPuEGeABlJ+DBZPJtijf0SKvt6NtPyJpznpGEPziryc7WP/jZPUvXrM8iqhT qEqf0ixw7wUMuzbUhf+XxWaSsqKMnxVoyg5h71T7p9Gt9jXTBeCIae29DWKgvLP/o3 rve7RTzOlzrc3eHA/+6Oxm27Zv1y6YYTfI0itz+ttO1h9t/3DIT40WXy7zr495UH2T qxvn9W2earLNw== Date: Mon, 21 Aug 2023 13:04:40 +0100 From: Will Deacon To: Jijie Shao 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 Message-ID: <20230821120440.GB19617@willie-the-truck> References: <20230816094619.3563784-1-shaojijie@huawei.com> <20230816094619.3563784-3-shaojijie@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230816094619.3563784-3-shaojijie@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230821_050454_038599_CA8F345C X-CRM114-Status: GOOD ( 23.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org [+Guangbin Huang and Shaokun Zhang] On Wed, Aug 16, 2023 at 05:46:19PM +0800, Jijie Shao wrote: > From: Hao Chen > > 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 > Signed-off-by: Jijie Shao > --- > 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