Russell King [Mon, 8 Sep 2003 20:28:05 +0000 (21:28 +0100)]
[SERIAL] Make SA11x0 serial driver build.
Update the SA11x0 serial driver for the removal of system devices
from the driver model. The driver becomes a platform device driver.
The driver is now known to the driver model and resource subsytems
as "sa11x0-uart".
Without this, if elv_try_last_merge() returns nonzero, we do not
initialise *req. That results in a subsequent BUG_ON() in
__make_request() because req is NULL (or is just uninitialised).
Arnd's new-and-improved _IOx() argument checking showed two sound
drivers whose microcode load ioctl's used types with sizes that
overflow the ioctl number. Mark them _IOx_BAD() to document the fact.
This new version works with all compiler versions, and also catches the
case where somebody tries to pass in an array as an argument to the
ioctl macros. Thus we verify that only proper types are used.
I have checked now that the object code for arch/s390/kernel/compat_ioctl.o
remains identical and that the whole kernel compiles for s390 and i386,
after fixing the broken ioctl numbers.
Rusty Russell [Sun, 7 Sep 2003 13:46:30 +0000 (06:46 -0700)]
[PATCH] modprobe -q: quieter when modules missing
The kernel invokes "modprobe" on modules which might not exist:
rightfully, modprobe complains by default when this happens. So the
correct response is to invoke "modprobe -q", which is silent on such
errors (but still reports other errors such as config errors).
Also, use MODULE_NAME_LEN from module.h instead of inventing our own.
Rusty Russell [Sun, 7 Sep 2003 13:46:23 +0000 (06:46 -0700)]
[PATCH] Modules: Be stricter recognizing init&exit sesections
Someone pointed out that -ffunction-sections can cause a function called
"init<something>" to be put in the init section, and discarded. This
hurts PARISC badly. Get more fussy with identifying them.
Nothing too exciting, just some minor new features and bug fixes.
The IOMMU code should now not BUG again without CONFIG_IOMMU_DEBUG/iommu=force
- Compiles now with -funit-at-a-time
- Fix up ioctl 32bit tables following Andrew's change.
- Fix __SI_POLL siginfo_t passing to user space
- Add 32bit emulation for fadvise64_64
- Remove unneeded sys32_utimes
- Various merges with i386 (ACPI, APIC etc.)
- Port cpuid patching infrastructure from i386
- Use it to provide better copy_*_user/memcpy/memset/clear/copy_page for
C stepping K8. String instructions are faster now that unrolled loops.
- Don't try to merge unforced PCI mappings that don't exceed the device's
DMA mask.
- Discard .exit.data/.exit.text at runtime like i386
- Don't use NTI stores for clear_user
- Convert bitops.h bitmap functions to use unsigned long * pointers instead
of void *
- Fix some warnings in kernel headers.
- Fix PDA comments
Russell King [Sun, 7 Sep 2003 08:48:13 +0000 (01:48 -0700)]
[PATCH] Fixes to allow ARM to build in the standard tree
In addition to the MODULE_ALIAS_LDISC patch, the following changes to
generic code are needed to allow ARM to build in Linus' tree.
The first is to add PT_SINGLESTEP to ptrace.h so we do the right thing
when adding/removing breakpoint instructions into processes (see
arch/arm/kernel/{signal.c,ptrace.c} for usage.)
The second is needed because pmd_clear() needs to flush the pmd.
However, we can't include tlbflush.h into pgtable.h without causing
a circular dependency (tlbflush.h needs vm_area_struct and mm_struct
which are in mm.h, which needs pgtable.h.) swapfile.c seems to be the
only file affected.
here are the next fixes, sorry for the delay, but one of bugs was a really
odd one.
Note:
- here are lot of bugs left, so ISDN is not stable yet but
I think it's really time to fix it, even if it need some cycles
to get it right (normally I'm only send patches if it works 100% for
me).
- I add some additional #warnings to address places which need fixing
(I hope that some of the other ISDN developer jump in)
Matthew Wilcox [Sun, 7 Sep 2003 02:43:46 +0000 (19:43 -0700)]
[PATCH] use size_t for the broken ioctl numbers
The ioctl number-generating macros should be used like
#define XXXX _IOR(n,x,type-of-arg)
which generates an ioctl number that has the size of the argument
encoded within it. But there are a number of ioctl #defines that look
like
#define XXXX _IOR(n,x,sizeof(type-of-arg))
which is very wrong: the _IO/_IOR/_IOW/_IOWR macros will do the sizeof()
on the argtype themselves, so the end result is that we will be doing a
sizeof(sizeof(argtype)), ie a sizeof(size_t).
In other words, the argtype didn't matter at all, and ended up totally
pointless.
Clearly it's too late to change the ioctl definitions, but we can at
least stop people from copying them and making the same mistake.
Sam Ravnborg [Sat, 6 Sep 2003 23:26:51 +0000 (01:26 +0200)]
kbuild: genksyms, add explicit reference to include dir
genksyms references .h files in the genksyms directory from a
generated .c file. Explicit tell kbuild to search the genksyms
directory in the kernel src tree for .h files.
Sam Ravnborg [Sat, 6 Sep 2003 23:13:18 +0000 (01:13 +0200)]
kbuild/isdn: Defer md5sum calculation until needed
Replacing ':=' assignment with '=' assignment defers md5sum calculation until
required. The pevious implementation actually calculated the md5sum during
a make clean
Sam Ravnborg [Sat, 6 Sep 2003 23:10:51 +0000 (01:10 +0200)]
kbuild/ieee1394: Makefile update
Use full path to script in oui.c build rule.
Take advantage of kbuild checking command-line arguments,
by adding FORCE as prerequisite, and by use of targets=
I looked a bit more at the keyboard code and find a bug
and a probable bug.
(i) In case a synaptics touchpad has been detected, the comment says
"disable AUX". But we do not set the disable bit, but instead .and.
with the bit - no doubt getting zero. This must be a bug.
(ii) Directly above this is the suspicious comment "keyboard translation
seems to be always off". But every machine comes always up in
translated scancode 2. Translation is never off. But wait! by
mistake the above .and. cleared the XLATE bit.
So, I think bug (i) explains mystery (ii).
However, note that this is code reading only. I do not have the
hardware, so cannot test.
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.