From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Yicong Yang <yangyicong@huawei.com>
Cc: <will@kernel.org>, <mark.rutland@arm.com>,
<linux-arm-kernel@lists.infradead.org>,
<yangyicong@hisilicon.com>, <hejunhao3@huawei.com>,
<linuxarm@huawei.com>, <wangyushan12@huawei.com>
Subject: Re: [PATCH 1/3] drivers/perf: hisi_pcie: Record hardware counts correctly
Date: Thu, 29 Aug 2024 14:41:39 +0100 [thread overview]
Message-ID: <20240829144139.0000311e@Huawei.com> (raw)
In-Reply-To: <20240829090332.28756-2-yangyicong@huawei.com>
On Thu, 29 Aug 2024 17:03:30 +0800
Yicong Yang <yangyicong@huawei.com> wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
>
> Currently we set the period and record it as the initial value of the
> counter without checking it's set to the hardware successfully or not.
> However the counter maybe unwritable if the target event is unsupported
> by the device. In such case we will pass user a wrong count:
>
> [start counts when setting the period]
> hwc->prev_count = 0x8000000000000000
> device.counter_value = 0 // the counter is not set as the period
> [when user reads the counter]
> event->count = device.counter_value - hwc->prev_count
> = 0x8000000000000000 // wrong. should be 0.
>
> Fix this by record the hardware counter counts correctly when setting
> the period.
>
> Fixes: 8404b0fbc7fb ("drivers/perf: hisi: Add driver for HiSilicon PCIe PMU")
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
next prev parent reply other threads:[~2024-08-29 13:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 9:03 [PATCH 0/3] Some updates for HiSilicon PCIe PMU Yicong Yang
2024-08-29 9:03 ` [PATCH 1/3] drivers/perf: hisi_pcie: Record hardware counts correctly Yicong Yang
2024-08-29 13:41 ` Jonathan Cameron [this message]
2024-08-29 9:03 ` [PATCH 2/3] drivers/perf: hisi_pcie: Fix TLP headers bandwidth counting Yicong Yang
2024-08-29 13:42 ` Jonathan Cameron
2024-08-29 9:03 ` [PATCH 3/3] drivers/perf: hisi_pcie: Export supported Root Ports [bdf_min, bdf_max] Yicong Yang
2024-08-29 13:43 ` Jonathan Cameron
2024-08-30 16:12 ` [PATCH 0/3] Some updates for HiSilicon PCIe PMU Will Deacon
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=20240829144139.0000311e@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=hejunhao3@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linuxarm@huawei.com \
--cc=mark.rutland@arm.com \
--cc=wangyushan12@huawei.com \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.com \
--cc=yangyicong@huawei.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.