All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Nathan Lynch via B4 Relay
	<devnull+nathanl.linux.ibm.com@kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
Cc: Nathan Lynch <nathanl@linux.ibm.com>,
	Gaurav Batra <gbatra@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/rtas: use correct function name for resetting TCE tables
Date: Fri, 23 Feb 2024 17:21:00 +1100	[thread overview]
Message-ID: <87wmqvaegj.fsf@mail.lhotse> (raw)
In-Reply-To: <20240222-rtas-fix-ibm-reset-pe-dma-window-v1-1-7aaf235ac63c@linux.ibm.com>

Nathan Lynch via B4 Relay <devnull+nathanl.linux.ibm.com@kernel.org>
writes:
> From: Nathan Lynch <nathanl@linux.ibm.com>
>
> The PAPR spec spells the function name as
>
>   "ibm,reset-pe-dma-windows"
>
> but in practice firmware uses the singular form:

Just to be clear, you're talking about IBM firmware on PowerVM machines.

>   "ibm,reset-pe-dma-window"
>
> in the device tree. Since we have the wrong spelling in the RTAS
> function table, reverse lookups (token -> name) fail and warn:
>
>   unexpected failed lookup for token 86
>   WARNING: CPU: 1 PID: 545 at arch/powerpc/kernel/rtas.c:659 __do_enter_rtas_trace+0x2a4/0x2b4
...
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index 7e793b503e29..8064d9c3de86 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -375,8 +375,13 @@ static struct rtas_function rtas_function_table[] __ro_after_init = {
>  	[RTAS_FNIDX__IBM_REMOVE_PE_DMA_WINDOW] = {
>  		.name = "ibm,remove-pe-dma-window",
>  	},
> -	[RTAS_FNIDX__IBM_RESET_PE_DMA_WINDOWS] = {
> -		.name = "ibm,reset-pe-dma-windows",
> +	[RTAS_FNIDX__IBM_RESET_PE_DMA_WINDOW] = {
> +		/*
> +		 * Note: PAPR+ v2.13 7.3.31.4.1 spells this as
> +		 * "ibm,reset-pe-dma-windows" (plural), but RTAS
> +		 * implementations use the singular form in practice.
> +		 */
> +		.name = "ibm,reset-pe-dma-window",

Qemu also spells it that way:

$ grep -C 12 ibm,reset-pe-dma-window hw/ppc/spapr_rtas_ddw.c
static void spapr_rtas_ddw_init(void)
{
    spapr_rtas_register(RTAS_IBM_QUERY_PE_DMA_WINDOW,
                        "ibm,query-pe-dma-window",
                        rtas_ibm_query_pe_dma_window);
    spapr_rtas_register(RTAS_IBM_CREATE_PE_DMA_WINDOW,
                        "ibm,create-pe-dma-window",
                        rtas_ibm_create_pe_dma_window);
    spapr_rtas_register(RTAS_IBM_REMOVE_PE_DMA_WINDOW,
                        "ibm,remove-pe-dma-window",
                        rtas_ibm_remove_pe_dma_window);
    spapr_rtas_register(RTAS_IBM_RESET_PE_DMA_WINDOW,
                        "ibm,reset-pe-dma-window",
                        rtas_ibm_reset_pe_dma_window);
}

There's no version in SLOF, it delegates to Qemu.

The old platforms that use RTAS won't implement this call at all, so
there's no issue with the naming there.

So LGTM.

cheers

  reply	other threads:[~2024-02-23  6:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 22:19 [PATCH] powerpc/rtas: use correct function name for resetting TCE tables Nathan Lynch
2024-02-22 22:19 ` Nathan Lynch via B4 Relay
2024-02-23  6:21 ` Michael Ellerman [this message]
2024-02-23 16:46   ` Nathan Lynch
2024-03-08  1:29 ` Michael Ellerman

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=87wmqvaegj.fsf@mail.lhotse \
    --to=mpe@ellerman.id.au \
    --cc=aneesh.kumar@kernel.org \
    --cc=devnull+nathanl.linux.ibm.com@kernel.org \
    --cc=gbatra@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nathanl@linux.ibm.com \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=npiggin@gmail.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.