From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Miles Lane <miles.lane@gmail.com>
Cc: linux-kernel@vger.kernel.org,
linux1394-devel@lists.sourceforge.net,
"Dan Noé" <dpn@isomerica.net>
Subject: [PATCH] ieee1394: reduce log noise about config ROM CRC errors
Date: Fri, 2 May 2008 20:14:52 +0200 (CEST) [thread overview]
Message-ID: <tkrat.c81e039fca12e91f@s5r6.in-berlin.de> (raw)
In-Reply-To: <a44ae5cd0805010608n6c441082udd00c315e786de40@mail.gmail.com>
On 1 May, Miles Lane wrote:
> ohci1394: fw-host0: SelfID received outside of bus reset sequence
> IEEE 1394 device has ROM CRC error
> IEEE 1394 device has ROM CRC error
> Program usplash tried to access /dev/mem between 0->8000000.
> ieee1394: Node added: ID:BUS[0-00:1023] GUID[00d0f54000000173]
> ieee1394: Host added: ID:BUS[0-01:1023] GUID[00e018000027d06c]
> IEEE 1394 device has ROM CRC error
> IEEE 1394 device has ROM CRC error
> IEEE 1394 device has ROM CRC error
> IEEE 1394 device has ROM CRC error
> IEEE 1394 device has ROM CRC error
>
> Also, "cat /sys/bus/ieee1394/drivers/raw1394/device_ids" no longer
> causes an error.
>
> Is it necessary for the code to spit out so many CRC errors for the
> OrangeMicro iBot?
This avoids redundant messages about a special and usually harmless
firmware flaw.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
drivers/ieee1394/csr1212.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
Index: linux/drivers/ieee1394/csr1212.c
===================================================================
--- linux.orig/drivers/ieee1394/csr1212.c
+++ linux/drivers/ieee1394/csr1212.c
@@ -1049,6 +1049,24 @@ int csr1212_read(struct csr1212_csr *csr
return -ENOENT;
}
+/*
+ * Apparently there are many different wrong implementations of the CRC
+ * algorithm. We don't fail, we just warn... approximately once per GUID.
+ */
+static void
+csr1212_check_crc(const u32 *buffer, size_t length, u16 crc, __be32 *guid)
+{
+ static u64 last_bad_eui64;
+ u64 eui64 = ((u64)be32_to_cpu(guid[0]) << 32) | be32_to_cpu(guid[1]);
+
+ if (csr1212_crc16(buffer, length) == crc ||
+ csr1212_msft_crc16(buffer, length) == crc ||
+ eui64 == last_bad_eui64)
+ return;
+
+ printk(KERN_DEBUG "ieee1394: config ROM CRC error\n");
+ last_bad_eui64 = eui64;
+}
/* Parse a chunk of data as a Config ROM */
@@ -1092,11 +1110,8 @@ static int csr1212_parse_bus_info_block(
return ret;
}
- /* Apparently there are many different wrong implementations of the CRC
- * algorithm. We don't fail, we just warn. */
- if ((csr1212_crc16(bi->data, bi->crc_length) != bi->crc) &&
- (csr1212_msft_crc16(bi->data, bi->crc_length) != bi->crc))
- printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n");
+ csr1212_check_crc(bi->data, bi->crc_length, bi->crc,
+ &csr->bus_info_data[3]);
cr = CSR1212_MALLOC(sizeof(*cr));
if (!cr)
@@ -1205,11 +1220,8 @@ int csr1212_parse_keyval(struct csr1212_
&cache->data[bytes_to_quads(kv->offset - cache->offset)];
kvi_len = be16_to_cpu(kvi->length);
- /* Apparently there are many different wrong implementations of the CRC
- * algorithm. We don't fail, we just warn. */
- if ((csr1212_crc16(kvi->data, kvi_len) != kvi->crc) &&
- (csr1212_msft_crc16(kvi->data, kvi_len) != kvi->crc))
- printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n");
+ /* GUID is wrong in here in case of extended ROM. We don't care. */
+ csr1212_check_crc(kvi->data, kvi_len, kvi->crc, &cache->data[3]);
switch (kv->key.type) {
case CSR1212_KV_TYPE_DIRECTORY:
--
Stefan Richter
-=====-==--- -=-= ---=-
http://arcgraph.de/sr/
prev parent reply other threads:[~2008-05-02 18:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-01 0:29 2.6.25-git16 -- BUG: unable to handle kernel NULL pointer dereference at 00000000 -- IP: [<c02dd5d5>] fw_show_drv_device_ids+0xd9/0xee Miles Lane
2008-05-01 8:43 ` Stefan Richter
2008-05-01 13:08 ` Miles Lane
2008-05-01 13:44 ` Stefan Richter
2008-05-01 14:37 ` Dan Noé
2008-05-01 15:05 ` Stefan Richter
2008-05-02 18:14 ` Stefan Richter [this message]
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=tkrat.c81e039fca12e91f@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=dpn@isomerica.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=miles.lane@gmail.com \
/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
all inboxes | Powered by JetHome®