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 7/7] powerpc/powernv/pci: Don't use the lower 4G TCEs in
Date: Mon, 25 Jun 2018 13:51:48 +1000	[thread overview]
Message-ID: <20180625135148.5c6722a8@aik.ozlabs.ibm.com> (raw)
In-Reply-To: <698112983.2569254.1529798098017.JavaMail.zimbra@raptorengineeringinc.com>

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

>  pseudo-DMA mode
> 
> Four TCEs are reserved for legacy 32-bit DMA mappings in psuedo DMA
> mode.  Mark these with an invalid address to avoid their use by
> the TCE cache mapper.


Can we still have 32bit DMA in the case when this new DMA is enabled?

Are the TCEs in the actual table marked invalid?

Anyway, this should be merged into the patch introducing
pnv_pci_pseudo_bypass_setup().


> 
> Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
> ---
>  arch/powerpc/platforms/powernv/pci-ioda.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
> index a6097dd323f8..e8a1333f6b3e 100644
> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> @@ -1783,7 +1783,7 @@ static bool pnv_pci_ioda_pe_single_vendor(struct pnv_ioda_pe *pe)
>  
>  static int pnv_pci_pseudo_bypass_setup(struct pnv_ioda_pe *pe)
>  {
> -	u64 tce_count, table_size, window_size;
> +	u64 i, tce_count, table_size, window_size;
>  	struct pnv_phb *p = pe->phb;
>  	struct page *table_pages;
>  	__be64 *tces;
> @@ -1835,6 +1835,12 @@ static int pnv_pci_pseudo_bypass_setup(struct pnv_ioda_pe *pe)
>  	/* mark the first 4GB as reserved so this can still be used for 32bit */
>  	bitmap_set(pe->tce_bitmap, 0, 1ULL << (32 - p->ioda.max_tce_order));
>  
> +	/* make sure reserved first 4GB TCEs are not used by the mapper
> +	 * set each address to -1, which will never match an incoming request
> +	 */
> +	for (i = 0; i < 4; i++)
> +		pe->tce_tracker[i * 2] = -1;
> +
>  	pe_info(pe, "pseudo-bypass sizes: tracker %d bitmap %d TCEs %lld\n",
>  		tracker_entries, bitmap_size, tce_count);
>  
> -- 
> 2.17.1



--
Alexey

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-23 23:54 [PATCH 7/7] powerpc/powernv/pci: Don't use the lower 4G TCEs in Timothy Pearson
2018-06-25  3:51 ` 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=20180625135148.5c6722a8@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).