From: Matthew Wilcox <willy@debian.org>
To: linux-kernel@vger.kernel.org
Cc: Patrick Mochel <mochel@osdl.org>, Greg KH <greg@kroah.com>
Subject: PCI sysfs resource handling
Date: Tue, 22 Apr 2003 14:01:52 +0100 [thread overview]
Message-ID: <20030422130152.GC3140@parcelfarce.linux.theplanet.co.uk> (raw)
As part of my PCI sysfs changes I posted on April 7th
(http://www.ussg.iu.edu/hypermail/linux/kernel/0304.0/1724.html),
I noted a TODO, to convert the `resource' file into directories.
Currently, we have:
willy@daiml:~$ cat /sys/bus/pci/devices/0000:02:00.1/resource
0x0000000000001080 0x0000000000001087 0x0000000000000101
0x0000000010801000 0x00000000108017ff 0x0000000000000200
0x0000000010801800 0x0000000010801fff 0x0000000000000200
0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000010404000 0x0000000010407fff 0x0000000000007200
The suggested plan was to make it look
like this:
/sys/bus/pci/devices/0000:02:00.1/resource0/start
/sys/bus/pci/devices/0000:02:00.1/resource0/end
/sys/bus/pci/devices/0000:02:00.1/resource0/flags
/sys/bus/pci/devices/0000:02:00.1/resource1/start
/sys/bus/pci/devices/0000:02:00.1/resource1/end
/sys/bus/pci/devices/0000:02:00.1/resource1/flags
/sys/bus/pci/devices/0000:02:00.1/resource2/start
/sys/bus/pci/devices/0000:02:00.1/resource2/end
/sys/bus/pci/devices/0000:02:00.1/resource2/flags
/sys/bus/pci/devices/0000:02:00.1/resource6/start
/sys/bus/pci/devices/0000:02:00.1/resource6/end
/sys/bus/pci/devices/0000:02:00.1/resource6/flags
with one value per file. I wasn't entirely convinced then and I'm
not convinced now. I don't think embedding a kobject in every struct
resource is really a good idea. However, I can see a good argument for
replacing the `resource' file with these files:
/sys/bus/pci/devices/0000:02:00.1/resource0
/sys/bus/pci/devices/0000:02:00.1/resource1
/sys/bus/pci/devices/0000:02:00.1/resource2
/sys/bus/pci/devices/0000:02:00.1/resource6
Here's the fruity bit though. If you cat resource1, you'd get
0x0000000010801000 0x00000000108017ff 0x0000000000000200
But if you mmaped it, you'd get the iomem from 0x10801000 to 0x108017ff
mapped into your address space. I'm a little uneasy about having a file
which has different contents based on whether you mmap it or read/write it,
but everyone expects procfs/sysfs files to be a little bit special. And
it's nothing compared to some of the crap we were doing in procfs ;-)
Comments?
--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
reply other threads:[~2003-04-22 12:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030422130152.GC3140@parcelfarce.linux.theplanet.co.uk \
--to=willy@debian.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@osdl.org \
/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®