diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2010-10-20 18:25:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-21 04:32:48 -0400 |
commit | d827d86b6fe87b420ef3c0685ab580290ae64beb (patch) | |
tree | 9225a175bd59ab37638daf50346ec2a79d272930 /drivers/net/r8169.c | |
parent | fccec10b33503a2b1197c8e7a3abd30443bedb08 (diff) |
r8169: print errors when dma mapping fail
If dma mapping fail we are dropping packages or fail to open device.
But exact reason of drop/fail stays unknow for a user, so print errors.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 0204fe2b2490..d88ce9fb1cbd 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -3974,8 +3974,11 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp, | |||
3974 | 3974 | ||
3975 | mapping = dma_map_single(d, rtl8169_align(data), rx_buf_sz, | 3975 | mapping = dma_map_single(d, rtl8169_align(data), rx_buf_sz, |
3976 | DMA_FROM_DEVICE); | 3976 | DMA_FROM_DEVICE); |
3977 | if (unlikely(dma_mapping_error(d, mapping))) | 3977 | if (unlikely(dma_mapping_error(d, mapping))) { |
3978 | if (net_ratelimit()) | ||
3979 | netif_err(tp, drv, tp->dev, "Failed to map RX DMA!\n"); | ||
3978 | goto err_out; | 3980 | goto err_out; |
3981 | } | ||
3979 | 3982 | ||
3980 | rtl8169_map_to_asic(desc, mapping, rx_buf_sz); | 3983 | rtl8169_map_to_asic(desc, mapping, rx_buf_sz); |
3981 | return data; | 3984 | return data; |
@@ -4203,8 +4206,12 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb, | |||
4203 | len = frag->size; | 4206 | len = frag->size; |
4204 | addr = ((void *) page_address(frag->page)) + frag->page_offset; | 4207 | addr = ((void *) page_address(frag->page)) + frag->page_offset; |
4205 | mapping = dma_map_single(d, addr, len, DMA_TO_DEVICE); | 4208 | mapping = dma_map_single(d, addr, len, DMA_TO_DEVICE); |
4206 | if (unlikely(dma_mapping_error(d, mapping))) | 4209 | if (unlikely(dma_mapping_error(d, mapping))) { |
4210 | if (net_ratelimit()) | ||
4211 | netif_err(tp, drv, tp->dev, | ||
4212 | "Failed to map TX fragments DMA!\n"); | ||
4207 | goto err_out; | 4213 | goto err_out; |
4214 | } | ||
4208 | 4215 | ||
4209 | /* anti gcc 2.95.3 bugware (sic) */ | 4216 | /* anti gcc 2.95.3 bugware (sic) */ |
4210 | status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC)); | 4217 | status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC)); |
@@ -4270,8 +4277,11 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
4270 | 4277 | ||
4271 | len = skb_headlen(skb); | 4278 | len = skb_headlen(skb); |
4272 | mapping = dma_map_single(d, skb->data, len, DMA_TO_DEVICE); | 4279 | mapping = dma_map_single(d, skb->data, len, DMA_TO_DEVICE); |
4273 | if (unlikely(dma_mapping_error(d, mapping))) | 4280 | if (unlikely(dma_mapping_error(d, mapping))) { |
4281 | if (net_ratelimit()) | ||
4282 | netif_err(tp, drv, dev, "Failed to map TX DMA!\n"); | ||
4274 | goto err_dma_0; | 4283 | goto err_dma_0; |
4284 | } | ||
4275 | 4285 | ||
4276 | tp->tx_skb[entry].len = len; | 4286 | tp->tx_skb[entry].len = len; |
4277 | txd->addr = cpu_to_le64(mapping); | 4287 | txd->addr = cpu_to_le64(mapping); |