public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names.
@ 2004-01-15  3:28 Kieran Morrissey
  2004-01-15  4:05 ` Jeff Garzik
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Kieran Morrissey @ 2004-01-15  3:28 UTC (permalink / raw)
  To: greg KH; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2397 bytes --]

Hi all and sundry..

Although /proc/pci and by extension the name database is allegedly legacy 
and therefore deprecated, some (including myself) still use it for things 
such as phpSysInfo, and the still-widespread usage of it is obvious in the 
regularity of slight patches to pci.ids. So, this is an all-inclusive patch 
to bring things up to date:

* Updates pci.ids with a snapshot from http://pciids.sourceforge.net/ as at 
14 Jan 04.
* Fixes gen-devlist.c to truncate long device names rather than reject the 
whole database
   (previously the latest databases had some devices that were too long and 
caused a kernel with the latest db to fail to compile)

I've included the (minor) changes to gen-devlist.c in this email if anyone 
cares to discuss them, but since the pci database changes aren't really 
that worthy of discussion on the list and the patch is 83kb, THE COMPLETE 
PATCH has been posted on the web:

http://digital.mgpenguin.net/linux/patch-2.6.1.pci-db/patch.2.6.1.pci-db.diff

or http://digital.mgpenguin.net/linux/ for bzipped versions if you're that 
way inclined..

Cheers,

	Kieran Morrissey


diff -urN -X dontdiff a/drivers/pci/gen-devlist.c b/drivers/pci/gen-devlist.c
--- a/drivers/pci/gen-devlist.c	2003-12-18 13:58:49.000000000 +1100
+++ b/drivers/pci/gen-devlist.c	2004-01-15 13:30:54.929783941 +1100
@@ -10,9 +10,10 @@
  #define MAX_NAME_SIZE 79

  static void
-pq(FILE *f, const char *c)
+pq(FILE *f, const char *c, int len)
  {
-	while (*c) {
+	int i = 1;
+	while (*c && i != len) {
  		if (*c == '"')
  			fprintf(f, "\\\"");
  		else {
@@ -23,6 +24,7 @@
  			}
  		}
  		c++;
+		i++;
  	}
  }

@@ -72,13 +74,13 @@
  						if (bra && bra > c && bra[-1] == ' ')
  							bra[-1] = 0;
  						if (vendor_len + strlen(c) + 1 > MAX_NAME_SIZE) {
-							fprintf(stderr, "Line %d: Device name too long\n", lino);
+							fprintf(stderr, "Line %d: Device name too long. Name truncated.\n", 
lino);
  							fprintf(stderr, "%s\n", c);
-							return 1;
+							/*return 1;*/
  						}
  					}
  					fprintf(devf, "\tDEVICE(%s,%s,\"", vend, line+1);
-					pq(devf, c);
+					pq(devf, c, MAX_NAME_SIZE - vendor_len - 1);
  					fputs("\")\n", devf);
  				} else goto err;
  				break;
@@ -107,7 +109,7 @@
  				return 1;
  			}
  			fprintf(devf, "VENDOR(%s,\"", vend);
-			pq(devf, c);
+			pq(devf, c, 0);
  			fputs("\")\n", devf);
  			mode = 1;
  		} else {

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names.
  2004-01-15  3:28 [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names Kieran Morrissey
@ 2004-01-15  4:05 ` Jeff Garzik
  2004-01-15  9:17   ` Ingo Oeser
  2004-01-16  1:23   ` Greg KH
  2004-01-16  1:24 ` Greg KH
  2004-01-17 10:39 ` Martin Mares
  2 siblings, 2 replies; 10+ messages in thread
From: Jeff Garzik @ 2004-01-15  4:05 UTC (permalink / raw)
  To: Kieran Morrissey; +Cc: greg KH, linux-kernel

Kieran Morrissey wrote:
> Hi all and sundry..
> 
> Although /proc/pci and by extension the name database is allegedly 
> legacy and therefore deprecated, some (including myself) still use it 
> for things such as phpSysInfo, and the still-widespread usage of it is 
> obvious in the regularity of slight patches to pci.ids. So, this is an 
> all-inclusive patch to bring things up to date:
> 
> * Updates pci.ids with a snapshot from http://pciids.sourceforge.net/ as 
> at 14 Jan 04.
> * Fixes gen-devlist.c to truncate long device names rather than reject 
> the whole database
>   (previously the latest databases had some devices that were too long 
> and caused a kernel with the latest db to fail to compile)


