All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kernel] powerpc/powernv/ioda2: Reduce upper limit for DMA window size (retry)
@ 2018-09-11  5:38 Alexey Kardashevskiy
  2018-09-21 11:59 ` [kernel] " Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Kardashevskiy @ 2018-09-11  5:38 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Alexey Kardashevskiy, Michael Ellerman

We use PHB in mode1 which uses bit 59 to select a correct DMA window.
However there is mode2 which uses bits 59:55 and allows up to 32 DMA
windows per a PE.

Even though documentation does not clearly specify that, it seems that
the actual hardware does not support bits 59:55 even in mode1, in other
words we can create a window as big as 1<<58 but DMA simply won't work.

This reduces the upper limit from 59 to 55 bits to let the userspace know
about the hardware limits.

Fixes: ce57c6610cc2 "Merge branch 'topic/ppc-kvm' into next"
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---

The merge commit says  d3d4ffaae439 (the original of this one) was
propagated but it was not:

[vpl1 kernel]$ git s ce57c6610cc2:arch/powerpc/platforms/powernv/pci-ioda-tce.c | grep 'page_shift >= '
        if ((level_shift - 3) * levels + page_shift >= 60)

---
 arch/powerpc/platforms/powernv/pci-ioda-tce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda-tce.c b/arch/powerpc/platforms/powernv/pci-ioda-tce.c
index 6c5db1a..fe96910 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda-tce.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda-tce.c
@@ -276,7 +276,7 @@ long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset,
 	level_shift = entries_shift + 3;
 	level_shift = max_t(unsigned int, level_shift, PAGE_SHIFT);
 
-	if ((level_shift - 3) * levels + page_shift >= 60)
+	if ((level_shift - 3) * levels + page_shift >= 55)
 		return -EINVAL;
 
 	/* Allocate TCE table */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [kernel] powerpc/powernv/ioda2: Reduce upper limit for DMA window size (retry)
  2018-09-11  5:38 [PATCH kernel] powerpc/powernv/ioda2: Reduce upper limit for DMA window size (retry) Alexey Kardashevskiy
@ 2018-09-21 11:59 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-09-21 11:59 UTC (permalink / raw)
  To: Alexey Kardashevskiy, linuxppc-dev; +Cc: Alexey Kardashevskiy

On Tue, 2018-09-11 at 05:38:05 UTC, Alexey Kardashevskiy wrote:
> We use PHB in mode1 which uses bit 59 to select a correct DMA window.
> However there is mode2 which uses bits 59:55 and allows up to 32 DMA
> windows per a PE.
> 
> Even though documentation does not clearly specify that, it seems that
> the actual hardware does not support bits 59:55 even in mode1, in other
> words we can create a window as big as 1<<58 but DMA simply won't work.
> 
> This reduces the upper limit from 59 to 55 bits to let the userspace know
> about the hardware limits.
> 
> Fixes: ce57c6610cc2 "Merge branch 'topic/ppc-kvm' into next"
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/7233b8cab39014620ac9534da11f0f

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-21 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11  5:38 [PATCH kernel] powerpc/powernv/ioda2: Reduce upper limit for DMA window size (retry) Alexey Kardashevskiy
2018-09-21 11:59 ` [kernel] " Michael Ellerman

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.