linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Timothy Pearson <tpearson@raptorengineering.com>
Cc: linuxppc-dev@lists.ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 4/7] powerpc/powernv/pci: Safety fixes for pseudobypass TCE
Date: Mon, 25 Jun 2018 13:46:18 +1000	[thread overview]
Message-ID: <20180625134618.4ba3b4a9@aik.ozlabs.ibm.com> (raw)
In-Reply-To: <955790001.2569251.1529798034743.JavaMail.zimbra@raptorengineeringinc.com>

On Sat, 23 Jun 2018 18:53:54 -0500 (CDT)
Timothy Pearson <tpearson@raptorengineering.com> wrote:

>  allocation
> 
> Signed-off-by: Russell Currey <ruscur@russell.cc>
> ---
>  arch/powerpc/platforms/powernv/pci-dma.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/pci-dma.c b/arch/powerpc/platforms/powernv/pci-dma.c
> index 1d5409be343e..237940a2a052 100644
> --- a/arch/powerpc/platforms/powernv/pci-dma.c
> +++ b/arch/powerpc/platforms/powernv/pci-dma.c
> @@ -29,8 +29,9 @@ static int dma_pseudo_bypass_select_tce(struct pnv_ioda_pe *pe, phys_addr_t addr
>  {
>  	int tce;
>  	__be64 old, new;
> +	unsigned long flags;
>  
> -	;
> +	spin_lock_irqsave(&pe->tce_alloc_lock, flags);


No commit log and this actually should be merged into the patch
introducing spin_lock(&pe->tce_alloc_lock).


>  	tce = bitmap_find_next_zero_area(pe->tce_bitmap,
>  					 pe->tce_count,
>  					 0,
> @@ -40,9 +41,10 @@ static int dma_pseudo_bypass_select_tce(struct pnv_ioda_pe *pe, phys_addr_t addr
>  	old = pe->tces[tce];
>  	new = cpu_to_be64(addr | TCE_PCI_READ | TCE_PCI_WRITE);
>  	pe->tces[tce] = new;
> +	mb();
>  	pe_info(pe, "allocating TCE %i 0x%016llx (old 0x%016llx)\n",
>  		tce, new, old);
> -	spin_unlock(&pe->tce_alloc_lock);
> +	spin_unlock_irqrestore(&pe->tce_alloc_lock, flags);
>  
>  	return tce;
>  }
> -- 
> 2.17.1



--
Alexey

      reply	other threads:[~2018-06-25  3:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-23 23:53 [PATCH 4/7] powerpc/powernv/pci: Safety fixes for pseudobypass TCE Timothy Pearson
2018-06-25  3:46 ` Alexey Kardashevskiy [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=20180625134618.4ba3b4a9@aik.ozlabs.ibm.com \
    --to=aik@ozlabs.ru \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=tpearson@raptorengineering.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;
as well as URLs for NNTP newsgroup(s).