public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Chiang <achiang@hp.com>
To: Trent Piepho <xyzzy@speakeasy.org>
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: Re: Problems with fakephp
Date: Mon, 1 Dec 2008 20:16:03 -0700	[thread overview]
Message-ID: <20081202031602.GG19000@ldl.fc.hp.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0812010500330.2943@shell2.speakeasy.net> <Pine.LNX.4.58.0812010356410.2943@shell2.speakeasy.net>

Hi Trent,

I think there are now enough ideas in this thread that they're
starting to get confusing.

	1) Function vs. device removal
	2) User interface
	3) Existing fakephp bugs

For (1), do you need function level hotplug? Or will you be able
to get away with device level?

The answer to (2) will naturally flow from your answer to (1).

A few responses for you, along with some of my thoughts...

* Trent Piepho <xyzzy@speakeasy.org>:
> It looks like you weren't opposed to reverting the original
> patch.  I think that should be done for 2.6.27 and 2.6.28, to
> restore the existing interface.  

Unfortunately, it won't be that simple. The reason is, the PCI
slot logic expects a bus/slot tuple. It doesn't know anything
about functions. In the context of the original goal (physical
slots), this design decision made sense.

So we can't do a simple revert of fe99740c because:

	- fakephp registers with PCI hotplug core for device xxxx:yy.0
	- fakephp tries to register device xxxx:yy.1
	- PCI hotplug core returns -EBUSY because the _device_ is
	  already claimed

I played around with this today and encountered the above problem.

Now, if _device_ level hotplug is sufficient for you, then fixing
(2) and (3) within the context of fakephp is pretty easy. The
interface would have the limitation of only displaying function 0
per given device.

[root@canola slots]# pwd
/sys/bus/pci/slots

# my test patch applied to fakephp to get domain:bus:slot.fn in sysfs
[root@canola slots]# ls
0000:00:01.0  0000:0f:00.0  0000:4e:00.0  0000:50:01.0  0000:c2:00.0
0000:00:02.0  0000:10:00.0  0000:4f:00.0  0000:51:00.0
0000:00:04.0  0000:48:02.0  0000:50:00.0  0000:89:00.0

We can then work on fixing the fakephp bugs that you've found.

Something tells me that you're interested in _function_ level
hotplug though. Can you confirm this?

> What should be done is to create a better interface for
> disabling PCI devices/functions/bridges and re-scanning.  Then
> create a compatibility system that will allow software the used
> fakephp to continue to work.  Now fakephp can change to be more
> like a real hotplug driver.  At some time in future, the
> compatibility layer, which will have been listed in the feature
> removal schedule, can be removed.

I took a _very_ brief look at the compatibility driver you wrote.
It _is_ a lot simpler than fakephp. ;)

You've convinced me that the 'fake%d' names are pretty useless. I
was thinking of submitting my test patch that shows the
domain:bus:slot.fn output above.

If I do that, then fakephp will have issues with the
legacy_fakephp driver you wrote because we will have name
collisions in sysfs.

So the question is, do we keep the existing sucky fakephp mess
that I created and go with your new legacy driver as the way
forward?

Or do we try and fix up fakephp?

Again, I think the answer to this question is whether you need
function or device level hotplug. If the former, then we go with
your new legacy driver and the fakephp interface has to remain
sucky.

If the latter, then we can keep fakephp and just get it usable
again.

> I also noticed this in drivers/pci/probe.c:pci_scan_device()
> 
> list_for_each_entry(slot, &bus->slots, list)
> 	if(PCI_SLOT(devfn) == slot->number)
> 		dev->slot = slot;
> 
> This appears to assume that there will only one slot with a given number
> on the same bus.  But if fakephp and real hotplug driver are both loaded,
> this won't be the case anymore, will it?

Only one hotplug driver can claim a device at a time, so the
above won't be an issue.

> 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.

Yes, I think a generic /sys/bus/pci/scan is a good idea.

> 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.

Also a good idea.

Thanks.

/ac


  reply	other threads:[~2008-12-02  3:16 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-02  3:16                   ` Alex Chiang [this message]
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-12-01 13:36                 ` Trent Piepho
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-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=20081202031602.GG19000@ldl.fc.hp.com \
    --to=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 \
    --cc=xyzzy@speakeasy.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