[Cbe-oss-dev] [PATCH 4/10] spidernet: zero out a pointer.

Michael Ellerman michael at ellerman.id.au
Thu May 17 09:32:56 EST 2007


On Wed, 2007-05-16 at 17:09 -0500, Linas Vepstas wrote:
> Invalidate a pointer as its pci_unmap'ed; this is a bit of 
> paranoia to make sure hardware doesn't continue trying to 
> DMA to it.
> 
> Signed-off-by: Linas Vepstas <linas at austin.ibm.com>
> 
> ----
>  drivers/net/spider_net.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6.22-rc1/drivers/net/spider_net.c
> ===================================================================
> --- linux-2.6.22-rc1.orig/drivers/net/spider_net.c	2007-05-15 13:31:11.000000000 -0500
> +++ linux-2.6.22-rc1/drivers/net/spider_net.c	2007-05-15 13:31:16.000000000 -0500
> @@ -1081,7 +1082,9 @@ spider_net_decode_one_descr(struct spide
>  	chain->tail = descr->next;
>  
>  	/* unmap descriptor */
> -	pci_unmap_single(card->pdev, hwdescr->buf_addr,
> +	hw_buf_addr = hwdescr->buf_addr;
> +	hwdescr->buf_addr = 0x0;

If you're going to be paranoid, shouldn't you do something here to make
sure the value's hit the device?

> +	pci_unmap_single(card->pdev, hw_buf_addr,
>  			SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
>  

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/cbe-oss-dev/attachments/20070517/9f4feea2/attachment.pgp>


More information about the cbe-oss-dev mailing list