Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Thomas Richter <tmricht@linux.ibm.com>
To: Heiko Carstens <hca@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: Tue, 22 Sep 2026 11:48:05 +0200	[thread overview]
Message-ID: <42dea0c9-b588-4416-ac1e-e42e8187bb7a@linux.ibm.com> (raw)
In-Reply-To: <20260921130116.9433D51-hca@linux.ibm.com>

On 9/21/26 15:01, Heiko Carstens wrote:
> 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.


Ahh well, that is correct... lets drop it. Sorry for the noise.

-- 
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
IBM Deutschland Research & Development GmbH

Vorsitzender des Aufsichtsrats: Wolfgang Wendt

Geschäftsführung: David Faller

Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

      reply	other threads:[~2026-09-22  9:48 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
2026-09-22  9:48       ` Thomas Richter [this message]

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=42dea0c9-b588-4416-ac1e-e42e8187bb7a@linux.ibm.com \
    --to=tmricht@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=japo@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=sumanthk@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