Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1734554

Re: [PATCH net 1/3] net: mvpp2: fix the dma_mask and coherent_dma_mask settings for PPv2.2

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH net 1/3] net: mvpp2: fix the dma_mask and coherent_dma_mask settings for PPv2.2
Date 2017-09-19 02:20 +0200
Message-ID <ureqB-5il-3@gated-at.bofh.it> (permalink)
References <ur3Yd-6J3-3@gated-at.bofh.it> <ur3Yd-6J3-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Antoine Tenart <antoine.tenart@free-electrons.com>
Date: Mon, 18 Sep 2017 15:04:06 +0200

> The dev->dma_mask usually points to dev->coherent_dma_mask. This is an
> issue as setting both of them will override the other. This is
> problematic here as the PPv2 driver uses a 32-bit-mask for coherent
> accesses (txq, rxq, bm) and a 40-bit mask for all other accesses due to
> an hardware limitation.
> 
> This can lead to a memory remap for all dma_map_single() calls when
> dealing with memory above 4GB.
> 
> Fixes: 2067e0a13cfe ("net: mvpp2: set dma mask and coherent dma mask on PPv2.2")
> Reported-by: Stefan Chulski <stefanc@marvell.com>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>

Yikes.

I surrmise that if the platform has made dev->dma_mask point to
&dev->coherent_dma_mask, it is because it does not allow the two
settings to be set separately.

By rearranging the pointer, you are bypassing that, and probably
breaking things or creating a situation that the DMA mapping
layer is not expecting.

I want to know more about the situations where dma_mask is set to
point to &coherent_dma_mask and how that is supposed to work.

At a minimum this commit log message needs to go into more detail.

Thanks.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net 1/3] net: mvpp2: fix the dma_mask and coherent_dma_mask settings for PPv2.2 Antoine Tenart <antoine.tenart@free-electrons.com> - 2017-09-18 15:10 +0200
  Re: [PATCH net 1/3] net: mvpp2: fix the dma_mask and  coherent_dma_mask settings for PPv2.2 David Miller <davem@davemloft.net> - 2017-09-19 02:20 +0200
    Re: [PATCH net 1/3] net: mvpp2: fix the dma_mask and  coherent_dma_mask settings for PPv2.2 Antoine Tenart <antoine.tenart@free-electrons.com> - 2017-09-21 16:30 +0200
      Re: [PATCH net 1/3] net: mvpp2: fix the dma_mask and  coherent_dma_mask settings for PPv2.2 David Miller <davem@davemloft.net> - 2017-09-21 19:40 +0200
        Re: [PATCH net 1/3] net: mvpp2: fix the dma_mask and  coherent_dma_mask settings for PPv2.2 Antoine Tenart <antoine.tenart@free-electrons.com> - 2017-09-25 14:50 +0200

csiph-web