Re: [Linux-ia64] kernel update (relative to v2.4.18)

From: KOCHI, Takayoshi <t-kouchi_at_mvf.biglobe.ne.jp>
Date: 2002-07-24 14:30:59
Hi All,

Here's a port of the ACPI PCI hotplug driver I posted to Greg K-H
last week.

This patch should apply against 2.4.18 + david's 020722 patch.
I tested this on McKinley SDV.  But this may not work depending on
firmware version.

 acpi/acpi_ksyms.c      |    1
 acpi/events/evrgnini.c |   60 +
 hotplug/Config.in      |    1
 hotplug/Makefile       |   17
 hotplug/acpiphp.h      |  322 ++++++++++
 hotplug/acpiphp_core.c |  470 +++++++++++++++
 hotplug/acpiphp_glue.c | 1514 +++++++++++++++++++++++++++++++++++++++++++++++++
 hotplug/acpiphp_pci.c  |  763 ++++++++++++++++++++++++
 hotplug/acpiphp_res.c  |  708 ++++++++++++++++++++++
 pci/names.c            |   10
 10 files changed, 3859 insertions(+), 7 deletions(-)

Although the patch to acpi_ksyms.c makes `acpi_walk_namespace'
exported, you will fail to resolve `pci_pin_to_vector' (which
is in iosapic.c) for modules.
So please compile in ACPI PCI hotplug statically.

This ACPI PCI hotplug driver implements minimal functionality
and the status is experimental.  Please do not use for production
purpose (but patches to leverage it to production level are welcome:)

This driver does not implement handling of PCI-to-PCI bridge on a card
(such as multi-port ethernet cards) yet.  So please test it with
non PCI-to-PCI bridge cards (multi-function cards are ok).


How to use:

First of all, after booting the kernel, you will have to mount `pcihpfs'
to somewhere.

# mount -t pcihpfs none /mnt/somewhere

Then you can find several ACPIxx (xx is a number) directories under the
mountpoint.  If you can't find any directory under it, your platform
doesn't support PCI hotplug or it's my bug:)

Probably you can find a tab, which is called "MRL" (manually-operated
retension latch) and green/amber leds for each PCI slot.

You can turn off a PCI card by doing

# echo 0 > /mnt/somewhere/ACPIxx/power

Or, if your platform have a push-button near the slot,
pushing it may initiate hot-remove process.
Opening an MRL means immediate shutdown of power supply and not
recommended.

Typically, inserting a card and closing MRL will initiate hot-add
process.  If it's successfully added to the system, the green LED
will be on, otherwise amber LED will be on.

And then, the hotplug subsystem will bind the inserted device to
an apropriate driver or run /sbin/hotplug.  Even if there's no driver
for the device, at least it's visible through /proc/pci
proc/bus/pci/xx/yy.

There's a GUI program to control PCI hotplug.  You can find at
http://www.kroah.com/linux/hotplug/
But I haven't tested yet...


Caveats:

If your PCI device is bound to its driver and it's not hotplug-aware,
hot-removal process may fail.  For hotplugging, a driver should support
new PCI driver interface (struct pci_driver).  For related information,
see
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0207.1/1078.html

If your card's driver don't call pci_enable_device() at startup,
your card may not operate correctly.  Because I/O port and memory-
mapped I/O space access is not enabled after PCI hotplug,
PCI device drivers are responsible for enabling them.

(For example, drivers/net/acenic.c don't call pci_enable_device() at
startup, but enables by itself...)


Related sites:

SourceForge PCI hotplug for Linux project
http://sourceforge.net/projects/pcihpd 


If there are problems (perhaps many), please report to me /
pcihpd-discuss@lists.sourceforge.net, with full dmesg.
If you don't see any legal problem, attaching /proc/acpi/dsdt is
very helpful.


On Tue, 23 Jul 2002 11:08:42 -0700
"KOCHI, Takayoshi" <t-kouchi@mvf.biglobe.ne.jp> wrote:

> For those who would like to play with PCI hotplug with ACPI,
> I'll post patches necessary for the latest 2.4.18 patch later on
> today.


Thanks,
-- 
KOCHI, Takayoshi <t-kouchi@cq.jp.nec.com/t-kouchi@mvf.biglobe.ne.jp>




Received on Tue Jul 23 21:30:32 2002

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:09 EST