summaryrefslogtreecommitdiff
path: root/drivers/pci/hotplug/cpqphp_ctrl.c
AgeCommit message (Collapse)Author
2010-02-22PCI: Make current and maximum bus speeds part of the PCI coreMatthew Wilcox
Move the max_bus_speed and cur_bus_speed into the pci_bus. Expose the values through the PCI slot driver instead of the hotplug slot driver. Update all the hotplug drivers to use the pci_bus instead of their own data structures. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-07-12headers: smp_lock.h reduxAlexey Dobriyan
* Remove smp_lock.h from files which don't need it (including some headers!) * Add smp_lock.h to files which do need it * Make smp_lock.h include conditional in hardirq.h It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT This will make hardirq.h inclusion cheaper for every PREEMPT=n config (which includes allmodconfig/allyesconfig, BTW) Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-11PCI Hotplug: cpqphp: clean up cpqphp_ctrl.cAlex Chiang
Style and whitespace cleanups, no functional change. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-11PCI Hotplug: cpqphp: fix comment styleAlex Chiang
Fix up comments from C++ to C-style, wrapping if necessary, etc. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-11PCI Hotplug: cpqphp: stray whitespace cleanupsAlex Chiang
Clean up all stray whitespace issues, such as trailing whitespace, spaces before tabs, etc. and whatever else vim's c_space_errors highlights in red. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07PCI hotplug: remove redundant test in cpq hotplugJulia Lawall
func is checked not to be NULL a few lines before. A simplified version of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; expression E; position p1,p2; @@ if (x@p1 == NULL || ...) { ... when forall return ...; } ... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\) ( x@p2 == NULL | x@p2 != NULL ) // another path to the test that is not through p1? @s exists@ local idexpression r.x; position r.p1,r.p2; @@ ... when != x@p1 ( x@p2 == NULL | x@p2 != NULL ) @fix depends on !s@ position r.p1,r.p2; expression x,E; statement S1,S2; @@ ( - if ((x@p2 != NULL) || ...) S1 | - if ((x@p2 == NULL) && ...) S1 | - BUG_ON(x@p2 == NULL); ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07PCI hotplug: cpqphp: use config space PCI interrupt pin encodingBjorn Helgaas
This patch changes cpqphp to use interrupt pin values just as they come from PCI config space, i.e., 1=INTA, ..., 4=INTD. pcibios_set_irq_routing() takes pin arguments in the range 0=INTA, ..., 3=INTD, so we'll adjust the pin just before calling it. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2008-10-22PCI hotplug: fix logic in Compaq hotplug controller bus speed setupJulia Lawall
The pattern !E && !E->fld is nonsensical. The patch below updates this according to the assumption that && should be ||. But perhaps another solution was intended. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @disable and_comm@ expression E; identifier fld; @@ - !E && !E->fld + !E || !E->fld // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Reviewed-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2008-04-20PCI: replace remaining __FUNCTION__ occurrencesHarvey Harrison
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-11-28pci hotplug: kernel-doc fixesRandy Dunlap
acpiphp.h: not using kernel-doc, so change /** to /* acpiphp_core.c: lots of kernel-doc cleanups acpiphp_glue.c: lots of kernel-doc cleanups acpiphp_ibm.c: lots of kernel-doc cleanups cpqphp_core.c: lots of kernel-doc cleanups cpqphp_ctrl.c: lots of kernel-doc cleanups fakephp.c: correct kernel-doc notation pciehp_ctrl.c: correct kernel-doc notation rpadlpar_core.c: correct function names & kernel-doc notation rpaphp_core.c: correct kernel-doc notation shpchp_ctrl.c: correct kernel-doc notation Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Kristen Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-11-05PCI Hotplug: cpqhp_pushbutton_thread(): remove a pointless if() checkAdrian Bunk
The Coverity checker spotted that we'd have already oops'ed if "ctrl" was NULL. Additionally, "func" had just been checked for not being NULL. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-10-12pci: hotplug: cpqphp: convert to kthread infrastructureChristoph Hellwig
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-10-12PCI Hotplug: cpqphp_ctrl.c: kmalloc + memset conversion to kzallocMariusz Kozlowski
drivers/pci/hotplug/cpqphp_ctrl.c | 79698 -> 79638 (-60 bytes) drivers/pci/hotplug/cpqphp_ctrl.o | 192896 -> 192736 (-160 bytes) Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-08-22pci/hotplug/cpqphp_ctrl.c: remove stale BKL useIngo Molnar
remove stale BKL use from drivers/pci/hotplug/cpqphp_ctrl.c. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-18PCI Hotplug: move pci_hotplug.h to include/linux/Greg Kroah-Hartman
This makes it possible to build pci hotplug drivers outside of the main kernel tree, and Sam keeps telling me to move local header files to their proper places... Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-23[PATCH] PCI: cpqphp_ctrl.c: board_replaced(): remove dead codeAdrian Bunk
The Coverity checker correctly noted, that in function board_replaced in drivers/pci/hotplug/cpqphp_ctrl.c, the variable src always has the value 8, and therefore much code after the ... if (rc || src) { ... if (rc) return rc; else return 1; } ... can never be called. This patch removes the unreachable code in this function fixing kernel Bugzilla #6073. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-23[PATCH] PCI hotplug: convert semaphores to mutexIngo Molnar
semaphore to mutex conversion. the conversion was generated via scripts, and the result was validated automatically via a script as well. build tested with allyesconfig. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-09[PATCH] PCI Hotplug: cpqphp_ctrl.c: remove dead codeAdrian Bunk
The Coverity checker spotted that we already did return -ENOMEM if (!p_mem_node). Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2004-10-05[PATCH] pci hotplug/cpqphp_ctrl: replace schedule_timeout() with ↵Nishanth Aravamudan
msleep_interruptible() Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-07-12[PATCH] sparse: assorted drivers/* NULL noise removalAlexander Viro
2004-05-17PCI Hotplug: clean up a lot of global symbols that do not need to be.Greg Kroah-Hartman
2004-04-30[PATCH] Compaq PCI Hotplug: remove useless NULL checks from cpqphp_ctrl.cRolf Eike Beer
Remove useless NULL checks from cpqphp_ctrl.c. Under normal circumstances there is no chance for any of this functions to get called with a NULL argument. If we are in such trouble that we get a NULL pointer don't hide it, just oops.
2004-04-30[PATCH] Compaq PCI Hotplug: kill useless kmalloc castsRolf Eike Beer
This patch removes the cast of kmalloc's results to the target pointer type. Also it fixes kmalloc to use sizeof(*foo) instead of sizeof(type_of_foo) as suggested by Matthew Wilcox. Also removes a few useless checks if a pointer is NULL before calling kfree: kfree checks this itself.
2004-04-30[PATCH] Compaq PCI Hotplug: fix missing bracesRolf Eike Beer
Fix missing braces. It does not change the code but makes it easier to read.
2004-04-30[PATCH] Compaq PCI Hotplug: coding style fixes for cpqphp_ctrl.cRolf Eike Beer
Some coding style fixes I missed last time.
2004-04-30[PATCH] Compaq PCI Hotplug: use goto for error handling in cpqphp_ctrl.cRolf Eike Beer
Change cpqphp_ctrl.c to use goto for error handling.
2004-04-30[PATCH] Compaq PCI Hotplug: fix C++ style commentsRolf Eike Beer
This is not C++! Fix comments from C++ style to C style, removing some useless ones (e.g. no need to tell up and down protect a critical section).
2004-04-30[PATCH] Compaq PCI Hotplug: split up hardware_testRolf Eike Beer
This puts the LED shifting used as "hardware test" in a function to make cpqhp_hardware_test much smaller and easier to read. Also changes some comments from C++ to C style.
2004-04-30[PATCH] Compaq PCI Hotplug: move huge inline function out of header fileRolf Eike Beer
set_controller_speed is implemented in cpqphp.h but only used in cpqphp_ctrl.c and it's much too big to be defined in a header file. This patch moves it to cpqphp_ctrl.c. Also the inline attribute is removed, this function is called from 2 places and to big to be an inline.
2004-04-30[PATCH] Compaq PCI Hotplug: remove useless NULL checksRolf Eike Beer
Remove some useless NULL and magic checks from Compaq PCI Hotplug driver. If one of this pointers is invalid we are in bad trouble anyway.
2004-04-30[PATCH] Compaq PCI Hotplug: coding style fixesRolf Eike Beer
The usual coding style fixes, this time for cpqphp_ctrl.c and cpqphp.c.
2004-02-29[PATCH] PCI Hotplug: Patch to get cpqphp working with IOAPICTorben Mathiasen
On Fri, Feb 13 2004, Sy, Dely L wrote: > Since filling out the INTERRUPT_LINE is needed for systems running > with legacy irqs and not needed for systems running with IO-APIC. The > possible > solutions: > 1) Best is there is a run-time check (a flag or an API call) that tells > whether the system is running on legacy mode or IO-APIC mode. Is there > such check that you know of? Dan suggested that we look at what IRQ the hotplug controller has been assigned in the MPS table. If its < 0x10 we're in legacy/mapped mode. That would probaly work > > > > > > Do those servers work on 2.6.2 without my patch? > > > > > > Yes > > They work but they get dev->irq = 9 or 11 in the APIC enabled mode. > Correct? > Yes. All hot-added adapters get legacy IRQs like IRQ5 in the example below where eth2 was added after bootup: linux:~ # cat /proc/interrupts CPU0 CPU1 CPU2 CPU3 0: 831113 0 0 0 IO-APIC-edge timer 1: 255 0 0 0 IO-APIC-edge i8042 2: 0 0 0 0 XT-PIC cascade 5: 0 0 0 0 XT-PIC eth2 8: 2 0 0 0 IO-APIC-edge rtc 12: 92 0 0 0 IO-APIC-edge i8042 14: 29 0 0 0 IO-APIC-edge ide0 20: 0 0 0 0 IO-APIC-level cciss0 21: 0 0 0 0 IO-APIC-level cciss1 29: 107 0 0 0 IO-APIC-level eth0 30: 7702 0 0 0 IO-APIC-level aic7xxx 31: 30 0 0 0 IO-APIC-level aic7xxx 34: 336 0 0 0 IO-APIC-level cpqphp.o, cpqphp.o NMI: 0 0 0 0 LOC: 830760 830893 830892 830891 ERR: 0 MIS: 0 I attached a patch that does the legacy mode check that Dan suggested and IRQs for hot-added adapters seems to be given out in the APIC range.
2004-02-01[PATCH] PCI: Patch to get cpqphp working with IOAPICDely Sy
Here is a patch for to get cpqphp working with IOAPIC. My earlier statement that a kernel patch is not needed for 2.6 is true only when ACPI is enabled. A similar patch is needed in pcibios_enable_irq() for 2.4 kernel and I will send it out later. The fix is in pirq_enable_irq(). This function is called indirectly by pci_enable_device(). For device present during boot up, it should get the proper dev->irq for pcibios_fixup_irqs() has been called to get the dev->irq from MP table. If the value is still zero, then this is properly caused by "buggy MP table". For hot-plug device, its dev->irq is 0 when the pci_enable_device() is called for it hasn't gone through the fixup. Therefore, the code (similiar to the code in pcibios_fixup_irqs) is needed here.
2003-08-27[PATCH] PCI hotplug: fix up a bunch of copyrights that were incorrectly ↵Greg Kroah-Hartman
declared. It needs to be "Copyright (C)" not "Copyright (c)" according to the lawyers who know these things...
2003-06-03PCI Hotplug: move drivers/hotplug/* to drivers/pci/hotplug/*Greg Kroah-Hartman
This will let include/linux/pci.h get smaller, and is what I should have done in the first place 2 years ago...