All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: linuxppc-dev@lists.ozlabs.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 03/10] powerpc/xive: rename xive_poke_esb in xive_esb_read
Date: Wed, 9 Aug 2017 13:55:34 +1000	[thread overview]
Message-ID: <20170809035534.GD13670@umbus.fritz.box> (raw)
In-Reply-To: <1502182579-990-4-git-send-email-clg@kaod.org>

[-- Attachment #1: Type: text/plain, Size: 3785 bytes --]

On Tue, Aug 08, 2017 at 10:56:13AM +0200, Cédric Le Goater wrote:
> xive_poke_esb() is performing a load/read so it is better named as
> xive_esb_read().

Uh, patch seems to mismatch the comment here, calling it
xive_peek_esb() instead.

Does reading the ESB had a side effect on the hardware?  If so "poke"
might be an appropriate name.

> Also introduce a XIVE_ESB_LOAD_EOI read when EOI'ing
> LSI interrupts.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>  arch/powerpc/sysdev/xive/common.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
> index 6595462b1fc8..e6b245bb9602 100644
> --- a/arch/powerpc/sysdev/xive/common.c
> +++ b/arch/powerpc/sysdev/xive/common.c
> @@ -190,7 +190,7 @@ static u32 xive_scan_interrupts(struct xive_cpu *xc, bool just_peek)
>   * This is used to perform the magic loads from an ESB
>   * described in xive.h
>   */
> -static u8 xive_poke_esb(struct xive_irq_data *xd, u32 offset)
> +static u8 xive_peek_esb(struct xive_irq_data *xd, u32 offset)
>  {
>  	u64 val;
>  
> @@ -227,7 +227,7 @@ void xmon_xive_do_dump(int cpu)
>  	xive_dump_eq("IRQ", &xc->queue[xive_irq_priority]);
>  #ifdef CONFIG_SMP
>  	{
> -		u64 val = xive_poke_esb(&xc->ipi_data, XIVE_ESB_GET);
> +		u64 val = xive_peek_esb(&xc->ipi_data, XIVE_ESB_GET);
>  		xmon_printf("  IPI state: %x:%c%c\n", xc->hw_ipi,
>  			val & XIVE_ESB_VAL_P ? 'P' : 'p',
>  			val & XIVE_ESB_VAL_P ? 'Q' : 'q');
> @@ -326,9 +326,9 @@ void xive_do_source_eoi(u32 hw_irq, struct xive_irq_data *xd)
>  		 * properly.
>  		 */
>  		if (xd->flags & XIVE_IRQ_FLAG_LSI)
> -			in_be64(xd->eoi_mmio);
> +			xive_peek_esb(xd, XIVE_ESB_LOAD_EOI);
>  		else {
> -			eoi_val = xive_poke_esb(xd, XIVE_ESB_SET_PQ_00);
> +			eoi_val = xive_peek_esb(xd, XIVE_ESB_SET_PQ_00);
>  			DBG_VERBOSE("eoi_val=%x\n", offset, eoi_val);
>  
>  			/* Re-trigger if needed */
> @@ -383,12 +383,12 @@ static void xive_do_source_set_mask(struct xive_irq_data *xd,
>  	 * ESB accordingly on unmask.
>  	 */
>  	if (mask) {
> -		val = xive_poke_esb(xd, XIVE_ESB_SET_PQ_01);
> +		val = xive_peek_esb(xd, XIVE_ESB_SET_PQ_01);
>  		xd->saved_p = !!(val & XIVE_ESB_VAL_P);
>  	} else if (xd->saved_p)
> -		xive_poke_esb(xd, XIVE_ESB_SET_PQ_10);
> +		xive_peek_esb(xd, XIVE_ESB_SET_PQ_10);
>  	else
> -		xive_poke_esb(xd, XIVE_ESB_SET_PQ_00);
> +		xive_peek_esb(xd, XIVE_ESB_SET_PQ_00);
>  }
>  
>  /*
> @@ -768,7 +768,7 @@ static int xive_irq_retrigger(struct irq_data *d)
>  	 * To perform a retrigger, we first set the PQ bits to
>  	 * 11, then perform an EOI.
>  	 */
> -	xive_poke_esb(xd, XIVE_ESB_SET_PQ_11);
> +	xive_peek_esb(xd, XIVE_ESB_SET_PQ_11);
>  
>  	/*
>  	 * Note: We pass "0" to the hw_irq argument in order to
> @@ -803,7 +803,7 @@ static int xive_irq_set_vcpu_affinity(struct irq_data *d, void *state)
>  		irqd_set_forwarded_to_vcpu(d);
>  
>  		/* Set it to PQ=10 state to prevent further sends */
> -		pq = xive_poke_esb(xd, XIVE_ESB_SET_PQ_10);
> +		pq = xive_peek_esb(xd, XIVE_ESB_SET_PQ_10);
>  
>  		/* No target ? nothing to do */
>  		if (xd->target == XIVE_INVALID_TARGET) {
> @@ -832,7 +832,7 @@ static int xive_irq_set_vcpu_affinity(struct irq_data *d, void *state)
>  		 * for sure the queue slot is no longer in use.
>  		 */
>  		if (pq & 2) {
> -			pq = xive_poke_esb(xd, XIVE_ESB_SET_PQ_11);
> +			pq = xive_peek_esb(xd, XIVE_ESB_SET_PQ_11);
>  			xd->saved_p = true;
>  
>  			/*

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-08-09  4:03 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08  8:56 [PATCH 00/10] guest exploitation of the XIVE interrupt controller Cédric Le Goater
2017-08-08  8:56 ` [PATCH 01/10] powerpc/xive: fix OV5_XIVE_EXPLOIT bits Cédric Le Goater
2017-08-08  8:56 ` [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller Cédric Le Goater
2017-08-09  3:53   ` David Gibson
2017-08-09  8:48     ` Cédric Le Goater
2017-08-10  4:28       ` David Gibson
2017-08-10  4:46         ` Benjamin Herrenschmidt
2017-08-10  5:54           ` David Gibson
2017-08-10  7:04             ` Cédric Le Goater
2017-08-10  6:45           ` Cédric Le Goater
2017-08-10 11:33             ` Benjamin Herrenschmidt
2017-08-10  7:19         ` Cédric Le Goater
2017-08-10 11:36           ` Benjamin Herrenschmidt
2017-08-11  3:55             ` David Gibson
2017-08-08  8:56 ` [PATCH 03/10] powerpc/xive: rename xive_poke_esb in xive_esb_read Cédric Le Goater
2017-08-09  3:55   ` David Gibson [this message]
2017-08-09  7:12     ` Cédric Le Goater
2017-08-09  7:31       ` David Gibson
2017-08-08  8:56 ` [PATCH 04/10] powerpc/xive: introduce xive_esb_write Cédric Le Goater
2017-08-08  8:56 ` [PATCH 05/10] powerpc/xive: add the HW IRQ number under xive_irq_data Cédric Le Goater
2017-08-08  8:56 ` [PATCH 06/10] powerpc/xive: introduce H_INT_ESB hcall Cédric Le Goater
2017-08-08  8:56 ` [PATCH 07/10] powerpc/xive: add XIVE exploitation mode to CAS Cédric Le Goater
2017-08-10 10:20   ` Cédric Le Goater
2017-08-08  8:56 ` [PATCH 08/10] powerpc/xive: take into account '/ibm, plat-res-int-priorities' Cédric Le Goater
2017-08-09  4:02   ` [PATCH 08/10] powerpc/xive: take into account '/ibm,plat-res-int-priorities' David Gibson
2017-08-09  7:14     ` Cédric Le Goater
2017-08-10  0:54       ` David Gibson
2017-08-08  8:56 ` [PATCH 09/10] powerpc/xive: improve debugging macros Cédric Le Goater

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=20170809035534.GD13670@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=clg@kaod.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.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.