Andrew Morton [Mon, 26 Apr 2004 16:00:00 +0000 (09:00 -0700)]
[PATCH] efivars: remove from arch/ia64
From: Matt Tolentino <metolent@snoqualmie.dp.intel.com>
I broke up the efivars driver update patch I had sent out quite a while ago
into several smaller patches. This includes several fixes and suggestions
that were pointed out. The patches are broken down as follows:
1 - remove all traces of efivars from arch/ia64/
2 - add new sysfs based efivars driver into
drivers/firmware with accompanying Kconfig/Makefile
changes to make it fully functional for ia64 again.
3 - cleans up x86 references to the /proc version of
the efivars driver.
Andrew Morton [Mon, 26 Apr 2004 15:59:12 +0000 (08:59 -0700)]
[PATCH] slab alignment fixes
From: Manfred Spraul <manfred@colorfullife.com>
Below is a patch that redefines the kmem_cache_alloc `align' argument:
- align not zero: use the specified alignment. I think values smaller than
sizeof(void*) will work, even on archs with strict alignment requirement (or
at least: slab shouldn't crash. Obviously the user must handle the
alignment properly).
- align zero:
* debug on: align to sizeof(void*)
* debug off, SLAB_HWCACHE_ALIGN clear: align to sizeof(void*)
* debug off, SLAB_HWCACHE_ALIGN set: align to the smaller of
- cache_line_size()
- the object size, rounded up to the next power of two.
Slab never honored cache align for tiny objects: otherwise the 32-byte
kmalloc objects would use 128 byte objects.
There is one additional point: right now slab uses ints for the bufctls.
Using short would save two bytes for each object. Initially I had used short,
but davem objected. IIRC because some archs do not handle short efficiently.
Should I allow arch overrides for the bufctls? On i386, saving two bytes
might allow a few additional anon_vma objects in each page.
Andrew Morton [Mon, 26 Apr 2004 15:58:38 +0000 (08:58 -0700)]
[PATCH] ppc64: Move Initrd
From: Rusty Russell <rusty@rustcorp.com.au>
This patch moves the initrd when "make_room" runs out of space, rather than
stepping over it. The problem with stepping over it is that it gets copied
with the kernel when this happens, which wastes space.
Also ensures that the initrd isn't where the kernel wants to be moved to: if
it is, it gets moved out the way.
Andrew Morton [Mon, 26 Apr 2004 15:58:17 +0000 (08:58 -0700)]
[PATCH] ppc64: Clean up prom functions in prom.c
From: Rusty Russell <rusty@rustcorp.com.au>
1) Define PROM_ERROR: checks for call_prom() < 0 are bogus (returns ulong)
2) All OF access functions should be marked __init.
3) prom_strtoul isn't used at all.
Andrew Morton [Mon, 26 Apr 2004 15:57:56 +0000 (08:57 -0700)]
[PATCH] ppc64: make_room macro for ppc64 prom.c
From: Rusty Russell <rusty@rustcorp.com.au>
copy_device_tree calls inspect_node() which recurses to copy the Open Firmware
device tree. It just copied into memory above the kernel for about 8MB, which
can overwrite the initrd, and/or get truncated on big machines.
The real solution is to allocate memory properly for all the prom_init memory
users. However, that's quite a change. This patch introduces a "make_room"
macro which inspect_node uses to get memory. This does the same as before,
except skips over the initrd if neccessary.
Andrew Morton [Mon, 26 Apr 2004 15:57:46 +0000 (08:57 -0700)]
[PATCH] ppc64: Make finish_device_tree use lmb_alloc, not klimit
From: Rusty Russell <rusty@rustcorp.com.au>
finish_device_tree simply allocates nodes by incrementing klimit (ie. using
memory on top of the kernel). Change it to figure out how much memory it
needs, then use lmb_alloc to allocate that, then fill it in.
This gets rid of the only manipulation of klimit after prom_init.
Andrew Morton [Mon, 26 Apr 2004 15:56:53 +0000 (08:56 -0700)]
[PATCH] ppc64: Split prom.c Into pre-reloc and post-reloc Functions
From: Rusty Russell <rusty@rustcorp.com.au>
Move all the functions that run normally (ie. with the kernel in the correct
address) to the bottom of prom.c, and keep all the functions which use RELOC()
to the top, above "prom_init()" which calls them.
Also, make prom_initialize_dart_table and prom_initialize_tce_table static.
Andrew Morton [Mon, 26 Apr 2004 15:56:22 +0000 (08:56 -0700)]
[PATCH] Per-sb dquot dirty lists
From: Jan Kara <jack@ucw.cz>
When there are lots of dirty dquots the vfs_quota_sync() is too slow (it has
O(N^2) behaviour). Attached patch implements list of dirty dquots for each
superblock and quota type. Using this lists sync is trivially linear.
Attached patch is against 2.6.5 with journalled quota and previous patch for
hash table size.
(Jan had a test which went from 8 minutes to 0.8 seconds...)
Andrew Morton [Mon, 26 Apr 2004 15:56:11 +0000 (08:56 -0700)]
[PATCH] Bigger quota hashtable
From: Jan Kara <jack@ucw.cz>
I found out that quota uses hash table with just 43 entries to hash dquot
entries. I guess that we can afford using one page for that
(quotactl(Q_GETQUOTA...), got faster like 3x for 4000 users). Attached patch
implements that.
Andrew Morton [Mon, 26 Apr 2004 15:56:01 +0000 (08:56 -0700)]
[PATCH] ext3 journalled quota locking fix
From: Jan Kara <jack@ucw.cz>
I've attached a fix for a problem in ext3 journalled quota patch - the problem
is that detecting whether dqput() sleeps was wrong and so we could possibly
schedule when holding a spinlock.
Andrew Morton [Mon, 26 Apr 2004 15:55:51 +0000 (08:55 -0700)]
[PATCH] credentials locking fix
From: Chris Wright <chrisw@osdl.org>
Contributions from:
Stephen Smalley <sds@epoch.ncsc.mil>
Andy Lutomirski <luto@stanford.edu>
During exec the LSM bprm_apply_creds() hooks may tranisition the program to a
new security context (like setuid binaries). The security context of the new
task is dependent on state such as if the task is being ptraced.
ptrace_detach() doesn't take the task_lock() when clearing task->ptrace. So
there is a race possible where a process starts off being ptraced, the
malicious ptracer detaches and if any checks agains task->ptrace are done more
than once, the results are indeterminate.
This patch ensures task_lock() is held while bprm_apply_creds() hooks are
called, keeping it safe against ptrace_attach() races. Additionally, tests
against task->ptrace (and ->fs->count, ->files->count and ->sighand->count all
of which signify potential unsafe resource sharing during a security context
transition) are done only once the results are passed down to hooks, making it
safe against ptrace_detach() races.
Additionally:
- s/must_must_not_trace_exec/unsafe_exec/
- move unsafe_exec() call above security_bprm_apply_creds() call rather than
in call for readability.
- fix dummy hook to honor the case where root is ptracing
- couple minor formatting/spelling fixes
Andrew Morton [Mon, 26 Apr 2004 15:55:31 +0000 (08:55 -0700)]
[PATCH] Use workqueue for call_usermodehelper
From: Rusty Russell <rusty@rustcorp.com.au>
call_usermodehelper uses keventd to create a thread, guaranteeing a nice,
clean kernel thread. Unfortunately, there is a case where
call_usermodehelper is called with &bus->subsys.rwsem held (via
bus_add_driver()), but keventd could be running bus_add_device(), which is
blocked on the same lock. The result is deadlock, and it comes from using
keventd for both.
In this case, it can be fixed by using a completely independent thread for
call_usermodehelper, or an independent workqueue. Workqueues have the
infrastructure we need, so we use one.
Andrew Morton [Mon, 26 Apr 2004 15:55:21 +0000 (08:55 -0700)]
[PATCH] create singlethread_workqueue()
From: Rusty Russell <rusty@rustcorp.com.au>
Workqueues are a great primitive for running things from user context from
a completely clean environment. Unfortunately, they currently insist on
creating one thread per CPU, which is overkill for many situations, so the
more generic keventd workqueue is used for these. Recently deadlocks using
keventd were demonstrated, showing that it is not suitable for all uses.
1) Clean up CPU iterators. Always a nice touch.
2) Add __create_workqueue() and create_singlethread_workqueue(),
keeping source compatibility.
3) Put workqueues in workqueue list even if !CONFIG_HOTPLUG_CPU (means
we need a lock to protect that list). Now we can tell if a wq is
single-threaded using list_empty(&wq->list).
4) For single-threaded workqueues, override CPU in queue_work,
delayed_work_timer_fn and flush_workqueue to be 0. flush_workqueue
now does redundant passes for single-threaded workqueues, but the
code remains simple.
5) Make create_workqueue_thread return the thread, so we can easily
kthread_bind for multi-threaded workqueues.
akpm fixes:
- Fix up is_single_threaded() handling
- single-threaded wq thread does not have "/0" appended.
David Brownell [Mon, 26 Apr 2004 11:51:43 +0000 (04:51 -0700)]
[PATCH] One more USB fix
Here's another fix it'd be good to merge ...
No changes to the Linux code at all, but it'll makes the Windows
configuration of a Linux device running the Ethernet/RNDIS gadget behave
correctly on more versions of Windows. (It might prevent some
Bluescreening too.)
There's an obsolete check in sn_init_pdas() left over from the 2.4
days that panics if the cpu PDA and cpu_data area span more than a page.
With 2.6, we're not limited to a page, so remove the check entirely.
Alex Williamson [Mon, 26 Apr 2004 07:13:52 +0000 (00:13 -0700)]
[PATCH] ia64: bug w/ shared interrupts
I just ran into a bug introduced by the most recent iosapic.c patch.
The scenario is a builtin driver is up and running happily. A module
loads for a devices that happens to share the same interrupt vector,
in this case a network driver. The module calls pci_enable_device()
as it should, which eventually lands in iosapic_enable_intr(). We
then proceed to mask the interrupt and kill the device that's already
running. As a bonus, request_interrupt() doesn't fix the problem
because we only call the startup for the interrupt handler on the
first action attached to the interrupt.
I think the best way out of this is simply to detect when an action is
already attached to a vector and leave it alone. This also prevents
interrupts from moving to other cpus (on boxes w/o irq redirection)
for no good reason.
The logic got a little foo-bar'ed in the last patch, we should have keep
the old logic. Ie LoEj bit (2nd) must always be set, just clear it for
known non-capable of loading drives.
This is an old bug that often confuses people, rightfully.
For some laptop and server type cdroms, the drives advertise themselves
as tray loading even if they are caddy-like or slot-in loaders. This
means they cannot insert the media on their own, and this generates a
5/24/00 error to START_STOP_UNIT.
This prevents the logging of such a failure, and also fixes the
generation of such a bad command in case the mech type was correctly set
by the drive.
Michael Hunold [Mon, 26 Apr 2004 01:53:40 +0000 (18:53 -0700)]
[PATCH] DVB: Misc. DVB USB driver updates
- [DVB] ttusb-dec:
- Add a parameter to dvb_filter_pes2ts function to specify whether
the packet is a payload unit start or not
- Use the hotplug firmware loader for 2.6 kernels instead of
compiling the firmware into the module.
- Correct the USB id of the DEC3000-s, add basic support
Michael Hunold [Mon, 26 Apr 2004 01:53:18 +0000 (18:53 -0700)]
[PATCH] DVB: AV7110 DVB driver updates
- [DVB] av7110 update:
- speed up firmware loading
- follow internal API changes in saa7146 driver
- introduced some symbolic constants for a/v dec cmds
- change default for hw_sections to 0 to enable crc checks
Michael Hunold [Mon, 26 Apr 2004 01:53:08 +0000 (18:53 -0700)]
[PATCH] DVB: Other DVB core updates
- [DVB] remove superflous memset() which caused section data to be
overwritten when a) there are two sections in one TS packet, and b)
the first section was smaller than 18 bytes; thanks to Jean-Claude
Repetto for tracking this down
- [DVB] starting a ts filter on a running section filter's pid did
break the section filter; fixed.
- [DVB] integrate ULE Decapsulation code, thanks to gcs - Global
Communication & Services GmbH. and Institute for Computer Sciences
Salzburg University. Hilmar Linder <hlinder@cosy.sbg.ac.at> and
Wolfram Stering <wstering@cosy.sbg.ac.at>
- [DVB] fix the module use count bugs, thanks to Hernan A.Perez Masci
for his initial work on this problem
- [DVB] if dvb_frontend_internal_ioctl() returns an error code, be sure
to deliver it to the calling application, don't ignore it (fixes the
bug that the frontend0 doesn't respond properly to unknown ioctls...)
- [DVB] major frontend code clean up, rewritten core tuning loop.
Thanks to Andrew de Quincey.
- [DVB] follow changes in dvb-core in skystar2, dvb-bt8xx
Michael Hunold [Mon, 26 Apr 2004 01:52:47 +0000 (18:52 -0700)]
[PATCH] DVB: Update DVB budget drivers
- [DVB] budget-av: patch by Kenneth Aafløy to add support for Typhoon
DVB-S budget card
- [DVB] budget.c: support for Fujitsu-Siemens Activy Card
- [DVB] budget-ci: add preliminary CI support
Michael Hunold [Mon, 26 Apr 2004 01:52:23 +0000 (18:52 -0700)]
[PATCH] V4L: Update the saa7146 driver
- [DVB] saa7146 driver updates:
- remove bogus v_calc and h_calc parameters, which can be easily
retrieved from other values
- add class parameter to i2c initialization
- let resource handling provide more useful informations
- sanitize overlay/capture locking
Krzysztof Halasa [Sun, 25 Apr 2004 17:43:37 +0000 (13:43 -0400)]
[netdrvr tulip] fix use-after-free
The attached patch fixes an "oops" in tulip driver when a live interface
is deactivated (i.e. PC Card ejected or module unloaded) without being
brought down first.
[PATCH] generic PCI IDE support for Toshiba Piccolo chips
From: Daniel Drake <dsd@gentoo.org>
Adds Toshiba chips to the list supported by the generic PCI IDE driver.
The 2.4 tree already contained an entry for 0x1179:0x0102, this patch
adds that entry to 2.6 as well as two new ones (0x0103 and 0x0105).
This then allows DMA to be enabled on disks.
[ARM PATCH] 1815/1: Generic DMA buffer bouncing support for ARM targets
Patch from Deepak Saxena
Latest (and hopefully last :) patch for generic DMA buffer bouncing.
- Fixed SA1111 dma_needs_bounce
- Added check for out of bounds buffers.
- Made dmabounce.c directly implement dma_* API
Note that I didn't do the following:
#ifndef CONFIG_DMABOUNCE
inline implementations of all functions
#else
extern declarations
#endif
Instead I wrapped it individual in #ifndef/#else blocks to keep the
comments in the same area as function declarations. IMHO this makes
it easier for someone to go look at the comments if they need to know
what a specific API does.
Scott Feldman [Sat, 24 Apr 2004 18:19:01 +0000 (14:19 -0400)]
[PATCH] e100: ICH 10/H Tx hang fix
* Need to carry forward this workaround from old e100 driver to
avoid a Tx hang on ICH systems linked at 10/Half. Workaround
adds a stall before each Tx command queued by issuing a NOP
command followed by 1us delay. Yuck! Otherwise HW locks hard.
(Probably needed for eepro100 also ;-).
Nicolas Pitre [Fri, 23 Apr 2004 23:34:47 +0000 (00:34 +0100)]
[ARM PATCH] 1825/1: abort on bad code generation with div64 in some cases
Patch from Nicolas Pitre
One case was found when the kernel is compiled with -O2 (instead of the
default -Os). However, all gcc-3.* versions seem to have a problem with
this. Instead of blacklisting them all unconditionally, better just abort
when a bad case occurs especially since this bad case doesn't seem to
appear with current default compiler flags. Depends on patch #1824.
Nicolas Pitre [Fri, 23 Apr 2004 23:31:14 +0000 (00:31 +0100)]
[ARM PATCH] 1824/1: guard against gcc not respecting local variable register assignment
Patch from Nicolas Pitre
The recent discovery of a problem with gcc not always respecting register
assignment for local variables to be used with inline assembly is worrisome.
If unnoticed, such problems can cover bugs that might prove hard to find
especially when the code is right but silently ignored. This patch adds a
test where needed to have the assembler confirm our register selection and
fail the kernel build if the wrong registers are allocated.
NTFS: Finally fix NFS exporting of mounted NTFS volumes by checking the
return of d_splice_alias() and acting accordingly rather than just
ignoring the returned dentry.
Andrew Morton [Thu, 22 Apr 2004 23:32:08 +0000 (16:32 -0700)]
[PATCH] writeback livelock fix
If a filesystem's ->writepage implementation repeatedly refuses to write the
page (it keeps on redirtying it instead) (reiserfs seems to do this) then the
writeback logic can get stuck repeately trying to write the same page.
Fix that up by correctly setting wbc->pages_skipped, to tell the writeback
logic that things aren't working out.
Linda Xie [Thu, 22 Apr 2004 08:11:12 +0000 (01:11 -0700)]
[PATCH] symlink doesn't support kobj name > 20 charaters (KOBJ_NAME_LEN)
Since symlink.c uses "name" field of a kobj when it calculates the
length, it gets a wrong value if the kobj's name has more than 20
charathers. A correct way to do that is to call kobject_name(kobj)
instead of using kobj->name directly.