Patch to insert ioremap() error checking and missing iounmap()'s. Also
updated error handling to have only one return statement on error.
Finally, in saa7134_finidev() on line 954 there was a duplicate
saa7134_i2c_unregister().
Dmasound core fixes from Christoph Hellwig:
- Some exported symbols are declared __init - in the modular case this is
freed before the other modules can call it..
- dmasound.lock is initialized too late, do it at compile time
This fixes two buts that the glibc NPTL verification tests found, one
new and one old.
The new bug is that "offset" has been declared as an alternative in
the union, instead of as an element in the structures comprising it,
effectively eliminating it from the key: keys match which should not.
The old bug is that if futex_requeue were called with identical
key1 and key2 (sensible? tended to happen given the first bug),
it was liable to loop for a long time holding futex_lock: guard
against that, still respecting the semantics of futex_requeue.
While here, please let's also fix the get_futex_key VM_NONLINEAR
case, which was returning the 1 from get_user_pages, taken as an
error by its callers. And save a few bytes and improve debuggability
by uninlining the top-level futex_wake, futex_requeue, futex_wait.
Russell King [Sat, 6 Sep 2003 20:08:46 +0000 (21:08 +0100)]
[PCMCIA] Fix race condition causing cards to be incorrectly recognised
This patch fixes a race condition between the pcmcia socket initial
insert processing, ds.c and cardmgr. This allowed cardmgr to believe
that a card was inserted while the card is still in the process of
resetting itself, and it therefore tried to read the CIS while it
was unavailable.
We change the meaning of SOCKET_PRESENT slightly - it now means that
a card is present _and we have completed its initialisation_. We
introduce SOCKET_INUSE to indicate that we have a reference count
against the module.
We also take the skt_sem to prevent clients from registering while
we're handling an insert/remove/suspend/resume.
Jean Tourrilhes [Fri, 5 Sep 2003 17:09:03 +0000 (13:09 -0400)]
[irda] init failure cleanups
<Patch from Guennadi Liakhovetski>
o [FEATURE] Don't leak stuff in various failure paths
o [FEATURE] Properly initialise self->max_header_size in IrIAP
Jean Tourrilhes [Fri, 5 Sep 2003 17:08:56 +0000 (13:08 -0400)]
[irda] connect watchdog fixes
o [CRITICA] In case of connect watchdog, drop reference to the LAP
o [CORRECT] Prevent dumping LSAP after connect watchdog
o [CRITICA] Prevent dumping TSAP if dumping LSAP did fail
o [CORRECT] Only set connected bit on response if LSAP state is correct
Jean Tourrilhes [Fri, 5 Sep 2003 17:08:37 +0000 (13:08 -0400)]
[irda] NSC 3839x probe fixes
<Patch from Jan Frey>
o [CORRECT] Make NSC 3839x probe and init *really* work
The new 3839x code was totally broken.
Won't affect code for regular 38108/38338 chips.
David Brownell [Fri, 5 Sep 2003 09:23:05 +0000 (02:23 -0700)]
[PATCH] USB: usb_epnum_to_ep_desc only look
Original patch from oliverthered@oliverthered.com ... this
updates it:
- usb_epnum_to_ep_desc() only looks at the active altsetting
- docs clarified
It's possible some user mode drivers will have relied on the
previous buggy behavior, since usbfs uses this call. The fix
will be for them to set the appropriate altsetting.
Patrick Mochel [Fri, 5 Sep 2003 08:28:49 +0000 (01:28 -0700)]
[driver model] Add exports for sys devices.
From Dominik Brodowski:
A few missing exports -- even though the cpu_sysdev_class isn't strictly
needed now, I need it for a few ACPI-related patches I'll send out in a
minute.
Dave Kleikamp [Fri, 5 Sep 2003 05:38:49 +0000 (22:38 -0700)]
[PATCH] New version of jfsutils needed
A recent change to the 2.6.0 kernel has changed the behavior of opening a
block device with the O_EXCL flag. This can cause fsck.jfs to fail to
replay the journal when a file system is mounted read-only.
The JFS utilities have been fixed, and it is recommended that any users of
JFS update the utilities to version 1.1.3.
Alexander Viro [Fri, 5 Sep 2003 03:55:21 +0000 (20:55 -0700)]
[PATCH] large dev_t - second series (15/15)
old_decode_dev()/old_encode_dev() added where needed in other
filesystems. Parts in different filesystems are independent, but IMO
it's not worse splitting into a dozen of half-kilobyte patches.
Alexander Viro [Fri, 5 Sep 2003 03:54:53 +0000 (20:54 -0700)]
[PATCH] large dev_t - second series (12/15)
Similar fix for UFS; touching device node (and they have 32bit
dev_t) ends up killing upper 16 bits, which makes for very unhappy
*BSD, since that turns /dev/ad0s1 into alias of /dev/ad0. Again, for
now we store on-disk value in private part of inode and use it instead
of ->i_rdev in ->write_inode().
Alexander Viro [Fri, 5 Sep 2003 03:54:44 +0000 (20:54 -0700)]
[PATCH] large dev_t - second series (11/15)
Fix for JFS handling of device nodes; it has 32bit on-disk device
numbers, shoves them into 16bit (->i_rdev) when inode is read and writes
them back truncated when inode is written to disk. For now (and 2.4 will
have to do the same permanently) we store the original value in private
part of inode and use it instead of ->i_rdev in ->write_inode(); mknod()
sets it at the same time as ->i_rdev. It will become unnecessary when
dev_t becomes wider than 16 bits, but for now we need it.
Alexander Viro [Fri, 5 Sep 2003 03:54:36 +0000 (20:54 -0700)]
[PATCH] large dev_t - second series (10/15)
Fix for endianness bug in UDF: it writes major and minor as 32bit
host-endian and reads them as 32bit little-endian; obviously a bad idea
on big-endian boxen ;-) Needed both for 2.4 and 2.6.
Alexander Viro [Fri, 5 Sep 2003 03:54:27 +0000 (20:54 -0700)]
[PATCH] large dev_t - second series (9/15)
beginning of fs side work:
* new helpers - old_valid_dev(), old_encode_dev() and old_decode_dev()
* old_valid_dev() checks if dev_t value is OK for old filesystems
(i.e. both major and minor are below 256).
* old_valid_dev() calls are added in ->mknod() instances that care
about dev_t values (disk-backed and network ones).
* old_encode_dev() and old_decode_dev() convert dev_t -> u16
and u16 -> dev_t resp; currently these are no-ops, places that use current
formar (minor in bits 0--7, major in bits 8--15) will switch to these before
we widen dev_t.
Alexander Viro [Fri, 5 Sep 2003 03:53:56 +0000 (20:53 -0700)]
[PATCH] large dev_t - second series (6/15)
tty redirect handling sanitized. Such ttys (/dev/tty and
/dev/console) get a different file_operations; its ->write() handles
redirects; checks for file->f_op == &tty_fops updated, checks for
major:minor being that of a redirector replaced with check for
->f_op->write value. Piece of code in tty_io.c that had been #if 0
since 0.99<something> had been finally put out of its misery. kdev_val()
is gone.
Alexander Viro [Fri, 5 Sep 2003 03:53:47 +0000 (20:53 -0700)]
[PATCH] large dev_t - second series (5/15)
cdevname() killed, there was only one remaining user
(tty_paranoia_check()) and in that case cdevname() was worse
than plain major:minor (basically, it's "you've got corrupted
inode that was supposed to belong to tty device; here's what
I'd found in ->i_rdev")
Alexander Viro [Fri, 5 Sep 2003 03:53:38 +0000 (20:53 -0700)]
[PATCH] large dev_t - second series (4/15)
cciss cleanup - instead of playing with device numbers, we add
helper functions that get host and drive structures by gendisk and use
them in open/ioctl/release, same as had been done for cpqarray.
Russell King [Fri, 5 Sep 2003 17:36:50 +0000 (18:36 +0100)]
[ARM] Don't read the CPU control reg back - it may be write only.
Some ARM CPUs don't allow CP15 CR1 control register to be read.
Therefore, to ensure that the value hits the control register on
Xscale, read back the CP15 CR0 ID register instead.
Russell King [Fri, 5 Sep 2003 17:28:53 +0000 (18:28 +0100)]
[ARM] Restore preempt count before reporting unbalanced preempt count
On ARM, we oops when we detect that an interrupt handler has unbalanced
the preempt count. We should restore the preempt count when we started
to handle the interrupt and then cause the oops.
[PATCH] incomplete asm constraints in arch/i386/pci/pcbios.c
This fixes a "miscompile" HP reported against gcc 3.3 with
-march-pentium4. It turned out to be a non-complete asm contraint. the
existing constraint on "opt" was on the address of "opt", which allowed
gcc to reorder the setting of the fields inside opt to beyond the asm
that uses it, which is less than useful at best.
This changes the way futexes are indexed, so that they don't pin pages.
It also fixes some bugs with private mappings and COW pages.
Currently, all futexes look up the page at the userspace address and pin
it, using the pair (page,offset) as an index into a table of waiting
futexes. Any page with a futex waiting on it remains pinned in RAM,
which is a problem when many futexes are used, especially with FUTEX_FD.
Another problem is that the page is not always the correct one, if it
can be changed later by a COW (copy on write) operation. This can
happen when waiting on a futex without writing to it after fork(),
exec() or mmap(), if the page is then written to before attempting to
wake a futex at the same adress.
There are two symptoms of the COW problem:
- The wrong process can receive wakeups
- A process can fail to receive required wakeups.
This patch fixes both by changing the indexing so that VM_SHARED
mappings use the triple (inode,offset,index), and private mappings use
the pair (mm,virtual_address).
The former correctly handles all shared mappings, including tmpfs and
therefore all kinds of shared memory (IPC shm, /dev/shm and
MAP_ANON|MAP_SHARED). This works because every mapping which is
VM_SHARED has an associated non-zero vma->vm_file, and hence inode.
(This is ensured in do_mmap_pgoff, where it calls shmem_zero_setup).
The latter handles all private mappings, both files and anonymous. It
isn't affected by COW, because it doesn't care about the actual pages,
just the virtual address.
The patch has a few bonuses:
1. It removes the vcache implementation, as only futexes were
using it, and they don't any more.
2. Removing the vcache should make COW page faults a bit faster.
3. Futex operations no longer take the page table lock, walk
the page table, fault in pages that aren't mapped in the
page table, or do a vcache hash lookup - they are mostly a
simple offset calculation with one hash for the futex
table. So they should be noticably faster.
Special thanks to Hugh Dickins, Andrew Morton and Rusty Russell for
insightful feedback. All suggestions are included.
* get rid of leftover sti
* no longer need MOD_INC/DEC stuff
* get rid of dead code related to MOD_INC/DEC
* use module_init/module_exit to cleanly run init code