ieee1394: reduce log noise about config ROM CRC errors

This avoids redundant messages about a special and usually harmless
firmware flaw.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

+22 -10
+22 -10
drivers/ieee1394/csr1212.c
··· 1049 1049 return -ENOENT; 1050 1050 } 1051 1051 1052 + /* 1053 + * Apparently there are many different wrong implementations of the CRC 1054 + * algorithm. We don't fail, we just warn... approximately once per GUID. 1055 + */ 1056 + static void 1057 + csr1212_check_crc(const u32 *buffer, size_t length, u16 crc, __be32 *guid) 1058 + { 1059 + static u64 last_bad_eui64; 1060 + u64 eui64 = ((u64)be32_to_cpu(guid[0]) << 32) | be32_to_cpu(guid[1]); 1061 + 1062 + if (csr1212_crc16(buffer, length) == crc || 1063 + csr1212_msft_crc16(buffer, length) == crc || 1064 + eui64 == last_bad_eui64) 1065 + return; 1066 + 1067 + printk(KERN_DEBUG "ieee1394: config ROM CRC error\n"); 1068 + last_bad_eui64 = eui64; 1069 + } 1052 1070 1053 1071 /* Parse a chunk of data as a Config ROM */ 1054 1072 ··· 1110 1092 return ret; 1111 1093 } 1112 1094 1113 - /* Apparently there are many different wrong implementations of the CRC 1114 - * algorithm. We don't fail, we just warn. */ 1115 - if ((csr1212_crc16(bi->data, bi->crc_length) != bi->crc) && 1116 - (csr1212_msft_crc16(bi->data, bi->crc_length) != bi->crc)) 1117 - printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n"); 1095 + csr1212_check_crc(bi->data, bi->crc_length, bi->crc, 1096 + &csr->bus_info_data[3]); 1118 1097 1119 1098 cr = CSR1212_MALLOC(sizeof(*cr)); 1120 1099 if (!cr) ··· 1220 1205 &cache->data[bytes_to_quads(kv->offset - cache->offset)]; 1221 1206 kvi_len = be16_to_cpu(kvi->length); 1222 1207 1223 - /* Apparently there are many different wrong implementations of the CRC 1224 - * algorithm. We don't fail, we just warn. */ 1225 - if ((csr1212_crc16(kvi->data, kvi_len) != kvi->crc) && 1226 - (csr1212_msft_crc16(kvi->data, kvi_len) != kvi->crc)) 1227 - printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n"); 1208 + /* GUID is wrong in here in case of extended ROM. We don't care. */ 1209 + csr1212_check_crc(kvi->data, kvi_len, kvi->crc, &cache->data[3]); 1228 1210 1229 1211 switch (kv->key.type) { 1230 1212 case CSR1212_KV_TYPE_DIRECTORY: