android_kernel_xiaomi_sdm845/drivers/pci/hotplug
Trent Piepho ca99eb8c2d PCI: Hotplug: fakephp: Return success, not ENODEV, when bus rescan is triggered
The 'power' attribute of the fakephp driver originally only let one turn a
slot off.  If one tried to turn a slot on (echo 1 > .../power), it would
return ENODEV, as fakephp did not support this function.

An old (pre-git) patch changed this:
2004/11/11 16:33:31-08:00 jdittmer
[PATCH] fakephp: add pci bus rescan ability
http://article.gmane.org/gmane.linux.kernel/251183

Now writing "1" to the power attribute has the effect of triggering a bus
rescan, but it still returns ENODEV, probably an oversight in the above
patch.

Using the BusyBox echo will not produce an error message, but will
trigger *two* bus rescans (and return an exit code of 1):
~ # strace echo -n 1 > /sys/bus/pci/slots/0000:00:00.0/power
...
write(1, "1", 1)                        = -1 ENODEV (No such device)
write(1, "1", 1)                        = -1 ENODEV (No such device)
exit(1)                                 = ?

Using cp gives a write error, even though the write did happen and a rescan
was triggered:
~ # echo -n 1 > tmp ; cp tmp /sys/bus/pci/slots/0000:00:00.0/power
cp: Write Error: No such device

It seems much better to return success instead of failure.  The actual
status of the bus rescan is hard to return.  It happens asynchronously in a
work thread, so the sysfs store functions returns before any status is
ready (the whole point of the work queue).  And even if it didn't do this,
the rescan doesn't have any clear status to return.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
CC: Jan Dittmer <jdittmer@ppp0.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-20 21:47:09 -07:00
..
acpi_pcihp.c
acpiphp_core.c PCI: don't load acpi_php when acpi is disabled 2008-02-21 15:34:37 -08:00
acpiphp_glue.c PCI: fix section mismatch warning in pci_scan_child_bus 2008-03-04 15:07:03 -08:00
acpiphp_ibm.c PCI: hotplug: acpiphp_ibm: Remove get device information 2008-02-21 15:34:35 -08:00
acpiphp.h PCI: hotplug: acpiphp: Remove unused variable from acpiphp 2008-02-01 15:04:20 -08:00
cpci_hotplug_core.c PCI: cpci_hotplug: Convert to use the kthread API 2007-07-11 16:02:11 -07:00
cpci_hotplug_pci.c PCI: fix section mismatch warning in pci_scan_child_bus 2008-03-04 15:07:03 -08:00
cpci_hotplug.h
cpcihp_generic.c PCI Hotplug: make cpcihp driver use modern apis 2008-04-20 21:46:56 -07:00
cpcihp_zt5550.c PCI: ZT5550 CPCI Hotplug driver fix 2007-05-02 19:02:40 -07:00
cpcihp_zt5550.h
cpqphp_core.c pci hotplug: kernel-doc fixes 2007-11-28 14:35:26 -08:00
cpqphp_ctrl.c pci hotplug: kernel-doc fixes 2007-11-28 14:35:26 -08:00
cpqphp_nvram.c
cpqphp_nvram.h
cpqphp_pci.c i386: move pci 2007-10-11 11:16:36 +02:00
cpqphp_sysfs.c
cpqphp.h
fakephp.c PCI: Hotplug: fakephp: Return success, not ENODEV, when bus rescan is triggered 2008-04-20 21:47:09 -07:00
ibmphp_core.c PCI: Hotplug: Fix leaks in IBM Hot Plug Controller Driver - ibmphp_init_devno() 2008-04-20 21:47:08 -07:00
ibmphp_ebda.c PCI Hotplug: Fix small mem leak in IBM Hot Plug Controller Driver 2008-03-10 16:38:02 -07:00
ibmphp_hpc.c pci: hotplug: ibmphp: convert to kthread 2007-10-12 15:03:15 -07:00
ibmphp_pci.c
ibmphp_res.c
ibmphp.h
Kconfig PCI Hotplug: the ibm driver is not dependant on PCI_LEGACY 2008-04-20 21:46:57 -07:00
Makefile PCI: hotplug: Link fakephp last 2008-02-01 15:04:20 -08:00
pci_hotplug_core.c PCI: Add missing "space" in printk messages 2008-02-01 15:04:22 -08:00
pciehp_core.c pciehp: don't enable slot unless forced 2008-03-17 19:26:05 -07:00
pciehp_ctrl.c pciehp: wait for 1000ms before LED operation after power off 2008-02-01 15:04:28 -08:00
pciehp_hpc.c pci: hotplug: pciehp: fix error code path in hpc_power_off_slot 2008-03-04 15:07:04 -08:00
pciehp_pci.c PCI: fix section mismatch warning in pci_scan_child_bus 2008-03-04 15:07:03 -08:00
pciehp.h PCI Hotplug: pciehp: remove needless members from struct controller 2008-02-01 15:04:24 -08:00
pcihp_skeleton.c
rpadlpar_core.c [POWERPC] Merge PCI resource fixups 2007-12-20 16:18:09 +11:00
rpadlpar_sysfs.c Kobject: convert drivers/* from kobject_unregister() to kobject_put() 2008-01-24 20:40:40 -08:00
rpadlpar.h
rpaphp_core.c pci hotplug: kernel-doc fixes 2007-11-28 14:35:26 -08:00
rpaphp_pci.c pci hotplug: fix rpaphp directory naming 2008-02-01 15:04:22 -08:00
rpaphp_slot.c pci hotplug: fix rpaphp directory naming 2008-02-01 15:04:22 -08:00
rpaphp.h pci hotplug: fix rpaphp directory naming 2008-02-01 15:04:22 -08:00
sgi_hotplug.c [IA64] Fix warnings resulting from type-checking in dev_dbg() 2007-05-10 09:39:41 -07:00
shpchp_core.c PCI: fix multiple definition of `queue_pushbutton_work' 2007-05-02 19:02:34 -07:00
shpchp_ctrl.c pci hotplug: kernel-doc fixes 2007-11-28 14:35:26 -08:00
shpchp_hpc.c PCI: Spelling fixes 2008-02-01 15:04:26 -08:00
shpchp_pci.c PCI: fix section mismatch warning in pci_scan_child_bus 2008-03-04 15:07:03 -08:00
shpchp_sysfs.c
shpchp.h PCI: fix multiple definition of `queue_pushbutton_work' 2007-05-02 19:02:34 -07:00