LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Exporting PCI ROMs via syfs
@ 2004-05-21  1:05 Jon Smirl
  2004-05-21 23:38 ` Valdis.Kletnieks
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jon Smirl @ 2004-05-21  1:05 UTC (permalink / raw)
  To: lkml

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 963 bytes --]

GregKH has suggested that a good interface for accessing the contents of PCI
ROMs from user space would be to make them available from sysfs. What would be a
good way to structure the code for doing this? Should this be part of the pci
driver, and how would this interface into class_simple to make the attribute
appear?

Some problems:
Radeon cards need a work around sometimes to enable their ROM. But this can be
run once when the driver loads.
There is one card that can't access the ROM and function at the same time, I
believe Alan Cox know which one it is.

Would it be possible for this to be an automatic function of class_simple with
an API for setting a pre-enable callback? The callback would only be used for
cards with bugs like the radeon and Alan's card.

=====
Jon Smirl
jonsmirl@yahoo.com


	
		
__________________________________
Do you Yahoo!?
Yahoo! Domains – Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer 

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

* Re: Exporting PCI ROMs via syfs 
  2004-05-21  1:05 Exporting PCI ROMs via syfs Jon Smirl
@ 2004-05-21 23:38 ` Valdis.Kletnieks
  2004-05-22  2:56   ` Greg KH
  2004-05-21 23:48 ` Greg KH
  2004-05-22 21:24 ` Martin Mares
  2 siblings, 1 reply; 6+ messages in thread
From: Valdis.Kletnieks @ 2004-05-21 23:38 UTC (permalink / raw)
  To: Jon Smirl; +Cc: lkml

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

On Thu, 20 May 2004 18:05:10 PDT, Jon Smirl <jonsmirl@yahoo.com>  said:
> GregKH has suggested that a good interface for accessing the contents of PCI
> ROMs from user space would be to make them available from sysfs. What would be a
> good way to structure the code for doing this? Should this be part of the pci
> driver, and how would this interface into class_simple to make the attribute
> appear?

Hmm... how do you make that fit with the "one file, one value" rule for sysfs?
Have the "one value" be a nnnK binary blob representing the ROM image?


[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

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

* Re: Exporting PCI ROMs via syfs
  2004-05-21  1:05 Exporting PCI ROMs via syfs Jon Smirl
  2004-05-21 23:38 ` Valdis.Kletnieks
@ 2004-05-21 23:48 ` Greg KH
  2004-05-22  3:20   ` Jon Smirl
  2004-05-22 21:24 ` Martin Mares
  2 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-05-21 23:48 UTC (permalink / raw)
  To: Jon Smirl; +Cc: lkml

On Thu, May 20, 2004 at 06:05:10PM -0700, Jon Smirl wrote:
> GregKH has suggested that a good interface for accessing the contents of PCI
> ROMs from user space would be to make them available from sysfs. What would be a
> good way to structure the code for doing this? Should this be part of the pci
> driver, and how would this interface into class_simple to make the attribute
> appear?

No class_simple stuff, what about just the sysfs code for the pci device
itself?  Like where we export the config info today?

And yes, it sounds like we need a quirks file to keep some cards from
doing bad things.

thanks,

greg k-h

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

* Re: Exporting PCI ROMs via syfs
  2004-05-21 23:38 ` Valdis.Kletnieks
@ 2004-05-22  2:56   ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2004-05-22  2:56 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Jon Smirl, lkml

On Fri, May 21, 2004 at 07:38:31PM -0400, Valdis.Kletnieks@vt.edu wrote:
> On Thu, 20 May 2004 18:05:10 PDT, Jon Smirl <jonsmirl@yahoo.com>  said:
> > GregKH has suggested that a good interface for accessing the contents of PCI
> > ROMs from user space would be to make them available from sysfs. What would be a
> > good way to structure the code for doing this? Should this be part of the pci
> > driver, and how would this interface into class_simple to make the attribute
> > appear?
> 
> Hmm... how do you make that fit with the "one file, one value" rule for sysfs?
> Have the "one value" be a nnnK binary blob representing the ROM image?

Exactly, just like the pci "config" file is in sysfs today.

thanks,

greg k-h

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

* Re: Exporting PCI ROMs via syfs
  2004-05-21 23:48 ` Greg KH
@ 2004-05-22  3:20   ` Jon Smirl
  0 siblings, 0 replies; 6+ messages in thread
From: Jon Smirl @ 2004-05-22  3:20 UTC (permalink / raw)
  To: Greg KH; +Cc: lkml

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 663 bytes --]

--- Greg KH <greg@kroah.com> wrote:
> And yes, it sounds like we need a quirks file to keep some cards from
> doing bad things.

Another quirk needs to track the boot graphics device. For the boot graphics
device you would export the system RAM at C000:0 instead of exporting it's ROM.
This is because some laptops compress their video ROM or hide the video ROM in
with the system ROM. This problem only impacts the boot video device other
devices don't have this issue.

=====
Jon Smirl
jonsmirl@yahoo.com


	
		
__________________________________
Do you Yahoo!?
Yahoo! Domains – Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer 

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

* Re: Exporting PCI ROMs via syfs
  2004-05-21  1:05 Exporting PCI ROMs via syfs Jon Smirl
  2004-05-21 23:38 ` Valdis.Kletnieks
  2004-05-21 23:48 ` Greg KH
@ 2004-05-22 21:24 ` Martin Mares
  2 siblings, 0 replies; 6+ messages in thread
From: Martin Mares @ 2004-05-22 21:24 UTC (permalink / raw)
  To: Jon Smirl; +Cc: lkml

Hello!

> Some problems:
> Radeon cards need a work around sometimes to enable their ROM. But this can be
> run once when the driver loads.
> There is one card that can't access the ROM and function at the same time, I
> believe Alan Cox know which one it is.

The PCI specs explicitly allow the cards to use a single address decoder for
both the ROM address and one of the BARs and there really are cards which make
use of this silliness.

Probably the only reasonable way how to do that reliably is to make a copy of
the ROM before the device is enabled.

OTOH, it might be sensible to add a sysfs-based interface for reading the ROMs
which would be available only to root and which would work only on cards
without the shared decoders :-)

				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
To avoid bugs in your room, just keep Windows closed.

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

end of thread, other threads:[~2004-05-22 21:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-21  1:05 Exporting PCI ROMs via syfs Jon Smirl
2004-05-21 23:38 ` Valdis.Kletnieks
2004-05-22  2:56   ` Greg KH
2004-05-21 23:48 ` Greg KH
2004-05-22  3:20   ` Jon Smirl
2004-05-22 21:24 ` Martin Mares

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).