Well, appreciated, but we really do need to remove it.  We don't need 
these strings in the kernel at all.  pci.ids is just a static lookup 
table that is best kept in userspace.

	Jeff




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for  long device names.
  2004-01-15  4:05 ` Jeff Garzik
@ 2004-01-15  9:17   ` Ingo Oeser
  2004-01-16  1:23   ` Greg KH
  1 sibling, 0 replies; 10+ messages in thread
From: Ingo Oeser @ 2004-01-15  9:17 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 15 January 2004 05:05, Jeff Garzik wrote:
> We don't need these strings in the kernel at all.  pci.ids is just a
> static lookup table that is best kept in userspace.

Where it is always out of date, according to my experience. People tend
to update their kernel more often than lspci, so on most machines I've
been on, I usally point lspci to the kernel copy of it.

sth. needs to be done in this area in the main distros (e.g. more
frequent updates of just this file as a package would be fine).


Regards

Ingo Oeser

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFABlqhU56oYWuOrkARAs9AAKDhW5bfSVSV6VqpF1e7aDxgy3ZuQwCeKAk6
Bqu9S7eWlqtwLlimEA2Y0mE=
=Rvll
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names.
  2004-01-15  4:05 ` Jeff Garzik
  2004-01-15  9:17   ` Ingo Oeser
@ 2004-01-16  1:23   ` Greg KH
  2004-01-16  4:25     ` Dave Jones
  1 sibling, 1 reply; 10+ messages in thread
From: Greg KH @ 2004-01-16  1:23 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Kieran Morrissey, linux-kernel

On Wed, Jan 14, 2004 at 11:05:28PM -0500, Jeff Garzik wrote:
> Kieran Morrissey wrote:
> >Hi all and sundry..
> >
> >Although /proc/pci and by extension the name database is allegedly 
> >legacy and therefore deprecated, some (including myself) still use it 
> >for things such as phpSysInfo, and the still-widespread usage of it is 
> >obvious in the regularity of slight patches to pci.ids. So, this is an 
> >all-inclusive patch to bring things up to date:
> >
> >* Updates pci.ids with a snapshot from http://pciids.sourceforge.net/ as 
> >at 14 Jan 04.
> >* Fixes gen-devlist.c to truncate long device names rather than reject 
> >the whole database
> >  (previously the latest databases had some devices that were too long 
> >and caused a kernel with the latest db to fail to compile)
> 
> 
> Well, appreciated, but we really do need to remove it.  We don't need 
> these strings in the kernel at all.  pci.ids is just a static lookup 
> table that is best kept in userspace.

It will be removed in 2.7.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names.
  2004-01-15  3:28 [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names Kieran Morrissey
  2004-01-15  4:05 ` Jeff Garzik
@ 2004-01-16  1:24 ` Greg KH
  2004-01-17 10:39 ` Martin Mares
  2 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2004-01-16  1:24 UTC (permalink / raw)
  To: Kieran Morrissey; +Cc: linux-kernel

On Thu, Jan 15, 2004 at 02:28:39PM +1100, Kieran Morrissey wrote:
> Hi all and sundry..
> 
> Although /proc/pci and by extension the name database is allegedly legacy 
> and therefore deprecated, some (including myself) still use it for things 
> such as phpSysInfo, and the still-widespread usage of it is obvious in the 
> regularity of slight patches to pci.ids. So, this is an all-inclusive patch 
> to bring things up to date:
> 
> * Updates pci.ids with a snapshot from http://pciids.sourceforge.net/ as at 
> 14 Jan 04.
> * Fixes gen-devlist.c to truncate long device names rather than reject the 
> whole database
>   (previously the latest databases had some devices that were too long and 
> caused a kernel with the latest db to fail to compile)

Your patch is line-wrapped and can't be applied.

Please try it again.

> I've included the (minor) changes to gen-devlist.c in this email if anyone 
> cares to discuss them, but since the pci database changes aren't really 
> that worthy of discussion on the list and the patch is 83kb, THE COMPLETE 
> PATCH has been posted on the web:
> 
> http://digital.mgpenguin.net/linux/patch-2.6.1.pci-db/patch.2.6.1.pci-db.diff

Feel free to just send this patch to me, as it's much easier for me to
apply this if I get an email with it in it (include the description
please too.)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names.
  2004-01-16  1:23   ` Greg KH
@ 2004-01-16  4:25     ` Dave Jones
  2004-01-20  1:29       ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Jones @ 2004-01-16  4:25 UTC (permalink / raw)
  To: Greg KH; +Cc: Jeff Garzik, Kieran Morrissey, linux-kernel

On Thu, Jan 15, 2004 at 05:23:14PM -0800, Greg KH wrote:

 > > Well, appreciated, but we really do need to remove it.  We don't need 
 > > these strings in the kernel at all.  pci.ids is just a static lookup 
 > > table that is best kept in userspace.
 > 
 > It will be removed in 2.7.

So I'm the only one with deja vu ?

My recollection of history went something like..

2.2 - Marked as OBSOLETE when /proc/bus/pci came to town.
      iirc, even Martin Mares (PCI maintainer at the time) wanted
	  it removed in 2.3.x
2.3 - Linus decides he likes it, and wants to keep it.
2.4 - Unmarked OBSOLETE
2.5 - Silence, (though we now get PCI stuff in /sys too, woo!)
2.6 - "It will be removed in 2.7"

