Gerd Knorr [Wed, 20 Oct 2004 01:18:09 +0000 (18:18 -0700)]
[PATCH] v4l: bttv driver update
This update for the bttv driver. Changes:
* adapt the driver to video-buf changes.
* It also added sanity checks for the bt878 risc code buffer sizes.
* adds support for new tv cards.
* cleanup i2c driver autoload.
* misc cleanups (msleep, ...).
* fix IRQ bug when stopping vbi capture.
* drop check for cx2388x (bt878 successor) and the printk saying bttv
doesn't support these.
* set i2c class correctly for dvb cards.
Gerd Knorr [Wed, 20 Oct 2004 01:17:42 +0000 (18:17 -0700)]
[PATCH] v4l: avoid using struct file ptrs in video-buf
This patch makes the video-buf helper module pass through a void pointer
instead of a struct file pointer, that makes the code also usable when no
file pointer is available. This is needed for when using the video-buf
infrastructure to manage DMA buffers for DVB cards.
The file pointer was used by the videobuf_queue_ops callbacks to get the
drivers private data via file->private_data, now a pointer to the drivers's
private data can be passed directly.
Adaptions of the drivers follow with separate patches.
Hugh Dickins [Wed, 20 Oct 2004 01:17:12 +0000 (18:17 -0700)]
[PATCH] lighten mmlist_lock
Let's lighten the global spinlock mmlist_lock.
What's it for?
1. Its original role is to guard mmlist.
2. It later got a second role, to prevent get_task_mm from raising
mm_users from the dead, just after it went down to 0.
Firstly consider the second: __exit_mm sets tsk->mm NULL while holding
task_lock before calling mmput; so mmlist_lock only guards against the
exceptional case, of get_task_mm on a kernel workthread which did AIO's
use_mm (which transiently sets its tsk->mm without raising mm_users) on an
mm now exiting.
Well, I don't think get_task_mm should succeed at all on use_mm tasks.
It's mainly used by /proc/pid and ptrace, seems at best confusing for those
to present the kernel thread as having a user mm, which it won't have a
moment later. Define PF_BORROWED_MM, set in use_mm, clear in unuse_mm
(though we could just leave it), get_task_mm give NULL if set.
Secondly consider the first: and what's mmlist for?
1. Its original role was for swap_out to scan: rmap ended that in 2.5.27.
2. In 2.4.10 it got a second role, for try_to_unuse to scan for swapoff.
So, make mmlist a list of mms which maybe have pages on swap: add mm to
mmlist when first swap entry is assigned in try_to_unmap_one (pageout), or
in copy_page_range (fork); and mmput remove it from mmlist as before,
except usually list_empty and there's no need to lock. drain_mmlist added
to swapoff, to empty out the mmlist if no swap is then in use.
mmput leave mm on mmlist until after its exit_mmap, so try_to_unmap_one can
still add mm to mmlist without worrying about the mm_users 0 case; but
try_to_unuse must avoid the mm_users 0 case (when an mm might be removed
from mmlist, and freed, while it's down in unuse_process): use
atomic_inc_return now all architectures support that.
Some of the detailed comments in try_to_unuse have grown out of date:
updated and trimmed some, but leave SWAP_MAP_MAX for another occasion.
Hirofumi Ogawa [Wed, 20 Oct 2004 01:16:56 +0000 (18:16 -0700)]
[PATCH] FAT: remove validity check of FAT first entry
The low byte of FAT's first entry must have same value with media-field.
So, I added that validity check for some case. In fact, in some case
this check detected non-FAT filesystem. But in real world,
unfortunately too many devices is writing a wrong value.
Hirofumi Ogawa [Wed, 20 Oct 2004 01:15:04 +0000 (18:15 -0700)]
[PATCH] FAT: rewrite the cache for file allocation table lookup
This rewrites the cache stuff for file allocation table (FAT).
This cache stocks the more pieces of FAT-chain by counting the number
of contiguous data blocks. And if cache hit, since a block number can
calculate without looking FAT-chain up, fat_get_block() become more
fast.
But if data blocks was fragmenting, unfortunately this cache is unuseful.
read from block device
[1st]# time dd if=/dev/hda6 of=/dev/null bs=1M count=2048 2147483648 bytes transferred in 229.524189 seconds (9356241 bytes/sec)
real 3m49.557s, user 0m0.026s, sys 1m20.414s
[2nd]# time dd if=/dev/hda6 of=/dev/null bs=1M count=2048 2147483648 bytes transferred in 229.539358 seconds (9355623 bytes/sec)
real 3m49.647s, user 0m0.036s, sys 1m20.144s
read from full contiguous file with this patch
[1st]# time dd if=data of=/dev/null bs=1M count=2048 2147483648 bytes transferred in 337.959477 seconds (6354264 bytes/sec)
real 5m37.970s, user 0m0.031s, sys 1m21.915s
[2nd]# time dd if=data of=/dev/null bs=1M count=2048 2147483648 bytes transferred in 225.401699 seconds (9527362 bytes/sec)
real 3m45.476s, user 0m0.027s, sys 1m19.286s
read from full fragmented file with this patch
[1st]# time dd if=data of=/dev/null bs=1M count=2048 2147483647 bytes transferred in 1146.529081 seconds (1873030 bytes/sec)
real 19m6.538s, user 0m0.020s, sys 1m32.774s
[2nd]# time dd if=data of=/dev/null bs=1M count=2048 2147483647 bytes transferred in 1045.084822 seconds (2054841 bytes/sec)
real 17m25.152s, user 0m0.022s, sys 1m34.801s
read from full contiguous file without this patch
[1st]# time dd if=data of=/dev/null bs=1M count=2048 2147483648 bytes transferred in 348.144707 seconds (6168365 bytes/sec)
real 5m48.169s, user 0m0.019s, sys 1m29.962s
[2nd]# time dd if=data of=/dev/null bs=1M count=2048 2147483648 bytes transferred in 324.017361 seconds (6627681 bytes/sec)
real 5m24.038s, user 0m0.023s, sys 1m20.602s
read from full fragmented file without this patch
[1st]# time dd if=data of=/dev/null bs=1M count=2048 2147483647 bytes transferred in 1156.845693 seconds (1856327 bytes/sec)
real 19m16.855s, user 0m0.031s, sys 1m32.172s
[2nd]# time dd if=data of=/dev/null bs=1M count=2048 2147483647 bytes transferred in 1066.518713 seconds (2013545 bytes/sec)
real 17m46.526s, user 0m0.023s, sys 1m33.630s
Add atomic_sub_and_test() to sparc32, implemented in terms of
atomic_sub_return(), so reiser4 can be simultaneously microoptimized for
x86 and made to pass compilation testing on sparc32.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
KaiGai Kohei [Wed, 20 Oct 2004 01:13:58 +0000 (18:13 -0700)]
[PATCH] atomic_inc_return() for arm26
This patch implements atomic_inc_return() and so on for ARM26. Because
Hugh says that SMP is not supported in arm26, it is implemented by normal
operations between local_irq_save() and local_irq_restore() like another
atomic operations.
David Woodhouse [Wed, 20 Oct 2004 01:13:00 +0000 (18:13 -0700)]
[PATCH] JFFS2: work around uninitialised use of usercompr field by old code.
We didn't use the 'usercompr' field before recently. Unfortunately we didn't
set it to zero either, so there's a lot of file systems out there with it set
to 0x5a. Deal with that rather than getting confused.
Signed-Off-By: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Randy Dunlap [Wed, 20 Oct 2004 01:12:46 +0000 (18:12 -0700)]
[PATCH] x86_64/io_apic init section fixups
Code section errors in i386/io_apic.c found by scripts/reference_init.pl.
Looks like they could cause problems for a few drivers or in a real hotplug
environment.
Error: ./arch/i386/kernel/io_apic.o .text refers to 000018ff R_386_PC32 .init.text
Error: ./arch/i386/kernel/io_apic.o .text refers to 00001967 R_386_PC32 .init.text
(as above thru {A}, then:)
IO_APIC_irq_trigger
irq_trigger
MPBIOS_trigger >> removing __init from this led to
needing to remove __init from
EISA_ELCR also.
Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Gordon Jin [Wed, 20 Oct 2004 01:12:34 +0000 (18:12 -0700)]
[PATCH] x86_64: correct copy_user_generic return value when exception happens
Fix a bug that arch/x86_64/lib/copy_user:copy_user_generic will return a
wrong value when exception happens.
In the case the address is not 8-byte aligned (i.e. go into
Lbad_alignment), if exception happens in Ls11, %rdx will be wrong number of
copied bytes, then copy_user_generic returns wrong value. It also fixed a
bug of zeroing wrong number of bytes of destination at this situation. (In
Lzero_rest)
Signed-off-by: Yanmin Zhang <yanmin.zhang@intel.com> Signed-off-by: Nanhai Zou <nanhai.zou@intel.com> Signed-off-by: Gordon Jin <gordon.jin@intel.com> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andi Kleen [Wed, 20 Oct 2004 01:12:05 +0000 (18:12 -0700)]
[PATCH] x86_64: fix IOAPIC on Nvidia boards
Originally suggested by Zwane Mwaikumbo
Ignore all ACPI timer overrides on all Nvidia boards. The fallback doesn't
work and no Nvidia boards needs a timer override. But some buggy BIOS have
it anyways.
Also enable IO-APIC mode by default for Nvidia then.
Andi Kleen [Wed, 20 Oct 2004 01:11:26 +0000 (18:11 -0700)]
[PATCH] x86_64: use TSC on SMP EM64T machines
x86-64 MP kernels always used HPET timing when available. This was done
because AMD systems don't have synchronized TSCs in all cases. On Intel
this is not true (except Summit), so use faster TSC timing for those.
Also only enable HPET gettimeofday when there is more than one CPU online.
Andi Kleen [Wed, 20 Oct 2004 01:10:56 +0000 (18:10 -0700)]
[PATCH] x86_64: drop old APIC workaround
Suggested by Ingo Molnar.
Drop APIC level workaround for old IO-APICs on x86-64 because it is a
significant part of interrupt handling time. x86-64 only runs on modern
chipsets that probably don't have this bug.
Rusty Russell [Wed, 20 Oct 2004 01:10:43 +0000 (18:10 -0700)]
[PATCH] module_param_array() should take a pointer
module_param_array() takes a variable to put the number of elements in.
Looking through the uses, many people don't care, so they declare a dummy
or share one variable between several parameters. The latter is
problematic because sysfs uses that number to decide how many to display.
The solution is to change the variable arg to a pointer, and if the pointer
is NULL, use the "max" value. This change is fairly small, but fixing up
the callers is a lot of (trivial) churn.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Robin Holt [Tue, 19 Oct 2004 20:38:23 +0000 (20:38 +0000)]
[IA64-SGI] Distribute useage of BTE interfaces.
During peak utilization periods, the first interface on a node has
an inordinately large amount of contention. This is due to all
cpus starting their scan for an interface at 0. This patch distributes
that based upon the slice the requesting cpu is attached to.
Signed-off-by: Robin Holt Signed-off-by: Tony Luck <tony.luck@intel.com>
Robin Holt [Tue, 19 Oct 2004 20:36:01 +0000 (20:36 +0000)]
[IA64-SGI] Correct BTE notification timeouts on SN2.
The SN2 Block Transfer Engine occassionally fails to send a notification
that it has completed a transfer to the kernel. This patch adds a
timeout mechanism which will detect the failure, reset the interface,
and then retry the transfer.
Signed-off-by: Robin Holt Signed-off-by: Tony Luck <tony.luck@intel.com>
Robin Holt [Tue, 19 Oct 2004 17:33:58 +0000 (17:33 +0000)]
[IA64-SGI] Double spin_unlock in bte.c
If all bte interfaces are in use, the current code will leave the
bte pointer set when exiting from the loop trying to locate an
interface to use. This results in two processes using the same
interface and both trying to free the same one. With a
premptible kernel, this results in the preempt count getting
off.
Signed-off-by: Robin Holt <holt@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Russell King [Tue, 19 Oct 2004 17:11:22 +0000 (18:11 +0100)]
[SERIAL] Keep trying to register our console device.
Some serial drivers receive their serial port device information via
the device model. This unfortunately means that the selected port
may not be available when the console subsystem initialises, so we
must keep trying to register the console after each port is added.
Russell King [Tue, 19 Oct 2004 16:50:24 +0000 (17:50 +0100)]
[SERIAL] Add new port registration/unregistration functions.
serial8250_register_port()/serial8250_unregister_port() has the
capability of registering ports with their struct device nodes,
which allows sysfs to indicate which tty devices belong to which
hardware devices.
We also add a serial8250 platform device driver in an initial
attempt at PM for ISA ports. However, I'm leaving out the
platform device for the time being since adding that would cause
potential oops issues.
Russell King [Tue, 19 Oct 2004 16:22:21 +0000 (17:22 +0100)]
[SERIAL] Make port autoprobing set up->capabilities.
Convert port autoprobing to set up->capabilities as it discovers
various capabilities of the port. Warn when the detected
capabilities do not match those in the uart_config table.
Russell King [Tue, 19 Oct 2004 16:00:01 +0000 (17:00 +0100)]
[SERIAL] Clean up handling of LSR in receive function.
It's pointless accessing the LSR value via a pointer all the time -
it prevents the compiler optimising it. Also, ensure that we
recognise a break sent during a kernel printk correctly.
Gerd Knorr [Tue, 19 Oct 2004 09:19:10 +0000 (02:19 -0700)]
[PATCH] I2C: i2c bus power management support
The patch below adds power management support to the i2c bus.
It adds just two small functions which call down to the devices
power management functions if they are present, so the i2c device
drivers will receive the suspend and resume events.
Jean Delvare [Tue, 19 Oct 2004 08:24:45 +0000 (01:24 -0700)]
[PATCH] I2C: lm87 driver ported to Linux 2.6
This is my port of the lm87 driver to Linux 2.6. It is based on the
preliminary work of Jeff Oliver. I then significantly improved the code,
added functionality, tested the whole thing on a real motherboard, fixed
a couple remaining bugs, and here we are.
I'll port a number of improvements and fixes back to the 2.4 version of
the driver after lm_sensors 2.8.8 is released (i.e. soon).
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Jean Delvare [Tue, 19 Oct 2004 08:22:05 +0000 (01:22 -0700)]
[PATCH] I2C: Clean up i2c-amd756 and i2c-prosavage messages
A number of messages in the i2c-amd756 and i2c-prosavage drivers have a
leading ": " (especially the former). This is a legacy from lm_sensors'
printks of the 2.4 times. This patch cleans them up. While I was there,
I dropped a couple useless white spaces and dots as well.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Jean Delvare [Tue, 19 Oct 2004 08:21:48 +0000 (01:21 -0700)]
[PATCH] I2C: Fix amd756 name
This sets the proper name for busses supported by the i2c-amd756 driver.
So far, all busses were named AMD756 regardless of the real hardware.
Setting the real name is certainly less confusing for the user, and the
sensors-detect script expects this too.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Jean Delvare [Tue, 19 Oct 2004 08:21:33 +0000 (01:21 -0700)]
[PATCH] I2C: Update Kconfig for AMD bus drivers
This updates the AMD entries i2c/busses/Kconfig in two ways:
* Add missing PCI dependancy.
* Reword the help so that users know exactly what is supported by each
driver.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
[PATCH] I2C: replace schedule_timeout() with msleep_interruptible() in i2c-ibm_iic.c
Use msleep_interruptible() instead of schedule_timeout() to
guarantee the task delays as expected. Remove the unnecessary
set_current_state() following the if, as schedule_timeout() [and thus,
mlseep_interruptible()] is guaranteed to return in TASK_RUNNING.
Rudolf Marek [Tue, 19 Oct 2004 08:20:59 +0000 (01:20 -0700)]
[PATCH] I2C: fix it8712 detection
Following patch fixes the bug introduced by me in VID VRM patch.
Spotted (and later reviewed) by Jean Delvare. This bug is non-fatal,
it8712 will be just treated as it was before my VID VRM patch.
Tested on it8705 and it8712 hardware.
Signed-off-by: Rudolf Marek <r.marek@sh.cvut.cz> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Jean Delvare [Tue, 19 Oct 2004 08:20:22 +0000 (01:20 -0700)]
[PATCH] I2C: Fourth auto-fan control interface proposal
Here comes my fourth (and hopefully last) sysfs interface proposal for
implementing auto-fan control in 2.6. Previous proposals have been
discussed here:
Renamed files from fan[1-*]_auto_channels to
pwm[1-*]_auto_channels_temp. The change from fan tp pwm is to match the
recent renaming suggested by Mark M. Hoffman [5]. The "_temp" suffix is
to leave some room for a "_fan" suffix at a later time if new chips
drive auto pwm according to fan speeds instead of temperature.
Trip points are now numbered (point1, point2, etc...) instead of named
(_off, _min, _max, _full...). This solves the problem of various chips
having a different number of trip points. The interface is still chip
independent in that it doesn't require chip-specific knowledge to be
used by user-space apps.
The reason for this change is that newer chips tend to have more trip
points. the LM63 has 8, the LM93 has no less than 12. Also, I read in
the LM63 datasheet that ideal pwm vs temperature curve were parabolic in
shape. Seems hard to achieve this if we arbitrarily lock the number of
trip points to 3 ;)
I also introduced an optional hysteresis temperature for trip points.
The LM63 has this. Since it makes full sense I'd expect other chips to
propose this as well.
As before, there are two sets of files, each chip driver picks the one
matching its internal model: trip points are either temperature
channel-dependent (ADM1031...) or pwm channel-dependent (IT87xx...). If
we ever come accross fan speed-driven pwm outputs where trip points are
fan channel-dependent we may have to offer a third set of files. We'll
see when/if this happens.
I hope I have taken everyone's comments and advice into account and we
can make this interface proposal part of the sysfs interface standard
now. I'm sorry it took so long. Comments welcome.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Jean Delvare [Tue, 19 Oct 2004 08:14:51 +0000 (01:14 -0700)]
[PATCH] I2C: Spare 1 byte in lm90 driver
I just noticed the other day that the lm90 driver uses an u16 to store
the value of the 8-bit alarms register. This is most probably due to the
fact that I originally copied the lm90 driver from the lm83 driver,
which actually has two 8-bit registers for alarms, and obviously forgot
to change the variable type.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
* split off ->dma_exec_cmd() from ->ide_dma_[read,write] functions
* choose command to execute by ->dma_exec_cmd() in higher layers
and remove ->ide_dma_[read,write]
* in Etrax ide.c driver REQ_DRIVE_TASKFILE requests weren't
handled properly for drive->addressing == 0
* in trm290.c read and write commands were interchanged
* in sgiioc4.c commands weren't sent to disk devices
* tag REQ_DRIVE_TASKFILE write requests with REQ_RW
* split off ->dma_setup() from ->ide_dma_[read,write] functions
* use ->dma_setup() directly in ATAPI drivers and remove media
checks from ->ide_dma_[read,write]
* ->ide_dma_[read,write,begin] cannot fail now
* in Etrax ide.c setup DMA for ATAPI devices before sending
command to drive (so setup order is the same as for disks)
Russell King [Tue, 19 Oct 2004 20:36:16 +0000 (21:36 +0100)]
[ARM] Add generic RTC implementation.
This provides a number of helper functions and data structures
for RTC implementations to make use of, including a standard
implemention for /proc/driver/rtc and the rtc miscdevice. It
supports runtime registration of RTC timekeeping sources.
Russell King [Tue, 19 Oct 2004 19:02:21 +0000 (20:02 +0100)]
[ARM] Sanitise Footbridge machine class.
Footbridge was suffering from a little lack of care and attention;
it still had the nasty arch.c file with all the associated #ifdef
gross-ness that entailed.
Re-jig footbridge support so that each machine type contains all
the necessary support code, with a separate common implementation
which they all share.
Russell King [Tue, 19 Oct 2004 17:53:05 +0000 (18:53 +0100)]
[ARM] Rehash iwmmxt signal handling.
In the near future, VFP will want to save state onto the user stack.
Therefore, separate out the iwmmxt specific parts, and implement
a generic "safe copy to user space using random CPU instructions".
This is necessary because iwmmxt and VFP both use special CPU
instructions to load and/or save their state.