public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/1] net/fec: do not pass NULL dev to DMA API
@ 2011-04-02  6:39 Aisheng.Dong
  2011-04-02  7:57 ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Aisheng.Dong @ 2011-04-02  6:39 UTC (permalink / raw)
  To: linux-arm-kernel

Fec will crash when DMABOUNCE is enabled.
Unable to handle kernel NULL pointer dereference at virtual address 000000bc
pgd = 80004000
[000000bc] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT
last sysfs file:
Modules linked in:
CPU: 0    Not tainted  (2.6.35.3-00845-g204c152-dirty #112)
PC is at dma_map_single+0x2c/0x2a0
LR is at fec_enet_interrupt+0x1d4/0x450

The reason is DMA API of dmabounce needs the dev passed in is not NULL.

Here we'd always pass in a struct device if there is one available
for using DMA API to improve the code robustness sicne it may not
always work when passing a NULL dev.

Signed-off-by: Aisheng.Dong <b29396@freescale.com>
---
 drivers/net/fec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index cd0282d..89a2ba4 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -527,7 +527,7 @@ fec_enet_rx(struct net_device *dev)
 		dev->stats.rx_bytes += pkt_len;
 		data = (__u8*)__va(bdp->cbd_bufaddr);
 
-	        dma_unmap_single(NULL, bdp->cbd_bufaddr, bdp->cbd_datlen,
+		dma_unmap_single(&dev->dev, bdp->cbd_bufaddr, bdp->cbd_datlen,
         			DMA_FROM_DEVICE);
 
 		if (id_entry->driver_data & FEC_QUIRK_SWAP_FRAME)
@@ -552,7 +552,7 @@ fec_enet_rx(struct net_device *dev)
 			netif_rx(skb);
 		}
 
-        	bdp->cbd_bufaddr = dma_map_single(NULL, data, bdp->cbd_datlen,
+		bdp->cbd_bufaddr = dma_map_single(&dev->dev, data, bdp->cbd_datlen,
 			DMA_FROM_DEVICE);
 rx_processing_done:
 		/* Clear the status flags for this buffer */
-- 
1.7.0.4

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

* [PATCH 1/1] net/fec: do not pass NULL dev to DMA API
  2011-04-02  6:39 [PATCH 1/1] net/fec: do not pass NULL dev to DMA API Aisheng.Dong
@ 2011-04-02  7:57 ` David Miller
  2011-04-02  8:31   ` Shawn Guo
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2011-04-02  7:57 UTC (permalink / raw)
  To: linux-arm-kernel


First, your patches never make it to the mailing list because the list
server rejects your postings, due to the fact that there are syntax
errors in your email headers:

Illegal-Object:	Syntax error in From: address found on vger.kernel.org:
	From:	Aisheng.Dong<b29396@freescale.com>
				    ^-missing end of mailbox

Second, this patch does not apply to the current tree at all.
This bug has already been fixed and there are no cases where
a NULL device is passed to the DMA API interfaces any more.

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

* [PATCH 1/1] net/fec: do not pass NULL dev to DMA API
  2011-04-02  7:57 ` David Miller
@ 2011-04-02  8:31   ` Shawn Guo
  2011-04-02  8:34     ` David Miller
  2011-04-02  8:35     ` Jason Liu
  0 siblings, 2 replies; 7+ messages in thread
From: Shawn Guo @ 2011-04-02  8:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi David,

On Sat, Apr 02, 2011 at 12:57:14AM -0700, David Miller wrote:
> 
> First, your patches never make it to the mailing list because the list
> server rejects your postings, due to the fact that there are syntax
> errors in your email headers:
> 
> Illegal-Object:	Syntax error in From: address found on vger.kernel.org:
> 	From:	Aisheng.Dong<b29396@freescale.com>
> 				    ^-missing end of mailbox
> 
Yes, we were aware of that the mail did not get distributed by vger
list.  But we do not know why.  Thanks for telling.

I'm not quite sure about the "^" indication.  Is it telling that there
should be a space between display name and mail address?

-- 
Regards,
Shawn

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

* [PATCH 1/1] net/fec: do not pass NULL dev to DMA API
  2011-04-02  8:31   ` Shawn Guo
@ 2011-04-02  8:34     ` David Miller
  2011-04-02  8:35     ` Jason Liu
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2011-04-02  8:34 UTC (permalink / raw)
  To: linux-arm-kernel

From: Shawn Guo <shawn.guo@freescale.com>
Date: Sat, 2 Apr 2011 16:31:32 +0800

> I'm not quite sure about the "^" indication.  Is it telling that there
> should be a space between display name and mail address?

Yes.

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

* [PATCH 1/1] net/fec: do not pass NULL dev to DMA API
  2011-04-02  8:31   ` Shawn Guo
  2011-04-02  8:34     ` David Miller
@ 2011-04-02  8:35     ` Jason Liu
  2011-04-02  8:35       ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Jason Liu @ 2011-04-02  8:35 UTC (permalink / raw)
  To: linux-arm-kernel

2011/4/2 Shawn Guo <shawn.guo@freescale.com>:
> Hi David,
>
> On Sat, Apr 02, 2011 at 12:57:14AM -0700, David Miller wrote:
>>
>> First, your patches never make it to the mailing list because the list
>> server rejects your postings, due to the fact that there are syntax
>> errors in your email headers:
>>
>> Illegal-Object: ? ? ? Syntax error in From: address found on vger.kernel.org:
>> ? ? ? From: ? Aisheng.Dong<b29396@freescale.com>
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^-missing end of mailbox
>>
> Yes, we were aware of that the mail did not get distributed by vger
> list. ?But we do not know why. ?Thanks for telling.
>
> I'm not quite sure about the "^" indication. ?Is it telling that there
> should be a space between display name and mail address?

We should not use A.B <>, instead should use A B <>.

Jason

>
> --
> Regards,
> Shawn
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

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

* [PATCH 1/1] net/fec: do not pass NULL dev to DMA API
  2011-04-02  8:35     ` Jason Liu
@ 2011-04-02  8:35       ` David Miller
  2011-04-02  8:40         ` Dong Aisheng-B29396
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2011-04-02  8:35 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jason Liu <liu.h.jason@gmail.com>
Date: Sat, 2 Apr 2011 16:35:19 +0800

> 2011/4/2 Shawn Guo <shawn.guo@freescale.com>:
>> Hi David,
>>
>> On Sat, Apr 02, 2011 at 12:57:14AM -0700, David Miller wrote:
>>>
>>> First, your patches never make it to the mailing list because the list
>>> server rejects your postings, due to the fact that there are syntax
>>> errors in your email headers:
>>>
>>> Illegal-Object: ? ? ? Syntax error in From: address found on vger.kernel.org:
>>> ? ? ? From: ? Aisheng.Dong<b29396@freescale.com>
>>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^-missing end of mailbox
>>>
>> Yes, we were aware of that the mail did not get distributed by vger
>> list. ?But we do not know why. ?Thanks for telling.
>>
>> I'm not quite sure about the "^" indication. ?Is it telling that there
>> should be a space between display name and mail address?
> 
> We should not use A.B <>, instead should use A B <>.

Yes, this is also true.

Characters such as "." must not appear in email headers in this
context unless protected by double quotes.

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

* [PATCH 1/1] net/fec: do not pass NULL dev to DMA API
  2011-04-02  8:35       ` David Miller
@ 2011-04-02  8:40         ` Dong Aisheng-B29396
  0 siblings, 0 replies; 7+ messages in thread
From: Dong Aisheng-B29396 @ 2011-04-02  8:40 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: David Miller [mailto:davem at davemloft.net]
> Sent: Saturday, April 02, 2011 4:36 PM
> To: liu.h.jason at gmail.com
> Cc: Guo Shawn-R65073; netdev at vger.kernel.org; Dong Aisheng-B29396; linux-
> arm-kernel at lists.infradead.org
> Subject: Re: [PATCH 1/1] net/fec: do not pass NULL dev to DMA API
> 
> From: Jason Liu <liu.h.jason@gmail.com>
> Date: Sat, 2 Apr 2011 16:35:19 +0800
> 
> > 2011/4/2 Shawn Guo <shawn.guo@freescale.com>:
> >> Hi David,
> >>
> >> On Sat, Apr 02, 2011 at 12:57:14AM -0700, David Miller wrote:
> >>>
> >>> First, your patches never make it to the mailing list because the
> >>> list server rejects your postings, due to the fact that there are
> >>> syntax errors in your email headers:
> >>>
> >>> Illegal-Object: ? ? ? Syntax error in From: address found on
> vger.kernel.org:
> >>> ? ? ? From: ? Aisheng.Dong<b29396@freescale.com>
> >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^-missing end of mailbox
> >>>
> >> Yes, we were aware of that the mail did not get distributed by vger
> >> list. ?But we do not know why. ?Thanks for telling.
> >>
> >> I'm not quite sure about the "^" indication. ?Is it telling that
> >> there should be a space between display name and mail address?
> >
> > We should not use A.B <>, instead should use A B <>.
> 
> Yes, this is also true.
> 
> Characters such as "." must not appear in email headers in this context
> unless protected by double quotes.
Thanks a lot David.
This issue has bothered me a lot and finally the root cause is found.

For the patch I just found it was already fixed in your 2.6.x -next tree.
Thanks for the info.

Regards
Aisheng

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

end of thread, other threads:[~2011-04-02  8:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-02  6:39 [PATCH 1/1] net/fec: do not pass NULL dev to DMA API Aisheng.Dong
2011-04-02  7:57 ` David Miller
2011-04-02  8:31   ` Shawn Guo
2011-04-02  8:34     ` David Miller
2011-04-02  8:35     ` Jason Liu
2011-04-02  8:35       ` David Miller
2011-04-02  8:40         ` Dong Aisheng-B29396

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox