aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMaxim Levitsky <maximlevitsky@gmail.com>2010-11-28 21:09:53 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2010-12-13 14:39:15 -0500
commitc4d6fd40df38eb4c187565d48807f5f902481ba8 (patch)
tree076b1e225faf7341149825449c528d2b99356005 /drivers
parentdd23736e092035b71df1117482b71fdfb5634239 (diff)
firewire: net: ratelimit error messages
Unfortunately its easy to trigger such error messages by removing the cable while sending streams of data over the link. Such errors are normal, and therefore this patch stops firewire-net from flooding the kernel log with these errors, by combining series of same errors together. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> (Stefan R:) Eventually we should remove this logging when firewire-net and related firewire-ohci facilities have been stabilized. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/net.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 1a467a91fb0b..ea31e3084d67 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -996,15 +996,23 @@ static void fwnet_transmit_packet_failed(struct fwnet_packet_task *ptask)
996static void fwnet_write_complete(struct fw_card *card, int rcode, 996static void fwnet_write_complete(struct fw_card *card, int rcode,
997 void *payload, size_t length, void *data) 997 void *payload, size_t length, void *data)
998{ 998{
999 struct fwnet_packet_task *ptask; 999 struct fwnet_packet_task *ptask = data;
1000 1000 static unsigned long j;
1001 ptask = data; 1001 static int last_rcode, errors_skipped;
1002 1002
1003 if (rcode == RCODE_COMPLETE) { 1003 if (rcode == RCODE_COMPLETE) {
1004 fwnet_transmit_packet_done(ptask); 1004 fwnet_transmit_packet_done(ptask);
1005 } else { 1005 } else {
1006 fw_error("fwnet_write_complete: failed: %x\n", rcode);
1007 fwnet_transmit_packet_failed(ptask); 1006 fwnet_transmit_packet_failed(ptask);
1007
1008 if (printk_timed_ratelimit(&j, 1000) || rcode != last_rcode) {
1009 fw_error("fwnet_write_complete: "
1010 "failed: %x (skipped %d)\n", rcode, errors_skipped);
1011
1012 errors_skipped = 0;
1013 last_rcode = rcode;
1014 } else
1015 errors_skipped++;
1008 } 1016 }
1009} 1017}
1010 1018