mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trent Piepho <xyzzy@speakeasy.org>
To: Alex Chiang <achiang@hp.com>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	linux-pci <linux-pci@vger.kernel.org>,
	Matthew Wilcox <matthew@wil.cx>
Subject: Problems with fakephp
Date: Mon, 1 Dec 2008 05:36:50 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0812010500330.2943@shell2.speakeasy.net> (raw)
In-Reply-To: <20081128231820.GA23578@ldl.fc.hp.com>

On Fri, 28 Nov 2008, Alex Chiang wrote:
> I like this idea:
>
> 	Maybe we want a /sys/bus/pci/scan or
> 	/sys/bus/pci/devices/scan file that we can echo
> 	"0000:01:02.3" to scan just that function, or
> 	"0000:01:02" to scan the device.
>
> Will that work for you, Trent?

I don't think that's the best interface for it.  If you want to know what
bus number a SCSI bus was assigned, you can find that out from /proc/scsi.
The SCSI ID is usually explicitly set by the user on the device.  So if you
want to add a scsi device, you should be able to know all the parts of the
address.

But PCI is different.  If the PCI devices on your computer right now
disappeared from Linux, would you know their IDs off the top of your head?
I sure wouldn't.  And how would you find them out?  Suppose someone plugged
an FPGA card into a sever PCI system with multiple busses and bridges.  How
would they ever guess what ID to scan?  What function numbers might be
present once the FPGA is programmed?

I think a much more useful interface would be a "scan" file that will just
trigger a rescan of everything.  Even the users who know what ID to scan
would probably rather not be bothered to be forced to specify.

Maybe each PCI device could get a 'rescan' attribute that triggers a rescan
of that device for new functions and recursively rescans any subordinate
busses if it's a bridge?  That might be useful too.

But anyway, how about removing PCI devices.  I see adding a "remove"
attribute was mentioned.  When I first had the problem with getting the
FPGA re-scanned I was going to add something like that, but searching for
what people with a similar problem has done turned up fakephp as the
established interface.

I've made a patch to add the remove attribute.  It ends up not being that
much code.  fakephp is a lot more complex that it needs to be.

However, fakephp does not like this!  As I mentioned earlier, it can't
handle something other than itself causing a PCI device to be removed.

So I came up with a compatibility layer that creates directories in
bus/pci/slots the same way fakephp used too.  This layer _can_ handle
devices being removed (and added!) by other means.  It ends up being a lot
simpler than fakephp too.  It doesn't use hotplug at all and should be able
to coexist with real hotplug drivers and fakephp.

I'll followup with the patches.  So far this only handles removal.  I
haven't done bus rescanning yet.

  parent reply	other threads:[~2008-12-01 13:37 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-25 21:24 [PATCH] fakephp: Allocate PCI resources before adding the device Darrick J. Wong
2008-11-25 21:43 ` Greg KH
2008-11-26  4:46 ` Trent Piepho
2008-11-26  7:48   ` Darrick J. Wong
2008-11-26  9:56     ` Trent Piepho
2008-11-26 18:18       ` Darrick J. Wong
2008-11-26 22:23         ` Trent Piepho
2008-11-26 22:55           ` Alex Chiang
2008-11-27  1:44             ` Trent Piepho
2008-11-27  2:42               ` Matthew Wilcox
2008-11-28 10:11                 ` Trent Piepho
2008-11-28 18:57                   ` Matthew Wilcox
2008-11-28 21:21                     ` Trent Piepho
2008-11-28 21:30                       ` Matthew Wilcox
2008-12-01  1:10                         ` Problems with fakephp Trent Piepho
2008-12-16 20:28                           ` fixup PCI device booleans in sysfs Jesse Barnes
2008-11-28 23:18               ` [PATCH] fakephp: Allocate PCI resources before adding the device Alex Chiang
2008-12-01 13:00                 ` Problems with fakephp Trent Piepho
2008-12-01 13:36                 ` Trent Piepho [this message]
2008-12-01 14:08                   ` [PATCH] PCI: Method for removing PCI devices Trent Piepho
2008-12-01 14:40                     ` Greg KH
2008-12-01 14:08                   ` [PATCH] PCI: Legacy fakephp driver Trent Piepho
2008-12-02  3:16                   ` Problems with fakephp Alex Chiang
2008-12-03  4:07                     ` Trent Piepho
2008-12-03  4:38                       ` Alex Chiang
2008-12-03 17:22                         ` Rolf Eike Beer
2008-12-03 17:43                           ` Alex Chiang
2008-12-03 17:55                             ` Rolf Eike Beer
2008-12-03 18:22                               ` Alex Chiang
2008-12-08 21:09                                 ` Rolf Eike Beer
2008-11-27  1:52             ` [PATCH] fakephp: Allocate PCI resources before adding the device Darrick J. Wong
2008-11-28  9:51               ` Trent Piepho
2008-11-28 18:42                 ` Rolf Eike Beer
2008-11-28 21:06                   ` Trent Piepho
2008-12-01 17:08                     ` Rolf Eike Beer
2008-12-16 19:33                       ` Jesse Barnes
2008-12-16 20:56                         ` [PATCH] fakephp: Allocate PCI resources before adding the?device Darrick J. Wong
2008-12-21  2:23                           ` Trent Piepho

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=Pine.LNX.4.58.0812010500330.2943@shell2.speakeasy.net \
    --to=xyzzy@speakeasy.org \
    --cc=achiang@hp.com \
    --cc=djwong@us.ibm.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=matthew@wil.cx \
    /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®