Jim Cromie [Tue, 27 Jun 2006 09:54:17 +0000 (02:54 -0700)]
[PATCH] chardev: GPIO for SCx200 & PC-8736x: refactor scx200_probe to better segregate _gpio initialization
Pull shadow-reg initialization into separate function now, rather than doing
it 2x later (scx200, pc8736x). When we revisit 2nd drvr below, it will be to
reimplement an init function, rather than another refactor.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jim Cromie [Tue, 27 Jun 2006 09:54:16 +0000 (02:54 -0700)]
[PATCH] chardev: GPIO for SCx200 & PC-8736x: add 'v' command to device-file
Add a new driver command: 'v' which calls gpio_dump() on the pin. The output
goes to the log, like all other INFO messages in the original driver. Giving
the user control over the feedback they 'need' is construed to be a
user-friendly feature, and allows us (later) to dial down many INFO messages
to DEBUG log-level.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jim Cromie [Tue, 27 Jun 2006 09:54:16 +0000 (02:54 -0700)]
[PATCH] chardev: GPIO for SCx200 & PC-8736x: put gpio_dump on a diet
Shrink scx200_gpio_dump() to a single printk with ternary ops. The function
is still ifdef'd out, this is corrected in next patch, when it is actually
used.
The patch 'inadvertently' changed loglevel from DEBUG to INFO. This is Good,
because in next patch, its wired to a 'command' which the user can invoke when
they want. When they do so, its because they want INFO to support their
developement effort, and we want to give it to them without compiling a DEBUG
version of the driver.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jim Cromie [Tue, 27 Jun 2006 09:54:14 +0000 (02:54 -0700)]
[PATCH] chardev: GPIO for SCx200 & PC-8736x: add platforn_device for use w dev_dbg
Add a platform-device to scx200_gpio, and use its struct device dev member
(ie: devp) in dev_dbg() once.
There are 2 alternatives here (Im soliciting guidance/commentary):
- use isa_device, if/when its added to the kernel.
- alter scx200.c to EXPORT_GPL its private devp so that both scx200_gpio,
and the (to be added) nsc_gpio module can use it. Since the available devp
is in 'grandparent', this seems like too much 'action at a distance'.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jim Cromie [Tue, 27 Jun 2006 09:54:14 +0000 (02:54 -0700)]
[PATCH] chardev: GPIO for SCx200 & PC-8736x: modernize driver init to 2.6 api
Adopt many modern 2.6 coding practices, ala LDD3, chapter 3. Changes are
limited to initialization calls from module init, ie: cdev_init, cdev_add,
*_chrdev_region, mkdev.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jim Cromie [Tue, 27 Jun 2006 09:54:13 +0000 (02:54 -0700)]
[PATCH] chardev: GPIO for SCx200 & PC-8736x: whitespace pre-clean
GPIO SUPPORT FOR SCx200 & PC8736x
The patch-set reworks the 2.4 vintage scx200_gpio driver for modern 2.6, and
refactors GPIO support to reuse it in a new driver for the GPIO on PC-8736x
chips. Its handy for the Soekris.com net-4801, which has both chips.
These patches have been seen recently on Kernel-Mentors, and then
Kernel-Newbies ML, where Jesper Juhl kindly reviewed it. His feedback has
been incorporated. Thanks Jesper !
Its also gone to soekris-tech@soekris.com for possible testing by linux folks,
I've gotten 1 promise so far. Theyre mostly BSD folk over there, but we'll
see..
Device-file & Sysfs
The driver preserves the existing device-file interface, including the
write/cmd set, but adds v to 'view' the pin-settings & configs by inducing,
via gpio_dump(), a dev_info() call. Its a fairly crappy way to get status,
but it sticks to the syslog approach, conservatively.
Allowing users to voluntarily trigger logging is good, it gives them a
familiar way to confirm their app's control & use of the pins, and I've thus
reduced the pin-mode-updates from dev_info to dev_dbg.
I've recently bolted on a proto sysfs interface for both new drivers. Im not
including those patches here; they (the patch + doc-pre-patch) are still quite
raw (and unreviewed on KNML), and since they 'invent' a convention for GPIO, a
proper vetting is needed. Since this patchset is much bigger than my previous
ones, Id like to keep things simpler, and address it 1st, before bolting on
more stuff.
The driver-split
The Geode CPU and the PC-87366 Super-IO chip have GPIO units which share a
common pin-architecture (same pin features, with same bits controlling), but
with different addressing mechanics and port organizations.
The vintage driver expresses the pin capabilities with pin-mode commands
[OoPpTt],etc that change the pin configurations, and since the 2 chips share
pin-arch, we can reuse the read(), write() commands, once the implementation
is suitably adjusted.
The patchset adds a vtable: struct nsc_gpio_ops, to abstract the existing gpio
operations, then adjusts fileops.write() code to invoke operations via that
vtable. Driver specific open()s set private_data to the vtable so its
available for use by write().
The vtable gets the gpio_dump() too, since its user-friendly, and (could be
construed as) part of the current device-file interface. To support use of
dev_dbg() in write() & _dump(), the vtable gets a dev ptr too, set by both
scx200 & pc8736x _gpio drivers.
heres how the pins are presented in syslog:
[ 1890.176223] scx200_gpio.0: io00: 0x0044 TS OD PUE EDGE LO DEBOUNCE
[ 1890.287223] scx200_gpio.0: io01: 0x0003 OE PP PUD EDGE LO
nsc_gpio.c: new file is new home of several file-ops methods, which are
modified to get their vtable from filp->private_data, and use it where needed.
scx200_gpio.c: keeps some of its existing gpio routines, but now wires them up
via the vtable (they're invoked by nsc_gpio.c:nsc_gpio_write() thru this
vtable). A driver-spcific open() initializes filp->private_data with the
vtable.
Once the split is clean, and the scx200_gpio driver is working, we copy and
modify the function and variable names, and rework the access-method bodies
for the different addressing scheme.
Heres a working overview of the patchset:
# series file for GPIO
# Spring Cleaning
gpio-scx/patch.preclean # scripts/Lindent fixes, editor-ctrl comments
# API Modernization
gpio-scx/patch.api26 # what I learned from LDD3
gpio-scx/patch.platform-dev-2 # get pdev, support for dev_dbg()
gpio-scx/patch.unsigned-minor # fix to match std practice
# Debuggability
gpio-scx/patch.dump-diet # shrink gpio_dump()
gpio-scx/patch.viewpins # add new 'command' to call dump()
gpio-scx/patch.init-refactor # pull shadow-register init to sub
# Access-Abstraction (add vtable)
gpio-scx/patch.access-vtable # introduce nsg_gpio_ops vtable, w dump
gpio-scx/patch.vtable-calls # add & use the vtable in scx200_gpio
gpio-scx/patch.nscgpio-shell # add empty driver for common-fops
# move code under abstraction
gpio-scx/patch.migrate-fops # move file-ops methods from scx200_gpio
gpio-scx/patch.common-dump # mv scx200.c:scx200_gpio_dump() to nsc_gpio.c
gpio-scx/patch.add-pc8736x-gpio # add new driver, like old, w chip adapt
# gpio-scx/patch.add-DEBUG # enable all dev_dbg()s
# Cleanups
# finish printk -> dev_dbg() etc
gpio-scx/patch.pdev-pc8736x # new drvr needs pdev too,
gpio-scx/patch.devdbg-nscgpio # add device to 'vtable', use in dev_dbg()
# gpio-scx/patch.pin-config-view # another 'c' 'command'
# gpio-scx/quiet-getset # take out excess dbg stuff (pretty quiet
now)
gpio-scx/patch.shadow-current # imitate scx200_gpio's shadow regs in
pc87*
# post KMentors-post patches ..
gpio-scx/patch.mutexes # use mutexes for config-locks
gpio-scx/patch.viewpins-values # extend dump to obsolete separate 'c' cmd
gpio-scx/patch.kconfig # add stuff for kbuild
# TBC
# combine api26 with pdev, which is just one step.
# merge c&v commands to single do-all-fn
# delay viewpins, dump-diet should also un-ifdef it too.
diff.sys-gpio-rollup-1
This patch:
Removed editor format-control comments, and used scripts/Lindent to clean up
whitespace, then deleted the bogus chunks :-(
Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] cpu hotplug: add hotplug versions of cpu_notifier
Define new macros register_hotcpu_notifier() and unregister_hotcpu_notifier()
that redefines register_cpu_notifier() and unregister_cpu_notifier() for use
only when HOTPLUG_CPU is defined.
[PATCH] cpu hotplug: revert init patch submitted for 2.6.17
In 2.6.17, there was a problem with cpu_notifiers and XFS. I provided a
band-aid solution to solve that problem. In the process, i undid all the
changes you both were making to ensure that these notifiers were available
only at init time (unless CONFIG_HOTPLUG_CPU is defined).
We deferred the real fix to 2.6.18. Here is a set of patches that fixes the
XFS problem cleanly and makes the cpu notifiers available only at init time
(unless CONFIG_HOTPLUG_CPU is defined).
If CONFIG_HOTPLUG_CPU is defined then cpu notifiers are available at run
time.
This patch reverts the notifier_call changes made in 2.6.17
Alan Cox [Tue, 27 Jun 2006 09:54:05 +0000 (02:54 -0700)]
[PATCH] stallion clean up
There are two locking sets involved. One locks the board mappings and the
other is the tty open/close locking. The low level code was clearly
designed to be ported to OS's with spin locks already so pretty much comes
out in the wash
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
akpm@osdl.org [Tue, 27 Jun 2006 09:54:04 +0000 (02:54 -0700)]
[PATCH] IPMI: use schedule in kthread
Corey Minyard <minyard@acm.org>
The kthread used to speed up polling for IPMI was using udelay in its
busy-wait polling loop when the lower-level state machine told it to do a
short delay. This just used CPU and didn't help scheduling, thus causing
bad problems with other tasks. Call schedule() instead.
Signed-off-by: Corey Minyard <minyard@acm.org> Acked-by: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul E. McKenney [Tue, 27 Jun 2006 09:54:02 +0000 (02:54 -0700)]
[PATCH] rcutorture: catchup doc fixes for idle-hz tests
This just catches the RCU torture documentation up with the recent fixes
that test RCU for architectures that turn of the scheduling-clock interrupt
for idle CPUs and the addition of a SUCCESS/FAILURE indication, fixing up
an obsolete comment as well.
Signed-off-by: Paul E. McKenney <paulmck@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Randy Dunlap [Tue, 27 Jun 2006 09:54:01 +0000 (02:54 -0700)]
[PATCH] fix kernel-doc in kernel/ dir
Fix kernel-doc parameters in kernel/
Warning(/var/linsrc/linux-2617-g9//kernel/auditsc.c:1376): No description found for parameter 'u_abs_timeout'
Warning(/var/linsrc/linux-2617-g9//kernel/auditsc.c:1420): No description found for parameter 'u_msg_prio'
Warning(/var/linsrc/linux-2617-g9//kernel/auditsc.c:1420): No description found for parameter 'u_abs_timeout'
Warning(/var/linsrc/linux-2617-g9//kernel/acct.c:526): No description found for parameter 'pacct'
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Add missed ufsi->i_dir_start_lookup initialization in ufs_read_inode in
UFS2 case. Also it cleans ufs_read_inode function to prevent such kind of
situation in the future: it move depend on UFS type parts of code into
separate functions and leaves in ufs_read_inode only generic code. It
cleans code and avoids duplication.
[PATCH] generic_file_buffered_write(): deadlock on vectored write
generic_file_buffered_write() prefaults in user pages in order to avoid
deadlock on copying from the same page as write goes to.
However, it looks like there is a problem when write is vectored:
fault_in_pages_readable brings in current segment or its part (maxlen).
OTOH, filemap_copy_from_user_iovec is called to copy number of bytes
(bytes) which may exceed current segment, so filemap_copy_from_user_iovec
switches to the next segment which is not brought in yet. Pagefault is
generated. That causes the deadlock if pagefault is for the same page
write goes to: page being written is locked and not uptodate, pagefault
will deadlock trying to lock locked page.
[akpm@osdl.org: somewhat rewritten] Cc: Neil Brown <neilb@suse.de> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ingo Molnar [Tue, 27 Jun 2006 09:53:55 +0000 (02:53 -0700)]
[PATCH] spin/rwlock init cleanups
locking init cleanups:
- convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK()
- convert rwlocks in a similar manner
this patch was generated automatically.
Motivation:
- cleanliness
- lockdep needs control of lock initialization, which the open-coded
variants do not give
- it's also useful for -rt and for lock debugging in general
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Randy Dunlap [Tue, 27 Jun 2006 09:53:52 +0000 (02:53 -0700)]
[PATCH] add poison.h and patch primary users
Localize poison values into one header file for better documentation and
easier/quicker debugging and so that the same values won't be used for
multiple purposes.
Use these constants in core arch., mm, driver, and fs code.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Matt Mackall <mpm@selenic.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ingo Molnar [Tue, 27 Jun 2006 09:53:50 +0000 (02:53 -0700)]
[PATCH] vdso: randomize the i386 vDSO by moving it into a vma
Move the i386 VDSO down into a vma and thus randomize it.
Besides the security implications, this feature also helps debuggers, which
can COW a vma-backed VDSO just like a normal DSO and can thus do
single-stepping and other debugging features.
It's good for hypervisors (Xen, VMWare) too, which typically live in the same
high-mapped address space as the VDSO, hence whenever the VDSO is used, they
get lots of guest pagefaults and have to fix such guest accesses up - which
slows things down instead of speeding things up (the primary purpose of the
VDSO).
There's a new CONFIG_COMPAT_VDSO (default=y) option, which provides support
for older glibcs that still rely on a prelinked high-mapped VDSO. Newer
distributions (using glibc 2.3.3 or later) can turn this option off. Turning
it off is also recommended for security reasons: attackers cannot use the
predictable high-mapped VDSO page as syscall trampoline anymore.
There is a new vdso=[0|1] boot option as well, and a runtime
/proc/sys/vm/vdso_enabled sysctl switch, that allows the VDSO to be turned
on/off.
(This version of the VDSO-randomization patch also has working ELF
coredumping, the previous patch crashed in the coredumping code.)
This code is a combined work of the exec-shield VDSO randomization
code and Gerd Hoffmann's hypervisor-centric VDSO patch. Rusty Russell
started this patch and i completed it.
[akpm@osdl.org: cleanups]
[akpm@osdl.org: compile fix]
[akpm@osdl.org: compile fix 2]
[akpm@osdl.org: compile fix 3]
[akpm@osdl.org: revernt MAXMEM change] Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@infradead.org> Cc: Gerd Hoffmann <kraxel@suse.de> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Zachary Amsden <zach@vmware.com> Cc: Andi Kleen <ak@muc.de> Cc: Jan Beulich <jbeulich@novell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
James Bottomley [Tue, 27 Jun 2006 09:53:50 +0000 (02:53 -0700)]
[PATCH] voyager: fix compile after setup rework
The following
[PATCH] Clean up and refactor i386 sub-architecture setup
Doesn't quite work, since it leaves out an include of asm/io.h, without
which the use of inb/outb in the setup file won.t work. This corrects that
and also removes a spurious acpi reference that apparently crept in ages
ago but should never have been there.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
James Bottomley [Tue, 27 Jun 2006 09:53:49 +0000 (02:53 -0700)]
[PATCH] fix subarchitecture breakage with CONFIG_SCHED_SMT
Commit 1e9f28fa1eb9773bf65bae08288c6a0a38eef4a7 ("[PATCH] sched: new
sched domain for representing multi-core") incorrectly made SCHED_SMT
and some of the structures it uses dependent on SMP.
However, this is wrong, the structures are only defined if X86_HT, so
SCHED_SMT has to depend on that as well.
The patch broke voyager, since it doesn't provide any of the multi-core
or hyperthreading structures.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Aleksey Gorelov [Tue, 27 Jun 2006 09:53:48 +0000 (02:53 -0700)]
[PATCH] fix broken vm86 interrupt/signal handling
Commit c3ff8ec31c1249d268cd11390649768a12bec1b9 ("[PATCH] i386: Don't
miss pending signals returning to user mode after signal processing")
meant that vm86 interrupt/signal handling got broken for the case when
vm86 is called from kernel space.
In this scenario, if signal is pending because of vm86 interrupt,
do_notify_resume/do_signal exits immediately due to user_mode() check,
without processing any signals. Thus, resume_userspace handler is spinning
in a tight loop with signal pending and TIF_SIGPENDING is set. Previously
everything worked Ok.
No in-tree usage of vm86() from kernel space exists, but I've heard
about a number of projects out there which use vm86 calls from kernel,
one of them being this, for instance:
http://dev.gentoo.org/~spock/projects/vesafb-tng/
The following patch fixes the issue.
Signed-off-by: Aleksey Gorelov <aleksey_gorelov@phoenix.com> Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Rusty Russell [Tue, 27 Jun 2006 09:53:44 +0000 (02:53 -0700)]
[PATCH] x86: increase interrupt vector range
Remove the limit of 256 interrupt vectors by changing the value stored in
orig_{e,r}ax to be the complemented interrupt vector. The orig_{e,r}ax
needs to be < 0 to allow the signal code to distinguish between return from
interrupt and return from syscall. With this change applied, NR_IRQS can
be > 256.
Xen extends the IRQ numbering space to include room for dynamically
allocated virtual interrupts (in the range 256-511), which requires a more
permissive interface to do_IRQ.
Signed-off-by: Ian Pratt <ian.pratt@xensource.com> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: "Protasevich, Natalie" <Natalie.Protasevich@UNISYS.com> Cc: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Michael LeMay [Tue, 27 Jun 2006 09:53:42 +0000 (02:53 -0700)]
[PATCH] selinux: inherit /proc/self/attr/keycreate across fork
Update SELinux to cause the keycreate process attribute held in
/proc/self/attr/keycreate to be inherited across a fork and reset upon
execve. This is consistent with the handling of the other process
attributes provided by SELinux and also makes it simpler to adapt logon
programs to properly handle the keycreate attribute.
Signed-off-by: Michael LeMay <mdlemay@epoch.ncsc.mil> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
With Goto-san's patch, we can add new pgdat/node at runtime. I'm now
considering node-hot-add with cpu + memory on ACPI.
I found acpi container, which describes node, could evaluate cpu before
memory. This means cpu-hot-add occurs before memory hot add.
In most part, cpu-hot-add doesn't depend on node hot add. But register_cpu(),
which creates symbolic link from node to cpu, requires that node should be
onlined before register_cpu(). When a node is onlined, its pgdat should be
there.
This patch-set holds off creating symbolic link from node to cpu
until node is onlined.
This removes node arguments from register_cpu().
Now, register_cpu() requires 'struct node' as its argument. But the array of
struct node is now unified in driver/base/node.c now (By Goto's node hotplug
patch). We can get struct node in generic way. So, this argument is not
necessary now.
This patch also guarantees add cpu under node only when node is onlined. It
is necessary for node-hot-add vs. cpu-hot-add patch following this.
Moreover, register_cpu calculates cpu->node_id by cpu_to_node() without regard
to its 'struct node *root' argument. This patch removes it.
Also modify callers of register_cpu()/unregister_cpu, whose args are changed
by register-cpu-remove-node-struct patch.
Yasunori Goto [Tue, 27 Jun 2006 09:53:39 +0000 (02:53 -0700)]
[PATCH] pgdat allocation and update for ia64 of memory hotplug: update pgdat address array
This is to refresh node_data[] array for ia64. As I mentioned previous
patches, ia64 has copies of information of pgdat address array on each node as
per node data.
At v2 of node_add, this function used stop_machine_run() to update them. (I
wished that they were copied safety as much as possible.) But, in this patch,
this arrays are just copied simply, and set node_online_map bit after
completion of pgdat initialization.
So, kernel must touch NODE_DATA() macro after checking node_online_map().
(Current code has already done it.) This is more simple way for just
hot-add.....
Note : It will be problem when hot-remove will occur,
because, even if online_map bit is set, kernel may
touch NODE_DATA() due to race condition. :-(
Yasunori Goto [Tue, 27 Jun 2006 09:53:38 +0000 (02:53 -0700)]
[PATCH] pgdat allocation and update for ia64 of memory hotplug: hold pgdat address at system running
This is a preparatory patch to make common code for updating of NODE_DATA() of
ia64 between boottime and hotplug.
Current code remembers pgdat address in mem_data which is used at just boot
time. But its information can be used at hotplug time by moving to global
value. The next patch uses this array.
Yasunori Goto [Tue, 27 Jun 2006 09:53:38 +0000 (02:53 -0700)]
[PATCH] Register sysfs file for hotplugged new node
When new node becomes enable by hot-add, new sysfs file must be created for
new node. So, if new node is enabled by add_memory(), register_one_node() is
called to create it. In addition, I386's arch_register_node() and a part of
register_nodes() of powerpc are consolidated to register_one_node() as a
generic_code().
This is tested by Tiger4(IPF) with node hot-plug emulation.
This patch allows hot-add memory which is not aligned to section.
Now, hot-added memory has to be aligned to section size. Considering big
section sized archs, this is not useful.
When hot-added memory is registerd as iomem resoruce by iomem resource
patch, we can make use of that information to detect valid memory range.
Note: With this, not-aligned memory can be registerd. To allow hot-add
memory with holes, we have to do more work around add_memory().
(It doesn't allows add memory to already existing mem section.)
Yasunori Goto [Tue, 27 Jun 2006 09:53:34 +0000 (02:53 -0700)]
[PATCH] pgdat allocation for new node add (call pgdat allocation)
Add node-hot-add support to add_memory().
node hotadd uses this sequence.
1. allocate pgdat.
2. refresh NODE_DATA()
3. call free_area_init_node() to initialize
4. create sysfs entry
5. add memory (old add_memory())
6. set node online
7. run kswapd for new node.
(8). update zonelist after pages are onlined. (This is already merged in -mm
due to update phase is difference.)
Note:
To make common function as much as possible,
there is 2 changes from v2.
- The old add_memory(), which is defiend by each archs,
is renamed to arch_add_memory(). New add_memory becomes
caller of arch dependent function as a common code.
- This patch changes add_memory()'s interface
From: add_memory(start, end)
TO : add_memory(nid, start, end).
It was cause of similar code that finding node id from
physical address is inside of old add_memory() on each arch.
In addition, acpi memory hotplug driver can find node id easier.
In v2, it must walk DSDT'S _CRS by matching physical address to
get the handle of its memory device, then get _PXM and node id.
Because input is just physical address.
However, in v3, the acpi driver can use handle to get _PXM and node id
for the new memory device. It can pass just node id to add_memory().
Fix interface of arch_add_memory() is in next patche.
Yasunori Goto [Tue, 27 Jun 2006 09:53:33 +0000 (02:53 -0700)]
[PATCH] pgdat allocation for new node add (refresh node_data[])
Refresh NODE_DATA() for generic archs. In this case, NODE_DATA(nid) ==
node_data[nid]. node_data[] is array of address of pgdat. So, refresh is
quite simple.
Yasunori Goto [Tue, 27 Jun 2006 09:53:32 +0000 (02:53 -0700)]
[PATCH] pgdat allocation for new node add (generic alloc node_data)
For node hotplug, basically we have to allocate new pgdat. But, there are
several types of implementations of pgdat.
1. Allocate only pgdat.
This style allocate only pgdat area.
And its address is recorded in node_data[].
It is most popular style.
2. Static array of pgdat
In this case, all of pgdats are static array.
Some archs use this style.
3. Allocate not only pgdat, but also per node data.
To increase performance, each node has copy of some data as
a per node data. So, this area must be allocated too.
Ia64 is this style. Ia64 has the copies of node_data[] array
on each per node data to increase performance.
In this series of patches, treat (1) as generic arch.
generic archs can use generic function. (2) and (3) should have
its own if necessary.
This patch defines pgdat allocator.
Updating NODE_DATA() macro function is in other patch.
Yasunori Goto [Tue, 27 Jun 2006 09:53:31 +0000 (02:53 -0700)]
[PATCH] pgdat allocation for new node add (get node id by acpi)
This is to find node id from acpi's handle of memory_device in DSDT. _PXM for
the new node can be found by acpi_get_pxm() by using new memory's handle. So,
node id can be found by pxm_to_nid_map[].
This patch becomes simpler than v2 of node hot-add patch.
Because old add_memory() function doesn't have node id parameter.
So, kernel must find its handle by physical address via DSDT again.
But, v3 just give node id to add_memory() now.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: "Brown, Len" <len.brown@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Yasunori Goto [Tue, 27 Jun 2006 09:53:30 +0000 (02:53 -0700)]
[PATCH] pgdat allocation for new node add (specify node id)
Change the name of old add_memory() to arch_add_memory. And use node id to
get pgdat for the node at NODE_DATA().
Note: Powerpc's old add_memory() is defined as __devinit. However,
add_memory() is usually called only after bootup.
I suppose it may be redundant. But, I'm not well known about powerpc.
So, I keep it. (But, __meminit is better at least.)
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: "Brown, Len" <len.brown@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Yasunori Goto [Tue, 27 Jun 2006 09:53:29 +0000 (02:53 -0700)]
[PATCH] Catch notification of memory add event of ACPI via container driver. (avoid redundant call add_memory)
When acpi_memory_device_init() is called at boottime to register struct
memory acpi_memory_device, acpi_bus_add() are called via
acpi_driver_attach().
But it also calls ops->start() function. It is called even if the memory
blocks are initialized at early boottime. In this case add_memory() return
-EEXIST, and the memory blocks becomes INVALID state even if it is normal.
This is patch to avoid calling add_memory() for already available memory.
Yasunori Goto [Tue, 27 Jun 2006 09:53:28 +0000 (02:53 -0700)]
[PATCH] Catch notification of memory add event of ACPI via container driver. (register start func for memory device)
This is a patch to call add_memroy() when notify reaches for new node's add
event.
When new node is added, notify of ACPI reaches container device which means
the node.
Container device driver calls acpi_bus_scan() to find and add belonging
devices (which means cpu, memory and so on). Its function calls add and
start function of belonging devices's driver.
Howevever, current memory hotplug driver just register add function to
create sysfs file for its memory. But, acpi_memory_enable_device() is not
called because it is considered just the case that notify reaches memory
device directly. So, if notify reaches container device nothing can call
add_memory().
This is a patch to create start function which calls add_memory().
add_memory() can be called by this when notify reaches container device.
[PATCH] acpi memory hotplug cannot manage _CRS with plural resoureces
Current acpi memory hotplug just looks into the first entry of resources in
_CRS. But, _CRS can contain plural resources. So, if _CRS contains plural
resoureces, acpi memory hot add cannot add all memory.
With this patch, acpi memory hotplug can deal with Memory Device, whose
_CRS contains plural resources.
Tested on ia64 memory hotplug test envrionment (not emulation, uses alpha
version firmware which supports dynamic reconfiguration of NUMA.)
Note: Microsoft's Windows Server 2003 requires big (>4G)resoureces to be
divided into small (<4G) resources. looks crazy, but not invalid.
(See http://www.microsoft.com/whdc/system/pnppwr/hotadd/hotaddmem.mspx)
For this reason, a firmware vendor who supports Windows writes plural
resources in a _CRS even if they are contiguous.
Randy Dunlap [Tue, 27 Jun 2006 09:53:26 +0000 (02:53 -0700)]
[PATCH] zlib inflate: fix function definitions
Fix function definitions to be ANSI-compliant:
lib/zlib_inflate/inffast.c:68:1: warning: non-ANSI definition of function 'inflate_fast'
lib/zlib_inflate/inftrees.c:33:1: warning: non-ANSI definition of function 'zlib_inflate_table'
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Brownell [Tue, 27 Jun 2006 19:59:15 +0000 (12:59 -0700)]
[PATCH] fix static linking of NFS
Builds on ARM report link problems with common configurations like
statically linked NFS (for nfsroot). The symptom is that __init
section code references __exit section code; that won't work since
the exit sections are discarded (since they can never be called).
The best fix for these particular cases would be an "__init_or_exit"
section annotation.
Dmitry Torokhov [Tue, 27 Jun 2006 12:30:31 +0000 (08:30 -0400)]
Input: fix resetting name, phys and uniq when unregistering device
It should be done before calling class_device_unregister() because
it will destroy the device and free memory if there are no other
references to the device.
Thanks to Daniel Ritz and Michal Piotrowski for noticing the problem.
Daniel says:
"[The] reason is a recent change that made modules always shows as
module.mod. it breaks modprobe and probably many scripts..besides
lsmod looking horrible
stuff like this in modprobe.conf:
install pcmcia_core /sbin/modprobe --ignore-install pcmcia_core; /sbin/modprobe pcmcia
makes modprobe fork/exec endlessly calling itself...until oom
interrupts it"
Linus Torvalds [Mon, 26 Jun 2006 23:06:08 +0000 (16:06 -0700)]
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2: (56 commits)
[PATCH] fs/ocfs2/dlm/: cleanups
ocfs2: fix compiler warnings in dlm_convert_lock_handler()
ocfs2: dlm_print_one_mle() needs to be defined
ocfs2: remove whitespace in dlmunlock.c
ocfs2: move dlm work to a private work queue
ocfs2: fix incorrect error returns
ocfs2: tune down some noisy messages during dlm recovery
ocfs2: display message before waiting for recovery to complete
ocfs2: mlog in dlm_convert_lock_handler() should be ML_ERROR
ocfs2: retry operations when a lock is marked in recovery
ocfs2: use cond_resched() in dlm_thread()
ocfs2: use GFP_NOFS in some dlm operations
ocfs2: wait for recovery when starting lock mastery
ocfs2: continue recovery when a dead node is encountered
ocfs2: remove unneccesary spin_unlock() in dlm_remaster_locks()
ocfs2: dlm_remaster_locks() should never exit without completing
ocfs2: special case recovery lock in dlmlock_remote()
ocfs2: pending mastery asserts and migrations should block each other
ocfs2: temporarily disable automatic lock migration
ocfs2: do not unconditionally purge the lockres in dlmlock_remote()
...
Kurt Hackel [Mon, 1 May 2006 21:29:28 +0000 (14:29 -0700)]
ocfs2: retry operations when a lock is marked in recovery
Before checking for a nonexistent lock, make sure the lockres is not marked
RECOVERING. The caller will just retry and the state should be fixed up when
recovery completes.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Kurt Hackel [Mon, 1 May 2006 20:49:20 +0000 (13:49 -0700)]
ocfs2: dlm_remaster_locks() should never exit without completing
We cannot restart recovery. Once we begin to recover a node, keep the state
of the recovery intact and follow through, regardless of any other node
deaths that may occur.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Kurt Hackel [Mon, 1 May 2006 20:47:50 +0000 (13:47 -0700)]
ocfs2: special case recovery lock in dlmlock_remote()
If the previous master of the recovery lock dies, let calc_usage take it
down completely and let the caller completely redo the dlmlock() call.
Otherwise, there will never be an opportunity to re-master the lockres and
recovery wont be able to progress.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Kurt Hackel [Mon, 1 May 2006 20:32:27 +0000 (13:32 -0700)]
ocfs2: pending mastery asserts and migrations should block each other
Use the existing structure for blocking migrations when ASTs are pending to
achieve the same result. If we can catch the assert before it goes on the
wire, just cancel it and let the migration continue.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Now we never change the owner of a lock resource until unmount or node
death. This will be re-enabled once some issues in the algorithm used have
been resolved.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Kurt Hackel [Mon, 1 May 2006 20:27:10 +0000 (13:27 -0700)]
ocfs2: do not unconditionally purge the lockres in dlmlock_remote()
In dlmlock_remote(), do not call purge_lockres until the lock resource
actually changes. otherwise, the mastery info on the lockres will go away
underneath the caller.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Kurt Hackel [Mon, 1 May 2006 19:02:07 +0000 (12:02 -0700)]
ocfs2: increase backoff before waiting for recovery
When mastering non-recovery lock resources, additional time was frequently
needed to allow the disk heartbeat to catch up with the network timeout. the
recovery lock resource is time critical and avoids this path.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>