From: linas@austin.ibm.com (Linas Vepstas)
To: Jeff Garzik <jgarzik@pobox.com>, Andrew Morton <akpm@osdl.org>
Cc: netdev@vger.kernel.org, Florin Malita <fmalita@gmail.com>,
cbe-oss-dev@ozlabs.org, linuxppc-dev@ozlabs.org
Subject: [PATCH 4/10] spidernet: zero out a pointer.
Date: Tue, 22 May 2007 18:36:24 -0500 [thread overview]
Message-ID: <20070522233624.GC2147@austin.ibm.com> (raw)
In-Reply-To: <20070522230942.GT5921@austin.ibm.com>
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@austin.ibm.com>
----
drivers/net/spider_net.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Index: netdev-2.6/drivers/net/spider_net.c
===================================================================
--- netdev-2.6.orig/drivers/net/spider_net.c 2007-05-22 18:03:30.000000000 -0500
+++ netdev-2.6/drivers/net/spider_net.c 2007-05-22 18:03:32.000000000 -0500
@@ -1069,6 +1069,7 @@ spider_net_decode_one_descr(struct spide
struct spider_net_descr_chain *chain = &card->rx_chain;
struct spider_net_descr *descr = chain->tail;
struct spider_net_hw_descr *hwdescr = descr->hwdescr;
+ u32 hw_buf_addr;
int status;
status = spider_net_get_descr_status(hwdescr);
@@ -1082,7 +1083,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;
+ pci_unmap_single(card->pdev, hw_buf_addr,
SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
if ( (status == SPIDER_NET_DESCR_RESPONSE_ERROR) ||
@@ -1118,7 +1121,7 @@ spider_net_decode_one_descr(struct spide
pr_err("%s: bad status, cmd_status=x%08x\n",
card->netdev->name,
hwdescr->dmac_cmd_status);
- pr_err("buf_addr=x%08x\n", hwdescr->buf_addr);
+ pr_err("buf_addr=x%08x\n", hw_buf_addr);
pr_err("buf_size=x%08x\n", hwdescr->buf_size);
pr_err("next_descr_addr=x%08x\n", hwdescr->next_descr_addr);
pr_err("result_size=x%08x\n", hwdescr->result_size);
next prev parent reply other threads:[~2007-05-22 23:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-22 23:09 [PATCH 1/10] spidernet: skb used after netif_receive_skb Linas Vepstas
2007-05-22 23:13 ` [PATCH 2/10] spidernet: beautify error messages Linas Vepstas
2007-05-24 21:27 ` Jeff Garzik
2007-05-22 23:21 ` [PATCH 3/10] spidernet: move a block of code around Linas Vepstas
2007-05-22 23:36 ` Linas Vepstas [this message]
2007-05-22 23:39 ` [PATCH 5/10] spidernet: null out skb pointer after its been used Linas Vepstas
2007-05-22 23:40 ` [PATCH 6/10] spidernet: Don't terminate the RX ring Linas Vepstas
2007-05-22 23:42 ` [PATCH 7/10] spidernet: enhance the dump routine Linas Vepstas
2007-05-22 23:45 ` [PATCH 8/10] spidernet: reset the card when an rxramfull is seen Linas Vepstas
2007-05-22 23:47 ` [PATCH 9/10] spidernet: service TX later Linas Vepstas
2007-05-22 23:52 ` [PATCH 10/10] spidernet: increase the NAPI weight Linas Vepstas
2007-05-24 21:25 ` [PATCH 1/10] spidernet: skb used after netif_receive_skb Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070522233624.GC2147@austin.ibm.com \
--to=linas@austin.ibm.com \
--cc=akpm@osdl.org \
--cc=cbe-oss-dev@ozlabs.org \
--cc=fmalita@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).