From patchwork Sat Jul 4 13:34:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Mare=C5=A1?= X-Patchwork-Id: 34059 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n64DUxYN008970 for ; Sat, 4 Jul 2009 13:34:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752716AbZGDNez (ORCPT ); Sat, 4 Jul 2009 09:34:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752817AbZGDNez (ORCPT ); Sat, 4 Jul 2009 09:34:55 -0400 Received: from jabberwock.ucw.cz ([89.250.246.4]:51328 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752716AbZGDNey (ORCPT ); Sat, 4 Jul 2009 09:34:54 -0400 Received: from albireo.ucw.cz (albireo.ucw.cz [89.239.2.32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "albireo.ucw.cz", Issuer "ucw.cz" (verified OK)) by jabberwock.ucw.cz (Postfix) with ESMTP id 46D6F34182 for ; Sat, 4 Jul 2009 15:34:57 +0200 (CEST) Received: by albireo.ucw.cz (Postfix, from userid 1000) id B1791110797; Sat, 4 Jul 2009 15:34:58 +0200 (CEST) Date: Sat, 4 Jul 2009 15:34:58 +0200 From: Martin Mares To: Matthew Wilcox Cc: linux-pci@vger.kernel.org Subject: Re: [pciutils] Stop early if the VPD is corrupt Message-ID: References: <20090513214446.GN15360@parisc-linux.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090513214446.GN15360@parisc-linux.org> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Hello! > I have several cards which report more-or-less garbage in their VPD. > It can take an extraordinarily long time to read all their VPD and none > of it is of interest. Instead, if we find an unknown resource type, > just stop trying to read any more. This seems wise to do, but we should warn the user. I have applied your patch with the following on top of it: commit 169bfd45a4b05df0b6c4a0c17be36d66b6046ab7 Author: Martin Mares Date: Sat Jul 4 15:33:31 2009 +0200 Improve the VPD fix to warn the user that VPD decoding was aborted. Have a nice fortnight diff --git a/ls-vpd.c b/ls-vpd.c index 6ded2d8..35c2bfa 100644 --- a/ls-vpd.c +++ b/ls-vpd.c @@ -196,7 +196,7 @@ cap_vpd(struct device *d) break; default: - printf("\t\tUnknown %s resource type %02x\n", + printf("\t\tUnknown %s resource type %02x, will not decode more.\n", (tag & 0x80) ? "large" : "small", tag & ~0x80); return; }