Gerald Schaefer [Sat, 4 Jun 2005 22:43:33 +0000 (15:43 -0700)]
[PATCH] s390: deadlock in appldata
The system might hang when using appldata_mem with high I/O traffic and a
large number of devices. The spinlocks bdev_lock and swaplock are acquired
via calls to si_meminfo() and si_swapinfo() from a tasklet, i.e. interrupt
context, which can lead to a deadlock. Replace tasklet with work queue.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
The condition for no context in do_exception checks for hard and soft
interrupts by using in_interrupt() but not for preemption. This is bad for
the users of __copy_from/to_user_inatomic because the fault handler might call
schedule although the preemption count is != 0. Use in_atomic() instead
in_interrupt().
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Bodo Stroesser [Sat, 4 Jun 2005 22:43:32 +0000 (15:43 -0700)]
[PATCH] s390: uml ptrace fixes
To make UML build and run on s390, I needed to do these two little
changes:
1) UML includes some of the subarch's (s390) headers. I had to
change one of them with the following one-liner, to make this
compile. AFAICS, this change doesn't break compilation of s390
itself.
2) UML needs to intercept syscalls via ptrace to invalidate the syscall,
read syscall's parameters and write the result with the result of
UML's syscall processing. Also, UML needs to make sure, that the host
does no syscall restart processing. On i386 for example, this can be
done by writing -1 to orig_eax on the 2nd syscall interception
(orig_eax is the syscall number, which after the interception is used
as a "interrupt was a syscall" flag only.
Unfortunately, s390 holds syscall number and syscall result in gpr2 and
its "interrupt was a syscall" flag (trap) is unreachable via ptrace.
So I changed the host to set trap to -1, if the syscall number is changed
to an invalid value on the first syscall interception.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
The special cases of peek and poke on acrs[15] and the fpc register are not
handled correctly. A poke on acrs[15] will clobber the 4 bytes after the
access registers in the thread_info structure. That happens to be the kernel
stack pointer. A poke on the fpc with an invalid value is not caught by the
validity check. On the next context switch the broken fpc value will cause a
program check in the kernel. Improving the checks in peek and poke fixes
this.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
When fsync() runs wait_on_page_writeback_range() it only inspects pages which
are actually under I/O (PAGECACHE_TAG_WRITEBACK). If a page completed I/O
prior to wait_on_page_writeback_range() looking at it, it is supposed to have
recorded its I/O error state in the address_space.
But mpage_mpage_end_io_write() forgot to set the address_space error flag in
this case.
Nathan Lynch [Thu, 2 Jun 2005 22:15:09 +0000 (17:15 -0500)]
[SCSI] fix slab corruption during ipr probe
With CONFIG_DEBUG_SLAB=y I see slab corruption messages during boot on
pSeries machines with IPR adapters with any 2.6.12-rc kernel.
The change which seems to have introduced the problem is "SCSI: revamp
target scanning routines" and may be found at:
http://marc.theaimsgroup.com/?l=bk-commits-head&m=111093946426333&w=2
In order to revert that in a 2.6.12-rc1 tree, I had to revert "target
code updates to support scanned targets" first:
http://marc.theaimsgroup.com/?l=bk-commits-head&m=111094132524649&w=2
With both patches reverted, the corruption messages go away.
I did some digging and the problem seems to be a refcounting issue in
__scsi_add_device. The target gets freed in scsi_target_reap, and
then __scsi_add_device tries to do another device_put on it.
Signed-off-by: Nathan Lynch <ntl@pobox.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Craig Shelley [Thu, 26 May 2005 23:09:56 +0000 (00:09 +0100)]
[PATCH] USB: CP2101 Add support for flow control
Added support to get/set flow control line levels using TIOCMGET and
TIOCMSET.
Added support for RTSCTS hardware flow control.
cp2101_get_config and cp2101_set_config modified to support long request
strings, required for configuring flow control.
Roman Kagan [Thu, 5 May 2005 20:55:56 +0000 (00:55 +0400)]
[PATCH] USB: update urb documentation
On Wed, May 04, 2005 at 01:37:30PM -0700, David Brownell wrote:
> On Wednesday 04 May 2005 12:19 pm, Roman Kagan wrote:
> > struct urb {
> > /* private, usb core and host controller only fields in the urb */
> > ...
> > struct list_head urb_list; /* list pointer to all active urbs */
> > ...
> > };
> >
> > Is it safe to use it for driver's purposes when the driver owns the urb,
> > that is, starting from the completion routine until the urb is submitted
> > with usb_submit_urb()?
>
> Right now, it should be.
Great! FWIW I've briefly tested a modified version of usbatm using
the list head in struct urb instead of creating a wrapper struct, and I
haven't seen any failures yet. So I tend to believe that your "should
be" actually means "is" :)
> > If it is, can it be guaranteed in future, e.g.
> > by moving the list head into the public section of struct urb?
>
> In fact I'm not sure why it ever got called "private" to usbcore/hcds.
> I thought the idea was that it should be like urb->status, reserved for
> whoever controls the URB.
OK then how about the following (essentially documentation) patch?
Signed-off-by: Roman Kagan <rkagan@mail.ru> Acked-by: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Paulo Marques [Wed, 18 May 2005 12:12:49 +0000 (13:12 +0100)]
[PATCH] USB: make MODALIAS code a bit smaller devices
This patch makes the code to provide modalias in sysfs for usb devices
56 bytes smaller in i386, while making it clear that the first part of
the modalias string is the same no matter what the device class is.
Signed-Off-By: Paulo Marques <pmarques@grupopie.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Matthias Urlichs [Tue, 24 May 2005 00:00:48 +0000 (17:00 -0700)]
[PATCH] USB: add Option Card driver
This patch adds a new driver for "Option" cards. This is a GSM data card,
controlled by three "serial ports" which are connected via an OHCI adapter,
all located on an oversized PC-Card. It's sold by several GSM service
providers.
Traditionally, this card has been accessed via the standard serial driver
and appropriate vendor= and product= options. However, testing has
revealed several problems with this approach, including hung data transfers
and lost data blocks when receiving.
Lonnie Mendez [Tue, 10 May 2005 05:17:17 +0000 (00:17 -0500)]
[PATCH] USB: hid-core: add Earthmate lt-20 productid to blacklist table
This patch adds the DeLorme Earthmate lt-20 productid to the hid
blacklist table. This patch ensures the lt-20 can be claimed by the
appropriate driver (cypress_m8).
Adds the product id 0x200, of the DeLorme Earthmate lt-20, to the hid
blacklist table.
Jiri Benc [Thu, 2 Jun 2005 23:48:05 +0000 (16:48 -0700)]
[NET]: Fix HH_DATA_OFF.
When the hardware header size is a multiple of HH_DATA_MOD, HH_DATA_OFF()
incorrectly returns HH_DATA_MOD (instead of 0). This affects ieee80211 layer
as 802.11 header is 32 bytes long.
Signed-off-by: Jiri Benc <jbenc@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
o use a semaphore instead of an opencoded and racy lock
o move locking out of shaper_kick and into the callers - most just
released the lock before calling shaper_kick
o remove in_interrupt() tests. from ->close we can always block, from
->hard_start_xmit and timer context never
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Anton Blanchard [Thu, 2 Jun 2005 21:02:02 +0000 (14:02 -0700)]
[PATCH] ppc64: cleanup iseries runlight support
The iseries has a bar graph on the front panel that shows how busy it is.
The operating system sets and clears a bit in the CTRL register to control
it.
Instead of going to the complexity of using a thread info bit, just set and
clear it in the idle loop.
Also create two helper functions, ppc64_runlatch_on and ppc64_runlatch_off.
Finally don't use the short form of the SPR defines.
Signed-off-by: Anton Blanchard <anton@samba.org> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Anton Blanchard [Thu, 2 Jun 2005 21:02:02 +0000 (14:02 -0700)]
[PATCH] ppc64: cleanup SPR definitions
There are a bunch of irrelevant SPR definitions in asm/processer.h. Cut
them down a bit, also add a DABR_TRANSLATION define which will be used
shortly.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jan Kara [Thu, 2 Jun 2005 21:02:01 +0000 (14:02 -0700)]
[PATCH] ext3: fix list scanning in __cleanup_transaction
Fix a bug in list scanning that can cause us to skip the last buffer on the
checkpoint list (and hence fail to do any progress under some rather
unfavorable conditions).
The problem is we first do jh=next_jh and then test
} while (jh!=last_jh);
Hence we skip the last buffer on the list (if it was not the only buffer on
the list). As we already do jh=next_jh; in the beginning of the loop we
are safe to just remove the assignment in the end. It can happen that 'jh'
will be freed at the point we test jh != last_jh but that does not matter
as we never *dereference* the pointer.
Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Fix possible false assertion failure in log_do_checkpoint(). We might fail
to detect that we actually made a progress when cleaning up the checkpoint
lists if we don't retry after writing something to disk. The patch was
confirmed to fix observed assertion failures for several users.
When we flushed some buffers we need to retry scanning the list.
Otherwise we can fail to detect our progress.
Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jesper Juhl [Thu, 2 Jun 2005 20:04:07 +0000 (13:04 -0700)]
[ATM]: [drivers] kill pointless NULL checks and casts before kfree()
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil> Signed-off-by: David S. Miller <davem@davemloft.net>
Jan Beulich [Thu, 2 Jun 2005 20:03:15 +0000 (13:03 -0700)]
[ATM]: fix ATM makefile for out-of-source-tree builds
Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil> Signed-off-by: David S. Miller <davem@davemloft.net>
[PATCH] ppc64: Fix result code handling in prom_init
prom_init(), the trampoline code that "talks" to Open Firmware during
early boot, has various issues with managing OF result codes. Some of my
recent fixups in fact made the problem worse on some platforms.
This patch reworks it all. Tested on g5, Maple, POWER3 and POWER5.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Peter Chubb [Wed, 1 Jun 2005 05:37:00 +0000 (22:37 -0700)]
[IA64] fix compilation warning in sys32_epoll_wait()
This gets rid of an unused variable `error' in sys_ia32.c:sys32_epoll_wait()
Getting rid of this one makes parsing the output of the kernecomp
autobuild easier --- searching for `Error' to find a problem kept
hitting this one, even though it's only a warning.
This cleans up the /proc/device-tree representation of the Open Firmware
device-tree on ppc and ppc64. It does the following things:
- Workaround an issue in some Apple device-trees where a property may
exist with the same name as a child node of the parent. We now
simply "drop" the property instead of creating duplicate entries in
/proc with random result...
- Do not try to chop off the "@0" at the end of a node name whose unit
address is 0. This is not useful, inconsistent, and the code was
buggy and didn't always work anyway.
- Do not create symlinks for the short name and unit address parts of a
node. These were never really used, bloated the memory footprint of
the device-tree with useless struct proc_dir_entry and their matching
dentry and inode cache bloat.
This results in smaller code, smaller memory footprint, and a more
accurate view of the tree presented to userland.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Apple's Open Firmware has a funny bug when creating the /cpus nodes
where it leaves a dangling '\0' character in the CPU name which ends up
appearing in the full path of the node. This is bogus and
confuses /proc/device-tree badly.
This patch strips those bogus zero's from the node full path when
reading the device-tree from Open Firmware. The "name" property is not
modified and still contains the spurrious 0 (it basically contains 0
tailing 0 instead of one) but that shouldn't be a problem.
An equivalent patch for ppc32 will follow shortly
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Dmitry Torokhov [Wed, 1 Jun 2005 07:39:51 +0000 (02:39 -0500)]
Input: add ps2_drain() to libps2 to allow reading and discarding
given number of bytes from device. Change ps2_command to
allow using 0 as command ID and actually pass it to the
device instead of working as a drain.
Dmitry Torokhov [Wed, 1 Jun 2005 07:39:44 +0000 (02:39 -0500)]
Input: pmouse - introduce proper locking so state-changing
operations do not iterfere with each other.
Also make sure that serio core takes serio->drv_sem
not only for connect/disconnect but for reconnect
too.
Luke Kosewski [Wed, 1 Jun 2005 07:39:28 +0000 (02:39 -0500)]
Input: do not corrupt system-wide procfs fops.
entry->proc_fops is a pointer to struct file_operations. When we
call create_proc_entry(...), it pointis to proc_file_operations,
deep in fs/proc/generic.c. By adding a 'poll' member to this struct
we effectively force the 'poll' member on every file in /proc,
which is wrong (they all fail select(...) calls).
This patch changes a copy of entry->proc_fops and reassigns it rather
than changing the original member.
Ian Campbell [Wed, 1 Jun 2005 07:39:25 +0000 (02:39 -0500)]
Input: return correct value when setting up absolute device via uinipt.
uinput_alloc_device() is supposed to return the number of bytes read,
the value is returned to uinput_write() and from there to userspace. If
EV_ABS is set then it returns the value from uinput_validate_absbits()
instead, which is zero when everything is ok instead of the count.
Input: ALPS - fix forward/back buttons on Ahtec laptop.
I have an Ahtec laptop with a ALPS GlidePoint device, with 4 buttons.
With Linux hernel 2.6.12rc4 and rc5 I'm unable to use the vertical
scroll buttons (BACK and FORWARD).
BACK gets detected as BTN_MIDDLE and FORWARD is undetected.
I've modified the drivers/input/mouse/alps.c from 2.6.12rc5 and now it
works fine!
Dmitry Torokhov [Wed, 1 Jun 2005 07:38:53 +0000 (02:38 -0500)]
Input: make sure that joystick support in CMPCI driver can only be
selected if either gameport is built-in or _both_ gameport
and cmpci are built as modules.
Changes to the cpufreq stats driver:
* Changes the way P-state transition table looks in /sysfs providing more
clear output
* Changes the time unit in the output from HZ to clock_t
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
Here is a change of policy for the ondemand governor. The modification
concerns the frequency downscaling. Instead of decreasing to a lower
frequency when the CPU usage is under 20%, this new policy automatically
scales to the optimal frequency. The optimal frequency being the lowest
frequency which provides enough power to not trigger the upscaling policy.
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
Ondemand and conservative governor clean-up, it factorises the idle ticks
measurement.
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
Dave Jones [Wed, 1 Jun 2005 02:03:49 +0000 (19:03 -0700)]
[CPUFREQ] ondemand,conservative governor store the idle ticks for all cpus
[PATCH] [2/5] ondemand,conservative governor store the idle ticks for all cpus
Ondemand, conservative governor did not store prev_cpu_idle_up into
prev_cpu_idle_down for other CPUs than the current CPU.
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
Dave Jones [Wed, 1 Jun 2005 02:03:47 +0000 (19:03 -0700)]
[CPUFREQ] Conservative cpufreq governer
A new cpufreq module, based on the ondemand one with my additional patches
just posted. This one is more suitable for battery environments where its
probably more appealing to have the cpu freq gracefully increase and decrease
rather than flip between the min and max freq's.
N.B. Bruno Ducrot pointed out that the amd64's "do have unacceptable latency
between min and max freq transition, due to the step-by-step requirements
(200MHz IIRC)"; so AMD64 users would probably benefit from this too.
Signed-off-by: Alexander Clouter <alex-kernel@digriz.org.uk> Signed-off-by: Dave Jones <davej@redhat.com>
Dave Jones [Wed, 1 Jun 2005 02:03:46 +0000 (19:03 -0700)]
[CPUFREQ] dual-core powernow-k8
With the release of the dual-core AMD Opterons last week,
it's high time that cpufreq supported them. The attached
patch applies cleanly to 2.6.12-rc3 and updates powernow-k8
to support the latest Athlon 64 and Opteron processors.
Update the driver to version 1.40.0 and provide support
for dual-core processors.
Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com> Signed-off-by: Dave Jones <davej@redhat.com>
Dave Jones [Wed, 1 Jun 2005 02:03:45 +0000 (19:03 -0700)]
[CPUFREQ] Recalibrate cpu_khz [1/2]
We have to recalibrate cpu_khz in order to use the current FID instead the max
FID since some BIOS do not put the processor at maximum frequency at POST.
Also, some BIOS will change the processor frequency at our back after cpu_khz
was calibrate. Finally, this will fix a long standing bug when we do
something like this:
# rmmod powernow-k7
# modprobe powernow-k7
Signed-off-by: Bruno Ducrot <ducrot@poupinou.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Jones <davej@redhat.com>
Dave Jones [Wed, 1 Jun 2005 02:03:44 +0000 (19:03 -0700)]
[CPUFREQ] speedstep-smi: it works on at least one P4M
The speedstep-smi driver actually works on >=1 notebook with a
Pentium 4-M CPU where all other cpufreq drivers fail. Therefore,
allow speedstep-smi on P4Ms again, but warn users of likely failure
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Dave Jones <davej@redhat.com>
Dave Jones [Wed, 1 Jun 2005 02:03:44 +0000 (19:03 -0700)]
[CPUFREQ] ondemand: trivial clean-ups
Trivial ondemand governor clean-ups:
- change from sampling_rate_in_HZ() to the official function
usecs_to_jiffies().
- use for_each_online_cpu() to instead of using "if (cpu_online(i))"
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Dave Jones <davej@redhat.com>