Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Thomas Richter <tmricht@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, japo@linux.ibm.com, sumanthk@linux.ibm.com
Subject: Re: [PATCH] s390/pai: Simplify pai_init() and always return -ENODEV on failure
Date: Mon, 21 Sep 2026 15:01:16 +0200	[thread overview]
Message-ID: <20260921130116.9433D51-hca@linux.ibm.com> (raw)
In-Reply-To: <fc096eca-cc22-40e0-b059-39d02d84431f@linux.ibm.com>

On Mon, Sep 21, 2026 at 01:40:21PM +0200, Thomas Richter wrote:
> On 9/14/26 14:14, Heiko Carstens wrote:
> > On Thu, Sep 03, 2026 at 10:15:57AM +0200, Thomas Richter wrote:
> >> Code simplification and remove variable state.
> >> Return -ENODEV in all failures to indicate the PAI PMUs are not
> >> available.
> > 
> > Why do you want to hide different error / return codes? That makes
> > debugging in case of an error more difficult.
> 
> Well, hiding was not the intent.
> 
> The kernel common code does a lot of checks at event creation,
> then calls the PMU event_init() call back to install the event.
> When this fails the return code is checked and further action
> depends on this return code. See
> 
>   perf_init_event()
>   +--> perf_try_event_init()
>        +--> PMU->event_init()
> 
> See include/linux/perf_event.h for return code meanings.
> 
> When we return the value from cpuhp_setup_state(), it must no be
> -ENOENT and some other values. Because those are used for postprocessing.
> 
> Thats why I always return -ENODEV, meaning event is valid for PMU, but
> PMU not operational. I thouhgt this might fit best.

But what does have pai_init() to do with anything of the above?
pai_init() is called via init_call() mechanism.

  reply	other threads:[~2026-09-21 13:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  8:15 [PATCH] s390/pai: Simplify pai_init() and always return -ENODEV on failure Thomas Richter
2026-09-08  7:32 ` Sumanth Korikkar
2026-09-14 12:14 ` Heiko Carstens
2026-09-21 11:40   ` Thomas Richter
2026-09-21 13:01     ` Heiko Carstens [this message]
2026-09-22  9:48       ` Thomas Richter

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=20260921130116.9433D51-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=japo@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=sumanthk@linux.ibm.com \
    --cc=tmricht@linux.ibm.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