Anyone else spot a pattern ?  8-)

		Dave


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names.
  2004-01-15  3:28 [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names Kieran Morrissey
  2004-01-15  4:05 ` Jeff Garzik
  2004-01-16  1:24 ` Greg KH
@ 2004-01-17 10:39 ` Martin Mares
  2004-01-20  1:30   ` Greg KH
  2 siblings, 1 reply; 10+ messages in thread
From: Martin Mares @ 2004-01-17 10:39 UTC (permalink / raw)
  To: Kieran Morrissey; +Cc: greg KH, linux-kernel

Hello!

> * Updates pci.ids with a snapshot from http://pciids.sourceforge.net/ as at 
> 14 Jan 04.
> * Fixes gen-devlist.c to truncate long device names rather than reject the 
> whole database
>   (previously the latest databases had some devices that were too long and 
> caused a kernel with the latest db to fail to compile)

I think it would be better to increase the name length limit, the long entries
really have useful information at the end :)

				Have a nice fortnight
-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names.
  2004-01-16  4:25     ` Dave Jones
@ 2004-01-20  1:29       ` Greg KH
  0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2004-01-20  1:29 UTC (permalink / raw)
  To: Dave Jones, Jeff Garzik, Kieran Morrissey, linux-kernel

On Fri, Jan 16, 2004 at 04:25:00AM +0000, Dave Jones wrote:
> On Thu, Jan 15, 2004 at 05:23:14PM -0800, Greg KH wrote:
> 
>  > > Well, appreciated, but we really do need to remove it.  We don't need 
>  > > these strings in the kernel at all.  pci.ids is just a static lookup 
>  > > table that is best kept in userspace.
>  > 
>  > It will be removed in 2.7.
> 
> So I'm the only one with deja vu ?
> 
> My recollection of history went something like..
> 
> 2.2 - Marked as OBSOLETE when /proc/bus/pci came to town.
>       iirc, even Martin Mares (PCI maintainer at the time) wanted
> 	  it removed in 2.3.x
> 2.3 - Linus decides he likes it, and wants to keep it.
> 2.4 - Unmarked OBSOLETE
> 2.5 - Silence, (though we now get PCI stuff in /sys too, woo!)

No, we tried in 2.5 too.  Linus said it wanted to keep it as a CONFIG
option for now, so we can drop it in 2.7.

> 2.6 - "It will be removed in 2.7"
> 
> Anyone else spot a pattern ?  8-)

Heh, well, we can try again :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names.
  2004-01-17 10:39 ` Martin Mares
@ 2004-01-20  1:30   ` Greg KH
  2004-01-20  5:07     ` Kieran Morrissey
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2004-01-20  1:30 UTC (permalink / raw)
  To: Martin Mares; +Cc: Kieran Morrissey, linux-kernel

On Sat, Jan 17, 2004 at 11:39:00AM +0100, Martin Mares wrote:
> Hello!
> 
> > * Updates pci.ids with a snapshot from http://pciids.sourceforge.net/ as at 
> > 14 Jan 04.
> > * Fixes gen-devlist.c to truncate long device names rather than reject the 
> > whole database
> >   (previously the latest databases had some devices that were too long and 
> > caused a kernel with the latest db to fail to compile)
> 
> I think it would be better to increase the name length limit, the long entries
> really have useful information at the end :)

That's probably a good idea.  Kieran, care to make up a patch to do
this?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names.
  2004-01-20  1:30   ` Greg KH
@ 2004-01-20  5:07     ` Kieran Morrissey
  0 siblings, 0 replies; 10+ messages in thread
From: Kieran Morrissey @ 2004-01-20  5:07 UTC (permalink / raw)
  To: Greg KH; +Cc: Martin Mares, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

At 05:30 PM 19/01/2004 -0800, you wrote:

>On Sat, Jan 17, 2004 at 11:39:00AM +0100, Martin Mares wrote:
>> Hello!
>> 
>> > * Updates pci.ids with a snapshot from http://pciids.sourceforge.net/ as at 
>> > 14 Jan 04.
>> > * Fixes gen-devlist.c to truncate long device names rather than reject the 
>> > whole database
>> >   (previously the latest databases had some devices that were too long and 
>> > caused a kernel with the latest db to fail to compile)
>> 
>> I think it would be better to increase the name length limit, the long entries
>> really have useful information at the end :)
>
>That's probably a good idea.  Kieran, care to make up a patch to do
>this?
>
>thanks,
>
>greg k-h

Done (see other message).. but does anyone know why the name size limit was introduced in 2.5? Saving memory? (all of 30-odd bytes per device, say 480 bytes in an average system? seems silly to reduce functionality that much to achieve such a tiny space saving; I mean it's understandable perhaps on an embedded system, but you wouldn't be compiling the database in then :)

Cheers

        Kieran

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-01-20  5:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-15  3:28 [PATCH] 2.6.1: Update PCI Name database, fix gen-devlist.c for long device names Kieran Morrissey
2004-01-15  4:05 ` Jeff Garzik
2004-01-15  9:17   ` Ingo Oeser
2004-01-16  1:23   ` Greg KH
2004-01-16  4:25     ` Dave Jones
2004-01-20  1:29       ` Greg KH
2004-01-16  1:24 ` Greg KH
2004-01-17 10:39 ` Martin Mares
2004-01-20  1:30   ` Greg KH
2004-01-20  5:07     ` Kieran Morrissey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox