All of lore.kernel.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 4/6] perf: hisi: Add support for HiSilicon SoC HHA PMU driver
Date: Tue, 15 Aug 2017 12:05:18 +0100	[thread overview]
Message-ID: <20170815110518.GE6090@leverpostej> (raw)
In-Reply-To: <1500984642-204676-5-git-send-email-zhangshaokun@hisilicon.com>

On Tue, Jul 25, 2017 at 08:10:40PM +0800, Shaokun Zhang wrote:
> +/* HHA register definition */
> +#define HHA_INT_MASK		0x0804
> +#define HHA_INT_STATUS		0x0808
> +#define HHA_INT_CLEAR		0x080C
> +#define HHA_PERF_CTRL		0x1E00
> +#define HHA_EVENT_CTRL		0x1E04
> +#define HHA_EVENT_TYPE0		0x1E80
> +#define HHA_CNT0_LOWER		0x1F00
> +
> +/* HHA has 16-counters and supports 0x50 events */

As with the L3C PMU, what exactly does this mean?

Does this mean event IDs 0-0x4f are valid?

[...]

> +static irqreturn_t hisi_hha_pmu_isr(int irq, void *dev_id)
> +{
> +	struct hisi_pmu *hha_pmu = dev_id;
> +	struct perf_event *event;
> +	unsigned long overflown;
> +	u32 status;
> +	int idx;
> +
> +	/* Read HHA_INT_STATUS register */
> +	status = readl(hha_pmu->base + HHA_INT_STATUS);
> +	if (!status)
> +		return IRQ_NONE;
> +	overflown = status;

No need for the u32 temporary here.

[....]

> +static int hisi_hha_pmu_dev_probe(struct platform_device *pdev,
> +				  struct hisi_pmu *hha_pmu)
> +{
> +	struct device *dev = &pdev->dev;
> +	int ret;
> +
> +	ret = hisi_hha_pmu_init_data(pdev, hha_pmu);
> +	if (ret)
> +		return ret;
> +
> +	/* Pick one core to use for cpumask attributes */
> +	cpumask_set_cpu(smp_processor_id(), &hha_pmu->cpus);
> +

Why does this not have the usual event migration callbacks, across CPUs
in the same SCCL?

> +	ret = hisi_hha_pmu_init_irq(hha_pmu, pdev);
> +	if (ret)
> +		return ret;
> +
> +	hha_pmu->name = devm_kasprintf(dev, GFP_KERNEL, "hisi_hha%u_%u",
> +				       hha_pmu->hha_uid, hha_pmu->sccl_id);

As on the doc patch, this should be hierarchical.

Thanks,
Mark

WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: will.deacon@arm.com, jonathan.cameron@huawei.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	linuxarm@huawei.com
Subject: Re: [PATCH v4 4/6] perf: hisi: Add support for HiSilicon SoC HHA PMU driver
Date: Tue, 15 Aug 2017 12:05:18 +0100	[thread overview]
Message-ID: <20170815110518.GE6090@leverpostej> (raw)
In-Reply-To: <1500984642-204676-5-git-send-email-zhangshaokun@hisilicon.com>

On Tue, Jul 25, 2017 at 08:10:40PM +0800, Shaokun Zhang wrote:
> +/* HHA register definition */
> +#define HHA_INT_MASK		0x0804
> +#define HHA_INT_STATUS		0x0808
> +#define HHA_INT_CLEAR		0x080C
> +#define HHA_PERF_CTRL		0x1E00
> +#define HHA_EVENT_CTRL		0x1E04
> +#define HHA_EVENT_TYPE0		0x1E80
> +#define HHA_CNT0_LOWER		0x1F00
> +
> +/* HHA has 16-counters and supports 0x50 events */

As with the L3C PMU, what exactly does this mean?

Does this mean event IDs 0-0x4f are valid?

[...]

> +static irqreturn_t hisi_hha_pmu_isr(int irq, void *dev_id)
> +{
> +	struct hisi_pmu *hha_pmu = dev_id;
> +	struct perf_event *event;
> +	unsigned long overflown;
> +	u32 status;
> +	int idx;
> +
> +	/* Read HHA_INT_STATUS register */
> +	status = readl(hha_pmu->base + HHA_INT_STATUS);
> +	if (!status)
> +		return IRQ_NONE;
> +	overflown = status;

No need for the u32 temporary here.

[....]

> +static int hisi_hha_pmu_dev_probe(struct platform_device *pdev,
> +				  struct hisi_pmu *hha_pmu)
> +{
> +	struct device *dev = &pdev->dev;
> +	int ret;
> +
> +	ret = hisi_hha_pmu_init_data(pdev, hha_pmu);
> +	if (ret)
> +		return ret;
> +
> +	/* Pick one core to use for cpumask attributes */
> +	cpumask_set_cpu(smp_processor_id(), &hha_pmu->cpus);
> +

Why does this not have the usual event migration callbacks, across CPUs
in the same SCCL?

> +	ret = hisi_hha_pmu_init_irq(hha_pmu, pdev);
> +	if (ret)
> +		return ret;
> +
> +	hha_pmu->name = devm_kasprintf(dev, GFP_KERNEL, "hisi_hha%u_%u",
> +				       hha_pmu->hha_uid, hha_pmu->sccl_id);

As on the doc patch, this should be hierarchical.

Thanks,
Mark

  reply	other threads:[~2017-08-15 11:05 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 12:10 [PATCH v4 0/6] Add HiSilicon SoC uncore Performance Monitoring Unit driver Shaokun Zhang
2017-07-25 12:10 ` Shaokun Zhang
2017-07-25 12:10 ` [PATCH v4 1/6] Documentation: perf: hisi: Documentation for HiSilicon SoC PMU driver Shaokun Zhang
2017-07-25 12:10   ` Shaokun Zhang
2017-08-15  9:50   ` Mark Rutland
2017-08-15  9:50     ` Mark Rutland
2017-08-17  2:30     ` Zhangshaokun
2017-08-17  2:30       ` Zhangshaokun
2017-08-17  3:56       ` Jonathan Cameron
2017-08-17  3:56         ` Jonathan Cameron
2017-07-25 12:10 ` [PATCH v4 2/6] perf: hisi: Add support for HiSilicon SoC uncore " Shaokun Zhang
2017-07-25 12:10   ` Shaokun Zhang
2017-08-15 10:16   ` Mark Rutland
2017-08-15 10:16     ` Mark Rutland
2017-08-17  3:08     ` Zhangshaokun
2017-08-17  3:08       ` Zhangshaokun
2017-07-25 12:10 ` [PATCH v4 3/6] perf: hisi: Add support for HiSilicon SoC L3C " Shaokun Zhang
2017-07-25 12:10   ` Shaokun Zhang
2017-08-15 10:41   ` Mark Rutland
2017-08-15 10:41     ` Mark Rutland
2017-08-17  3:31     ` Zhangshaokun
2017-08-17  3:31       ` Zhangshaokun
2017-07-25 12:10 ` [PATCH v4 4/6] perf: hisi: Add support for HiSilicon SoC HHA " Shaokun Zhang
2017-07-25 12:10   ` Shaokun Zhang
2017-08-15 11:05   ` Mark Rutland [this message]
2017-08-15 11:05     ` Mark Rutland
2017-08-17  3:38     ` Zhangshaokun
2017-08-17  3:38       ` Zhangshaokun
2017-07-25 12:10 ` [PATCH v4 5/6] perf: hisi: Add support for HiSilicon SoC DDRC " Shaokun Zhang
2017-07-25 12:10   ` Shaokun Zhang
2017-08-15 13:02   ` Mark Rutland
2017-08-15 13:02     ` Mark Rutland
2017-08-17  3:40     ` Zhangshaokun
2017-08-17  3:40       ` Zhangshaokun
2017-07-25 12:10 ` [PATCH v4 6/6] arm64: MAINTAINERS: hisi: Add HiSilicon SoC PMU support Shaokun Zhang
2017-07-25 12:10   ` Shaokun Zhang
2017-08-07  8:57 ` [PATCH v4 0/6] Add HiSilicon SoC uncore Performance Monitoring Unit driver Zhangshaokun
2017-08-07  8:57   ` Zhangshaokun

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=20170815110518.GE6090@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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.