linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Ganapatrao Kulkarni <gklkml16@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Ganapatrao Prabhakerrao Kulkarni <gkulkarni@marvell.com>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"will@kernel.org" <will@kernel.org>,
	"corbet@lwn.net" <corbet@lwn.net>
Subject: Re: [PATCH 1/2] perf/core: Adding capability to disable PMUs event multiplexing
Date: Thu, 7 Nov 2019 16:04:31 +0100	[thread overview]
Message-ID: <20191107150431.GC4114@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKTKpr6U8gUp4C9muN2cL4wn33o2LAa5QnTO2MSmfnBz8oUc=Q@mail.gmail.com>

On Wed, Nov 06, 2019 at 03:28:46PM -0800, Ganapatrao Kulkarni wrote:
> Issue happens when the add and del are called too many times as seen
> with 6 event case.
> The PMU hardware control registers are programmed when add and del
> functions are called.
> For pmu->read no issues since no h/w issue with the data path.
> 
> Please suggest me, how can we fix this in back-end PMU driver without
> any perf core help?

As Mark already said, a (much) better description of the actual hardware
fail is required, but one possible solution would be to add a busy spin
delay when writing to the hardware registers.

Something like:

	u64 now, ts = this_cpu_read(tx2_throttle);

	while ((now = cycle_counter()) <= ts)
		cpu_relax();

	write_register(...);

	this_cpu_write(tx2_throttle, now + delay_ns);

Other known tricks include reading the register back until it contains
what you just wrote to it.

But really, first properly describe how your hardware is buggered.

  parent reply	other threads:[~2019-11-07 15:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06  1:01 [PATCH 0/2] Workaround for ThunderX2 erratum 221 Ganapatrao Prabhakerrao Kulkarni
2019-11-06  1:01 ` [PATCH 1/2] perf/core: Adding capability to disable PMUs event multiplexing Ganapatrao Prabhakerrao Kulkarni
2019-11-06  9:40   ` Peter Zijlstra
2019-11-06  9:58     ` Peter Zijlstra
2019-11-06 11:28   ` Mark Rutland
2019-11-06 23:28     ` Ganapatrao Kulkarni
2019-11-07 14:35       ` Ganapatrao Kulkarni
2019-11-07 14:52       ` Mark Rutland
2019-11-07 15:45         ` Ganapatrao Kulkarni
2019-11-07 15:54           ` Mark Rutland
2019-11-07 15:04       ` Peter Zijlstra [this message]
2019-11-07 23:17   ` kbuild test robot
2019-11-06  1:01 ` [PATCH 2/2] Thunderx2, uncore: Add workaround for ThunderX2 erratum 221 Ganapatrao Prabhakerrao Kulkarni
2019-11-06 11:37   ` Mark Rutland

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=20191107150431.GC4114@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=corbet@lwn.net \
    --cc=gklkml16@gmail.com \
    --cc=gkulkarni@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=will@kernel.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 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).