Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1587031 > unrolled thread
| Started by | Thierry Reding <thierry.reding@gmail.com> |
|---|---|
| First post | 2017-02-23 18:30 +0100 |
| Last post | 2017-02-27 11:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 3/7] net: stmmac: Check for DMA mapping errors Thierry Reding <thierry.reding@gmail.com> - 2017-02-23 18:30 +0100
Re: [PATCH 3/7] net: stmmac: Check for DMA mapping errors Mikko Perttunen <cyndis@kapsi.fi> - 2017-02-27 11:40 +0100
| From | Thierry Reding <thierry.reding@gmail.com> |
|---|---|
| Date | 2017-02-23 18:30 +0100 |
| Subject | [PATCH 3/7] net: stmmac: Check for DMA mapping errors |
| Message-ID | <te5nj-4nQ-3@gated-at.bofh.it> |
From: Thierry Reding <treding@nvidia.com> When DMA mapping an SKB fragment, the mapping must be checked for errors, otherwise the DMA debug code will complain upon unmap. Signed-off-by: Thierry Reding <treding@nvidia.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 6b7a5ce19589..d7387919bdb6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2072,6 +2072,8 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) des = skb_frag_dma_map(priv->device, frag, 0, skb_frag_size(frag), DMA_TO_DEVICE); + if (dma_mapping_error(priv->device, des)) + goto dma_map_err; stmmac_tso_allocator(priv, des, skb_frag_size(frag), (i == nfrags - 1)); -- 2.11.1
[toc] | [next] | [standalone]
| From | Mikko Perttunen <cyndis@kapsi.fi> |
|---|---|
| Date | 2017-02-27 11:40 +0100 |
| Message-ID | <tfqSJ-4fZ-1@gated-at.bofh.it> |
| In reply to | #1587031 |
On 23.02.2017 19:24, Thierry Reding wrote: > From: Thierry Reding <treding@nvidia.com> > > When DMA mapping an SKB fragment, the mapping must be checked for > errors, otherwise the DMA debug code will complain upon unmap. > > Signed-off-by: Thierry Reding <treding@nvidia.com> > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index 6b7a5ce19589..d7387919bdb6 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -2072,6 +2072,8 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) > des = skb_frag_dma_map(priv->device, frag, 0, > skb_frag_size(frag), > DMA_TO_DEVICE); > + if (dma_mapping_error(priv->device, des)) > + goto dma_map_err; If this map fails, we should also unmap the previously mapped fragments and the separate mapping made using dma_map_single. > > stmmac_tso_allocator(priv, des, skb_frag_size(frag), > (i == nfrags - 1)); >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web