public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneeshkumar.opensource@gmail•com>
To: Balbir Singh <bsingharora@gmail•com>,
	alistair@popple•id.au, mpe@ellerman•id.au
Cc: linuxppc-dev@lists•ozlabs.org, arbab@linux•vnet.ibm.com
Subject: Re: [rfc] powerpc/npu: Cleanup MMIO ATSD flushing
Date: Mon, 30 Oct 2017 21:33:46 +0530	[thread overview]
Message-ID: <d145cb52-5321-49fa-e33a-16a40bb00640@gmail.com> (raw)
In-Reply-To: <20171030123820.29392-1-bsingharora@gmail.com>



On 10/30/2017 06:08 PM, Balbir Singh wrote:
> +
> +static void pnv_npu2_invalidate_helper(struct npu_context *npu_context,
> +		struct mm_struct *mm, unsigned long start,
> +		unsigned long end, bool flush)
> +{
> +	unsigned long address;
> +	bool is_thp;
> +	unsigned int hshift, shift;
> +
> +	address = start;
> +	do {
> +		local_irq_disable();
> +		find_linux_pte(mm->pgd, address, &is_thp, &hshift);
> +		if (!is_thp)
> +			shift = PAGE_SHIFT;
> +		else
> +			shift = hshift;

Is that correct? if is_thp is 0 can we derive shift from hshift? IIUC we 
set hshift only
if it is a hugepage.

> +		mmio_invalidate(npu_context, address > 0, address, flush,
> +				shift);
> +		local_irq_enable();
> +		address += (1ull << shift);
> +	} while (address < end);
>   }
>   
>

-aneesh

  reply	other threads:[~2017-10-30 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 12:38 [rfc] powerpc/npu: Cleanup MMIO ATSD flushing Balbir Singh
2017-10-30 16:03 ` Aneesh Kumar K.V [this message]
2017-10-30 23:28   ` Balbir Singh

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=d145cb52-5321-49fa-e33a-16a40bb00640@gmail.com \
    --to=aneeshkumar.opensource@gmail$(echo .)com \
    --cc=alistair@popple$(echo .)id.au \
    --cc=arbab@linux$(echo .)vnet.ibm.com \
    --cc=bsingharora@gmail$(echo .)com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=mpe@ellerman$(echo .)id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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