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...
Matt Domsch [Fri, 29 Sep 2006 20:23:23 +0000 (15:23 -0500)]
PCI: optionally sort device lists breadth-first
Problem:
New Dell PowerEdge servers have 2 embedded ethernet ports, which are
labeled NIC1 and NIC2 on the chassis, in the BIOS setup screens, and
in the printed documentation. Assuming no other add-in ethernet ports
in the system, Linux 2.4 kernels name these eth0 and eth1
respectively. Many people have come to expect this naming. Linux 2.6
kernels name these eth1 and eth0 respectively (backwards from
expectations). I also have reports that various Sun and HP servers
have similar behavior.
Root cause:
Linux 2.4 kernels walk the pci_devices list, which happens to be
sorted in breadth-first order (or pcbios_find_device order on i386,
which most often is breadth-first also). 2.6 kernels have both the
pci_devices list and the pci_bus_type.klist_devices list, the latter
is what is walked at driver load time to match the pci_id tables; this
klist happens to be in depth-first order.
On systems where, for physical routing reasons, NIC1 appears on a
lower bus number than NIC2, but NIC2's bridge is discovered first in
the depth-first ordering, NIC2 will be discovered before NIC1. If the
list were sorted breadth-first, NIC1 would be discovered before NIC2.
A PowerEdge 1955 system has the following topology which easily
exhibits the difference between depth-first and breadth-first device
lists.
-[0000:00]-+-00.0 Intel Corporation 5000P Chipset Memory Controller Hub
+-02.0-[0000:03-08]--+-00.0-[0000:04-07]--+-00.0-[0000:05-06]----00.0-[0000:06]----00.0 Broadcom Corporation NetXtreme II BCM5708S Gigabit Ethernet (labeled NIC2, 2.4 kernel name eth1, 2.6 kernel name eth0)
+-1c.0-[0000:01-02]----00.0-[0000:02]----00.0 Broadcom Corporation NetXtreme II BCM5708S Gigabit Ethernet (labeled NIC1, 2.4 kernel name eth0, 2.6 kernel name eth1)
Other factors, such as device driver load order and the presence of
PCI slots at various points in the bus hierarchy further complicate
this problem; I'm not trying to solve those here, just restore the
device order, and thus basic behavior, that 2.4 kernels had.
Solution:
The solution can come in multiple steps.
Suggested fix #1: kernel
Patch below optionally sorts the two device lists into breadth-first
ordering to maintain compatibility with 2.4 kernels. It adds two new
command line options:
pci=bfsort
pci=nobfsort
to force the sort order, or not, as you wish. It also adds DMI checks
for the specific Dell systems which exhibit "backwards" ordering, to
make them "right".
Suggested fix #2: udev rules from userland
Many people also have the expectation that embedded NICs are always
discovered before add-in NICs (which this patch does not try to do).
Using the PCI IRQ Routing Table provided by system BIOS, it's easy to
determine which PCI devices are embedded, or if add-in, which PCI slot
they're in. I'm working on a tool that would allow udev to name
ethernet devices in ascending embedded, slot 1 .. slot N order,
subsort by PCI bus/dev/fn breadth-first. It'll be possible to use it
independent of udev as well for those distributions that don't use
udev in their installers.
Suggested fix #3: system board routing rules
One can constrain the system board layout to put NIC1 ahead of NIC2
regardless of breadth-first or depth-first discovery order. This adds
a significant level of complexity to board routing, and may not be
possible in all instances (witness the above systems from several
major manufacturers). I don't want to encourage this particular train
of thought too far, at the expense of not doing #1 or #2 above.
Feedback appreciated. Patch tested on a Dell PowerEdge 1955 blade
with 2.6.18.
You'll also note I took some liberty and temporarily break the klist
abstraction to simplify and speed up the sort algorithm. I think
that's both safe and appropriate in this instance.
Signed-off-by: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Akinobu Mita [Fri, 13 Oct 2006 18:07:30 +0000 (03:07 +0900)]
cpcihp_generic: prevent loading without "bridge" parameter
cpcihp_generic module requires configured "bridge" module parameter.
But it can be loaded successfully without that parameter.
Because module init call ends up returning positive value.
This patch prevents from loading without setting "bridge" module parameter.
Signed-off-by: Akinbou Mita <akinobu.mita@gmail.com> Signed-off-by: Scott Murray <scottm@somanetworks.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
PCI: fix pcie_portdrv_restore_config undefined without CONFIG_PM error
On Thu, 2006-09-28 at 03:42, Olaf Hering wrote:
> PCI-Express AER implemetation: pcie_portdrv error handler
>
> This patch breaks if CONFIG_PM is not enabled,
> pcie_portdrv_restore_config() will be undefined.
I move the definition of pcie_portdrv_restore_config
out of CONFIG_PM.
Below patch is against 2.6.18-mm1. Could you try it?
The ACPIPnP implementation had the understanding of Linux resource flags very
wrong, resulting in a nonfunctional implementation of DMA resource
allocation.
This was usually not a problem, since almost no on-board PnP devices use ISA
DMA, with the exception of ECP parallel ports. Even with that, parallel port
DMA is preconfigured by the BIOS, so this routine isn't normally called.
Except in the case where somebody does 'rmmod parport_pc; modprobe
parport_pc', where the rmmod case disables the ECP parallel port resources,
and they need to be enabled again to initialize the module. This didn't
work, resulting in a non-printing printer.
The application doing exactly the above to force reprobing of printers is
the YaST printer module. Thus without this fix YaST wedged the printer when
configuring it, and was not able to print a test page.
PCI: Turn pci_fixup_video into generic for embedded VGA
pci_fixup_video turns into generic code because there are many platforms need this fixup
for embedded VGA as well as x86. The Video BIOS integrates into System BIOS on a machine
has embedded VGA although embedded VGA generally don't have PCI ROM. As a result,
embedded VGA need the way that the sysfs rom points to the Video BIOS of System
RAM (0xC0000). PCI-to-PCI Bridge Architecture specification describes the condition whether
or not PCI ROM forwards VGA compatible memory address. fixup_video suits this specification.
Although the Video ROM generally implements in x86 code regardless of platform, some
application such as X Window System can run this code by dosemu86. Therefore,
pci_fixup_video should turn into generic code.
Daniel Drake [Mon, 25 Sep 2006 23:52:19 +0000 (16:52 -0700)]
PCI: VIA IRQ quirk behaviour change
The most recent VIA IRQ quirk changes have broken various VIA devices for
some users. We are not able to add these devices to the blacklist as they
are also available in PCI-card form, and running the quirk on these devices
brings us back to square one (running the VIA quirk on non-VIA boards where
the quirk is not needed).
This patch, based on suggestions from Sergey Vlasov, implements a scheme
similar to but more restrictive than the scheme we had in 2.6.16 and
earlier. It runs the quirk on all VIA hardware, but *only* if a VIA
southbridge was detected on the system.
To further reduce the amount of quirked devices, this patch includes a
change suggested by Linus at http://lkml.org/lkml/2005/9/27/113 This
ensures that devices bound to non-legacy IO-APIC interrupt lines are not
quirked. We have made one change to Linus' suggestion: we do a comparison
of ">15" rather than ">=15", as 15 is still in the legacy interrupt range.
There is still a downside to this patch: if the user inserts a VIA PCI card
into a VIA-based motherboard, in some circumstances the quirk will also run
on the VIA PCI card. This corner case is hard to avoid.
Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch fixes the problem that system will panic if multiple power
on/off operations are issued to the same slot in parallel. This
problem can be easily reproduced by commands below.
# while true; do echo 1 > power; echo 0 > power; done &
# while true; do echo 1 > power; echo 0 > power; done &
The cause is lack of locking for enable/disable operations. This patch
fixes this problem.
The slot number displayed in info messages would cause a confusion
because those are displayed in several ways (decimal and hex).
Furthermore, those slot number is not same as slot name (directory
name). This patch fixes those improper info messages.
David S. Miller [Wed, 18 Oct 2006 02:04:44 +0000 (19:04 -0700)]
[SPARC64]: Fix PCI memory space root resource on Hummingbird.
For Hummingbird PCI controllers, we should create the root
PCI memory space resource as the full 4GB area, and then
allocate the IOMMU DMA translation window out of there.
The old code just assumed that the IOMMU DMA translation base
to the top of the 4GB area was unusable. This is not true on
many systems such as SB100 and SB150, where the IOMMU DMA
translation window sits at 0xc0000000->0xdfffffff.
So what would happen is that any device mapped by the firmware
at the top section 0xe0000000->0xffffffff would get remapped
by Linux somewhere else leading to all kinds of problems and
boot failures.
While we're here, report more cases of OBP resource assignment
conflicts. The only truly valid ones are ROM resource conflicts.
Signed-off-by: David S. Miller <davem@davemloft.net>
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (47 commits)
USB: Add device id for Sierra Wireless MC8755
USB: cleanup sierra wireless driver a bit
USB: Sierra Wireless driver update
USB: ftdi_sio whitespace fixes
USB-SERIAL:cp2101 Add new device ID
USB/gadget/net2280: handle sysfs errors
usbtouchscreen: fix data reading for ITM touchscreens
UEAGLE: fix ueagle-atm Oops
USB: xpad: dance pad support
USB: input: extract() and implement() are bit field manipulation routines
USB: Memory leak in drivers/usb/serial/airprime.c
USB Storage: unusual_devs.h entry for Sony Ericsson P990i
USB: fix usbatm tiny race
USB: unusual_devs entry for Nokia 6234
USB: mos7840.c: fix a check-after-dereference
USB: ftdi-elan.c: remove dead code
USB: Mitsumi USB FDD 061M: UNUSUAL_DEV multilun fix
USB: fix dereference in drivers/usb/misc/adutux.c
USB: add USB serial mos7720 driver
USB: move trancevibrator.c to the proper usb directory
...
Linus Torvalds [Tue, 17 Oct 2006 22:04:45 +0000 (15:04 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
IB/mthca: Use mmiowb after doorbell ring
IB/ipath: Initialize diagpkt file on device init only
RDMA/amso1100: Fix a NULL dereference in error path
RDMA/amso1100: pci_module_init() conversion
Kevin Lloyd [Sat, 14 Oct 2006 06:53:21 +0000 (23:53 -0700)]
USB: Sierra Wireless driver update
The largest feature in this patch is that it adds significant throughput
increase to the Sierra driver and adds support for modem status line
control (e.g. the DTR line). This patch also updates the current sierra.c
driver so that it supports both 3-port Sierra devices and 1-port legacy
devices and removes Sierra's references in other related files (Kconfig and
airprime.c).
Signed-off-by: Kevin Lloyd <linux@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Daniel Ritz [Wed, 11 Oct 2006 21:40:22 +0000 (23:40 +0200)]
usbtouchscreen: fix data reading for ITM touchscreens
ITM devices seem to report only garbage when not touched. update usbtouchscreen
to do data reading like itmtouch. also fix wrong mask on pressure bits.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
matthieu castet [Wed, 11 Oct 2006 21:20:56 +0000 (14:20 -0700)]
UEAGLE: fix ueagle-atm Oops
The array of attribute passed to sysfs_create_group() must be
NULL-terminated.
The sysfs entries are created before the start of the modem state machine
to avoid to stop it in case of errors in sysfs creation. Also
{destroy,create}_fs_entries are removed as they do nothing.
Adds support for dance pads to the xpad driver. Dance pads require the
d-pad to be mapped to four buttons instead of two axes, so that
combinations of up/down and left/right can be hit simultaneously.
Known dance pads are detected, and there is a module parameter added
to default unknown xpad devices to map the d-pad to buttons if this is
desired. (dpad_to_buttons). Minor modifications were made to port the
changes in the original patch to a newer kernel version.
This patch was originally from Dominic Cerquetti originally written
for kernel 2.6.11.4, with minor modifications (API changes for USB,
spelling fixes to the documentation added in the original patch) made
to apply to the current kernel. I have modified Dominic's original
patch per some suggestions from Dmitry Torokhov. (There was nothing
in the patch format description about multiple From: lines, so I
haven't added myself.)
[akpm@osdl.org: cleanups] Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Grant Grundler [Tue, 10 Oct 2006 21:42:51 +0000 (14:42 -0700)]
USB: input: extract() and implement() are bit field manipulation routines
extract() and implement() have brain damaged attempts to handle 32-bit wide
"fields".
The problem is the index math in the original code didn't clear all the
relevant bits. (offset >> 5) only compensated for 32-bit index. We need
(offset >> 6) if we want to use 64-bit loads.
But it was also wrong in that it tried to use quasi-aligned loads. Ie
"report" was only incremented in multiples of 4 bytes and then the offset
was masked off for values greater than 4 bytes. The right way is to
pretend "report" points at a byte array. And offset is then only minor
adjustment for < 8 bits of offset. "n" (field width) can then be as big as
24 (assuming 32-bit loads) since "offset" will never be bigger than 7.
If someone needs either function to handle more than 24-bits, please
document why - point at a specification or specific USB hid device - in
comments in the code.
extract/implement() are also an eyesore to read. Please banish whoever
wrote it to read CodingStyle 3 times in a row to a classroom full of 1st
graders armed with rubberbands. Or just flame them. Whatever. Globbing
all the code together on two lines does NOT make it faster and is Just
Wrong.
I've tested this patch on j6000 (dual 750Mhz PA-RISC, 32-bit 2.6.12-rc5).
Kyle McMartin tested on c3000 (up 400Mhz PA-RISC, same kernel). "p2-mate"
(Peter De Schrijver?) tested on sb1250 (dual core Mips, broadcom "swarm"
eval board).
Signed-off-by: Grant Grundler <grundler@parisc-linux.org> Signed-off-by: Matthew Wilcox <matthew@wil.cx> Cc: Vojtech Pavlik <vojtech@suse.cz> Cc: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Eric Sesterhenn [Tue, 10 Oct 2006 21:42:50 +0000 (14:42 -0700)]
USB: Memory leak in drivers/usb/serial/airprime.c
the commit
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=5dda171202f94127e49c12daf780cdae1b4e668b
added a memory leak. In case we cant allocate an urb, we dont free the
buffer and leak it. Coverity id #1438
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Acked-by: Andy Gay <andy@andynet.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andrew Morton [Tue, 10 Oct 2006 21:42:46 +0000 (14:42 -0700)]
USB: fix usbatm tiny race
ia64:
drivers/usb/atm/usbatm.c: In function `usbatm_do_heavy_init':
drivers/usb/atm/usbatm.c:1004: warning: implicit declaration of function `get_current'
drivers/usb/atm/usbatm.c:1004: error: invalid type argument of `->'
Arnd Bergmann [Sun, 8 Oct 2006 22:08:02 +0000 (00:08 +0200)]
usbnet: add a mutex around phy register access
When working on the mcs7830, I noticed the need for a mutex in its
mdio_read/mdio_write functions. A related problem seems to be present
in the asix driver in the respective functions.
This introduces a mutex in the common usbnet driver and uses it
from the two hardware specific drivers.
Arnd Bergmann [Sun, 8 Oct 2006 22:08:01 +0000 (00:08 +0200)]
usbnet: improve generic ethtool support
This adds generic support for the ethtool commands get_settings,
set_settings, get_link and nway_reset to usbnet. These are now
implemented using mii functions when a low-level driver supports
mdio_read/mdio_write and does not override the usbnet ethtool
commands with its own.
Currently, this applies to the asix and the mcs7830 drivers.
I have tested it on mcs7830.
Arnd Bergmann [Sun, 8 Oct 2006 22:08:00 +0000 (00:08 +0200)]
USB: driver for mcs7830 (aka DeLOCK) USB ethernet adapter
This driver adds support for the DeLOCK USB ethernet adapter
and potentially others based on the MosChip MCS7830 chip.
It is based on the usbnet and asix drivers as well as the
original device driver provided by MosChip, which in turn
was based on the usbnet driver.
It has been tested successfully on an OHCI, but interestingly
there seems to be a problem with the mcs7830 when connected to
the ICH6/EHCI in my thinkpad: it keeps receiving lots of
broken packets in the RX interrupt. The problem goes away when
I'm using an active USB hub, so I assume it's not related to
the device driver, but rather to the hardware.
Alan Stern [Tue, 10 Oct 2006 14:54:00 +0000 (10:54 -0400)]
UHCI: workaround for Asus motherboard
This patch (as798) adds a workaround to uhci-hcd. At least one Asus
motherboard is wired in such a way that any device attached to a
suspended UHCI controller will prevent the system from entering
suspend-to-RAM by immediately waking it up. The only way around the
problem is to turn the controller off instead of suspending it.
This fixes Bugzilla #6193.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Oliver Neukum [Thu, 5 Oct 2006 07:04:11 +0000 (09:04 +0200)]
USB: fix suspend support for usblp
this implements suspend support for usblp. According to the CUPS people
ENODEV will make CUPS retry the job. Thus it is returned in the runtime
case. My printer survives suspend/resume cycles with it.
Duncan Sands [Thu, 5 Oct 2006 08:40:55 +0000 (10:40 +0200)]
speedtch: "extended reach"
The speedtouch modem setup code was reverse engineered many years
ago from a prehistoric windows driver. Less ancient windows drivers,
even those from a few years ago, perform extra initialization steps
which this patch adds to the linux driver. David Woodhouse observed
that this initialization along with the firmware bin/sachu3/zzzlp2.eni
from the driver at
http://www.speedtouch.co.uk/downloads/330/301/UK3012%20Extended.zip
improves line sync speeds by about 20%. He provided the original
patch, which I've modified to use symbolic names (BMaxDSL, ModemMode,
ModemOption) rather than magic numbers. These names may not seem like
much of an improvement (after all, what is "ModemOption" exactly?),
but they do have one big advantage: they are the names used in the
windows registry. I've made them available as module parameters.
Thanks are due to Aurelio Arroyo, who noticed the relationship
between these magic numbers and the entries in Phonebook.ini.
Duncan Sands [Thu, 5 Oct 2006 07:56:44 +0000 (09:56 +0200)]
usbatm: fix tiny race
If usbatm_do_heavy_init finishes before usbatm_heavy_init
writes the pid, the disconnect method could shoot down the
wrong process if the pid has been recycled.
matthieu castet [Tue, 3 Oct 2006 19:44:11 +0000 (21:44 +0200)]
UEAGLE : comestic changes
Hi,
this patch does some cosmetic changes :
- dump firwmare version as soon as possible and export it on sysfs
- hint about wrong cmv/dsp
- Display a message to warn user when the modem is ready : it can help
people to detect problems on the line without debug trace
- Fix wrong indent
- display modem type (pots/isdn)
- increase version number
matthieu castet [Tue, 3 Oct 2006 19:49:29 +0000 (21:49 +0200)]
UEAGLE : use interruptible sleep
this patch use wait_event_interruptible_timeout and msleep_interruptible
beacause uninterruptible sleep (task state 'D') is counted as 1 towards
load average, like running processes.
David Brownell [Mon, 2 Oct 2006 14:20:10 +0000 (07:20 -0700)]
USB: ohci-pnx4008 build fixes
The OHCI bus glue for the Philips PNX chips is missing a few calls.
- Bus suspend/resume were wrongly omitted in the original submission.
- Two new calls were added since that glue was submitted:
* Root hub irq enable call
* Shutdown hook for usbcore
Plus usb_bus.hcpriv has now been removed from usbcore.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Eric Sesterhenn [Wed, 4 Oct 2006 16:56:44 +0000 (09:56 -0700)]
USB: fix use after free in wacom_sys.c
the following commit added a use after free
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3D3bea733ab21247290bd552dd6a2cd3049af9adef
Found by coverity (cid #1441)
When using flow control, the PHY needs to accept multicast pause frames.
Without this fix, these frames were getting discarded by the PHY before
doing any flow control.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Under high load it is possible to make the receiver FIFO get overloaded.
The driver/hardware recover properly, so there is no reason to fill the log
with lots of extra messages, just update counter.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
The result of flow control negotiation should not limit the next
negotiatition. If board is plugged into an old half duplex 10Mbit port,
without pause, then replugged into a gigabit port, it should negotiate
what is desired, not inherit that last negotiation.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
When PHY is turned off on shutdown, it causes the IRQ to get stuck on.
Make sure and disable the IRQ first, and if IRQ occurs when device
is not running, don't access PHY because that will hang.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Linus Torvalds [Tue, 17 Oct 2006 15:20:57 +0000 (08:20 -0700)]
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
[POWERPC] Check for offline nodes in pci NUMA code
[POWERPC] Better check in show_instructions
[POWERPC] POWER6 has 6 PMCs
[POWERPC] Never panic when taking altivec exceptions from userspace
[POWERPC] Fix IO Window Updates on P2P bridges.
[POWERPC] Add Makefile entry for MPC832x_mds support
[POWERPC] Fix MPC8360EMDS PB board support
[POWERPC] ppc: Add missing calls to set_irq_regs
[POWERPC] Off-by-one in /arch/ppc/platforms/mpc8*
[POWERPC] Add DOS partition table support to mpc834x_itx_defconfig
[POWERPC] spufs: fix support for read/write on cntl
[POWERPC] Don't crash on cell with 2 BEs when !CONFIG_NUMA
Jeff Garzik [Tue, 17 Oct 2006 07:10:39 +0000 (00:10 -0700)]
[PATCH] ISDN: fix drivers, by handling errors thrown by ->readstat()
This is a particularly ugly on-failure bug, possibly security, since the
lack of error handling here is covering up another class of bug: failure to
handle copy_to_user() return values.
The I4L API function ->readstat() returns an integer, and by looking at
several existing driver implementations, it is clear that a negative return
value was meant to indicate an error.
Given that several drivers already return a negative value indicating an
errno-style error, the current code would blindly accept that [negative]
value as a valid amount of bytes read. Obvious damage ensues.
Correcting ->readstat() handling to properly notice errors fixes the
existing code to work correctly on error, and enables future patches to
more easily indicate errors during operation.
Signed-off-by: Jeff Garzik <jeff@garzik.org> Cc: Karsten Keil <kkeil@suse.de> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Tue, 17 Oct 2006 07:10:35 +0000 (00:10 -0700)]
[PATCH] Convert cpu hotplug notifiers to use raw_notifier instead of blocking_notifier
The use of blocking notifier by _cpu_up and _cpu_down in cpu.c has two
problem.
1/ An interaction with the workqueue notifier causes lockdep to spit a
warning.
2/ A notifier could conceivable be added or removed while _cpu_up or
_cpu_down are in process. As each notifier is called twice (prepare
then commit/abort) this could be unhealthy.
To fix to we simply take cpu_add_remove_lock while adding or removing
notifiers to/from the list.
This makes the 'blocking' usage unnecessary as all accesses to cpu_chain
are now protected by cpu_add_remove_lock. So change "blocking" to "raw" in
all relevant places. This fixes 1.
Credit: Andrew Morton Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> (reporter) Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>