linux-2.6
15 years ago[watchdog] hpwdt: fix use of inline assembly
Linus Torvalds [Fri, 20 Jun 2008 19:19:28 +0000 (12:19 -0700)] 
[watchdog] hpwdt: fix use of inline assembly

The inline assembly in drivers/watchdog/hpwdt.c was incredibly broken,
and included all the function prologue and epilogue stuff, even though
it was itself then inside a C function where the compiler would add its
own prologue and epilogue on top of it all.

This then just _happened_ to work if you had exactly the right compiler
version and exactly the right compiler flags, so that gcc just happened
to not create any prologue at all (the gcc-generated epilogue wouldn't
matter, since it would never be reached).

But the more proper way to fix it is to simply not do this.  Move the
inline asm to the top level, with no surrounding function at all (the
better alternative would be to remove the prologue and make it actually
use proper description of the arguments to the inline asm, but that's a
bigger change than the one I'm willing to make right now).

Tested-by: S.Çağlar Onur <caglar@pardus.org.tr>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years ago[IA64] SN2: security hole in sn2_ptc_proc_write
Cliff Wickman [Fri, 20 Jun 2008 19:02:00 +0000 (12:02 -0700)] 
[IA64] SN2: security hole in sn2_ptc_proc_write

Security hole in sn2_ptc_proc_write

It is possible to overrun a buffer with a write to this /proc file.

Signed-off-by: Cliff Wickman <cpw@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
15 years agoBAST: Remove old IDE driver
Ben Dooks [Fri, 20 Jun 2008 18:53:35 +0000 (20:53 +0200)] 
BAST: Remove old IDE driver

Remove the old BAST IDE driver, as we are now using the platform-pata
support.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agopcmcia ide kingston compactflash's have a new manufacturer id
Christophe Niclaes [Fri, 20 Jun 2008 18:53:34 +0000 (20:53 +0200)] 
pcmcia ide kingston compactflash's have a new manufacturer id

Up to now, Kingston compactflash cards (ab)used the Toshiba Manufacturer's ID,
In their new CF cards, they use a new one.  Let's the ide subsystem
recognize CF cards with the new id.

Signed-off-by: Christophe Niclaes <cniclaes@develtech.com>
Acked-by: Philippe De Muyter <phdm@macqel.be>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agopcmcia: add another pata/ide ID
Kristoffer Ericson [Fri, 20 Jun 2008 18:53:34 +0000 (20:53 +0200)] 
pcmcia: add another pata/ide ID

Addition of Transcend 1GB 45x id so that it is properly detected.

[bart: fix typo in ide-cs's ID spotted by Alan Cox]

Signed-off-by: William Peters <w1ll14@gmail.com>
Signed-off-by: Kristoffer Ericson <Kristoffer_e1@hotmail.com>
CC: Alan Cox <alan@lxorguk.ukuu.org.uk>
CC: linux-ide@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agopcmcia: add an pata/ide ID
Matt Reimer [Fri, 20 Jun 2008 18:53:34 +0000 (20:53 +0200)] 
pcmcia: add an pata/ide ID

Add an id for:

product info: "M-Systems", "CF300", ""
manfid: 0x000a, 0x0000
function: 4 (fixed disk)

Signed-off-by: Matt Reimer <mreimer@vpop.net>
CC: Alan Cox <alan@lxorguk.ukuu.org.uk>
CC: linux-ide@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: increase timeout in wait_drive_not_busy()
Bartlomiej Zolnierkiewicz [Fri, 20 Jun 2008 18:53:33 +0000 (20:53 +0200)] 
ide: increase timeout in wait_drive_not_busy()

Some ATAPI devices take longer than the current max timeout value to
become ready (i.e. TEAC DV-W28ECW takes 6 ms) so increase the timeout
value to 10 ms.

This fixes kernel.org bugzilla bug #10887:
http://bugzilla.kernel.org/show_bug.cgi?id=10887

Reported-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agopalm_bk3710: fix resource management
Sergei Shtylyov [Fri, 20 Jun 2008 18:53:32 +0000 (20:53 +0200)] 
palm_bk3710: fix resource management

The driver expected a *virtual* address in the IDE platform device's memory
resource and didn't request the memory region for the register block. Fix this
taking into account the fact that DaVinci SoC devices are fixed-mapped to the
virtual memory early and we can get their virtual addresses using IO_ADDRESS()
macro, not having to call ioremap()...

While at it, also do some cosmetic changes...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoReinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP
Linus Torvalds [Fri, 20 Jun 2008 18:18:25 +0000 (11:18 -0700)] 
Reinstate ZERO_PAGE optimization in 'get_user_pages()' and fix XIP

KAMEZAWA Hiroyuki and Oleg Nesterov point out that since the commit
557ed1fa2620dc119adb86b34c614e152a629a80 ("remove ZERO_PAGE") removed
the ZERO_PAGE from the VM mappings, any users of get_user_pages() will
generally now populate the VM with real empty pages needlessly.

We used to get the ZERO_PAGE when we did the "handle_mm_fault()", but
since fault handling no longer uses ZERO_PAGE for new anonymous pages,
we now need to handle that special case in follow_page() instead.

In particular, the removal of ZERO_PAGE effectively removed the core
file writing optimization where we would skip writing pages that had not
been populated at all, and increased memory pressure a lot by allocating
all those useless newly zeroed pages.

This reinstates the optimization by making the unmapped PTE case the
same as for a non-existent page table, which already did this correctly.

While at it, this also fixes the XIP case for follow_page(), where the
caller could not differentiate between the case of a page that simply
could not be used (because it had no "struct page" associated with it)
and a page that just wasn't mapped.

We do that by simply returning an error pointer for pages that could not
be turned into a "struct page *".  The error is arbitrarily picked to be
EFAULT, since that was what get_user_pages() already used for the
equivalent IO-mapped page case.

[ Also removed an impossible test for pte_offset_map_lock() failing:
  that's not how that function works ]

Acked-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Nick Piggin <npiggin@suse.de>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoExt4: Fix online resize block group descriptor corruption
Frederic Bohe [Fri, 20 Jun 2008 15:48:48 +0000 (11:48 -0400)] 
Ext4: Fix online resize block group descriptor corruption

This is the patch for the group descriptor table corruption during
online resize pointed out by Theodore Tso.  The problem was caused by
the fact that the ext4 group descriptor can be either 32 or 64 bytes
long.  Only the 64 bytes structure was taken into account.

Signed-off-by: Frederic Bohe <frederic.bohe@bull.net>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agosched: refactor wait_for_completion_timeout()
Oleg Nesterov [Fri, 20 Jun 2008 14:32:20 +0000 (18:32 +0400)] 
sched: refactor wait_for_completion_timeout()

Simplify the code and fix the boundary condition of
wait_for_completion_timeout(,0).

We can kill the first __remove_wait_queue() as well.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
15 years agoxen: don't drop NX bit
Jeremy Fitzhardinge [Mon, 16 Jun 2008 22:01:56 +0000 (15:01 -0700)] 
xen: don't drop NX bit

Because NX is now enforced properly, we must put the hypercall page
into the .text segment so that it is executable.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stable Kernel <stable@kernel.org>
Cc: the arch/x86 maintainers <x86@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoxen: mask unwanted pte bits in __supported_pte_mask
Jeremy Fitzhardinge [Mon, 16 Jun 2008 22:01:53 +0000 (15:01 -0700)] 
xen: mask unwanted pte bits in __supported_pte_mask

[ Stable: this isn't a bugfix in itself, but it's a pre-requiste
  for "xen: don't drop NX bit" ]

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stable Kernel <stable@kernel.org>
Cc: the arch/x86 maintainers <x86@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoxen: Use wmb instead of rmb in xen_evtchn_do_upcall().
Isaku Yamahata [Mon, 16 Jun 2008 21:58:13 +0000 (14:58 -0700)] 
xen: Use wmb instead of rmb in xen_evtchn_do_upcall().

This patch is ported one from 534:77db69c38249 of linux-2.6.18-xen.hg.
Use wmb instead of rmb to enforce ordering between
evtchn_upcall_pending and evtchn_pending_sel stores
in xen_evtchn_do_upcall().

Cc: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: the arch/x86 maintainers <x86@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: fix NULL pointer deref in __switch_to
Suresh Siddha [Thu, 19 Jun 2008 16:41:22 +0000 (09:41 -0700)] 
x86: fix NULL pointer deref in __switch_to

I am able to reproduce the oops reported by Simon in __switch_to() with
lguest.

My debug showed that there is at least one lguest specific
issue (which should be present in 2.6.25 and before aswell) and it got
exposed with a kernel oops with the recent fpu dynamic allocation patches.

In addition to the previous possible scenario (with fpu_counter), in the
presence of lguest, it is possible that the cpu's TS bit it still set and the
lguest launcher task's thread_info has TS_USEDFPU still set.

This is because of the way the lguest launcher handling the guest's TS bit.
(look at lguest_set_ts() in lguest_arch_run_guest()). This can result
in a DNA fault while doing unlazy_fpu() in __switch_to(). This will
end up causing a DNA fault in the context of new process thats
getting context switched in (as opossed to handling DNA fault in the context
of lguest launcher/helper process).

This is wrong in both pre and post 2.6.25 kernels. In the recent
2.6.26-rc series, this is showing up as NULL pointer dereferences or
sleeping function called from atomic context(__switch_to()), as
we free and dynamically allocate the FPU context for the newly
created threads. Older kernels might show some FPU corruption for processes
running inside of lguest.

With the appended patch, my test system is running for more than 50 mins
now. So atleast some of your oops (hopefully all!) should get fixed.
Please give it a try. I will spend more time with this fix tomorrow.

Reported-by: Simon Holm Thøgersen <odie@cs.aau.dk>
Reported-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agosched: fix wait_for_completion_timeout() spurious failure under heavy load
Roland Dreier [Thu, 19 Jun 2008 22:04:07 +0000 (15:04 -0700)] 
sched: fix wait_for_completion_timeout() spurious failure under heavy load

It seems that the current implementaton of wait_for_completion_timeout()
has a small problem under very high load for the common pattern:

if (!wait_for_completion_timeout(&done, timeout))
/* handle failure */

because the implementation very roughly does (lots of code deleted to
show the basic flow):

static inline long __sched
do_wait_for_common(struct completion *x, long timeout, int state)
{
if (x->done)
return timeout;

do {
timeout = schedule_timeout(timeout);

if (!timeout)
return timeout;

} while (!x->done);

return timeout;
}

so if the system is very busy and x->done is not set when
do_wait_for_common() is entered, it is possible that the first call to
schedule_timeout() returns 0 because the task doing wait_for_completion
doesn't get rescheduled for a long time, even if it is woken up early
enough.

In this case, wait_for_completion_timeout() returns 0 without even
checking x->done again, and the code above falls into its failure case
purely for scheduler reasons, even if the hardware event or whatever was
being waited for happened early enough.

It would make sense to add an extra test to do_wait_for() in the timeout
case and return 1 if x->done is actually set.

A quick audit (not exhaustive) of wait_for_completion_timeout() callers
seems to indicate that no one actually cares about the return value in
the success case -- they just test for 0 (timed out) versus non-zero
(wait succeeded).

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agosched: rt: dont stop the period timer when there are tasks wanting to run
Peter Zijlstra [Thu, 19 Jun 2008 12:22:28 +0000 (14:22 +0200)] 
sched: rt: dont stop the period timer when there are tasks wanting to run

So if the group ever gets throttled, it will never wake up again.

Reported-by: "Daniel K." <dk@uw.no>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Tested-by: Daniel K. <dk@uw.no>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoMerge branch 'bugzilla-9761' into release
Len Brown [Fri, 20 Jun 2008 06:47:16 +0000 (02:47 -0400)] 
Merge branch 'bugzilla-9761' into release

15 years agoMerge branch 'bugzilla-10695' into release
Len Brown [Fri, 20 Jun 2008 06:45:05 +0000 (02:45 -0400)] 
Merge branch 'bugzilla-10695' into release

15 years agodrm: only trust core drm ioctls - driver ioctls are a mess.
Dave Airlie [Fri, 20 Jun 2008 05:42:38 +0000 (15:42 +1000)] 
drm: only trust core drm ioctls - driver ioctls are a mess.

So driver ioctls need a full auditing before we can make this change.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/i915: add support for Intel series 4 chipsets.
Zhenyu Wang [Fri, 20 Jun 2008 02:12:56 +0000 (12:12 +1000)] 
drm/i915: add support for Intel series 4 chipsets.

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years ago[agp]: fixup chipset flush for new Intel G4x.
Zhenyu Wang [Fri, 20 Jun 2008 01:48:06 +0000 (11:48 +1000)] 
[agp]: fixup chipset flush for new Intel G4x.

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoipv6: Drop packets for loopback address from outside of the box.
YOSHIFUJI Hideaki [Thu, 19 Jun 2008 23:33:57 +0000 (16:33 -0700)] 
ipv6: Drop packets for loopback address from outside of the box.

[ Based upon original report and patch by Karsten Keil.  Karsten
  has verified that this fixes the TAHI test case "ICMPv6 test
  v6LC.5.1.2 Part F". -DaveM ]

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv6: Remove options header when setsockopt's optlen is 0
Shan Wei [Thu, 19 Jun 2008 23:29:39 +0000 (16:29 -0700)] 
ipv6: Remove options header when setsockopt's optlen is 0

Remove the sticky Hop-by-Hop options header by calling setsockopt()
for IPV6_HOPOPTS with a zero option length, per RFC3542.

Routing header and Destination options header does the same as
Hop-by-Hop options header.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agox86, geode: add a VSA2 ID for General Software
Jordan Crouse [Wed, 18 Jun 2008 17:34:38 +0000 (11:34 -0600)] 
x86, geode: add a VSA2 ID for General Software

General Software writes their own VSA2 module for their version
of the Geode BIOS, which returns a different ID then the standard
VSA2.  This was causing the framebuffer driver to break for most
GSW boards.

Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Cc: tglx@linutronix.de
Cc: linux-geode@lists.infradead.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agosched, delay accounting: fix incorrect delay time when constantly waiting on runqueue
Bharath Ravi [Mon, 16 Jun 2008 09:41:01 +0000 (15:11 +0530)] 
sched, delay accounting: fix incorrect delay time when constantly waiting on runqueue

This patch corrects the incorrect value of per process run-queue wait
time reported by delay statistics. The anomaly was due to the following
reason. When a process leaves the CPU and immediately starts waiting for
CPU on the runqueue (which means it remains in the TASK_RUNNABLE state),
the time of re-entry into the run-queue is never recorded. Due to this,
the waiting time on the runqueue from this point of re-entry upto the
next time it hits the CPU is not accounted for. This is solved by
recording the time of re-entry of a process leaving the CPU in the
sched_info_depart() function IF the process will go back to waiting on
the run-queue. This IF condition is verified by checking whether the
process is still in the TASK_RUNNABLE state.

The patch was tested on 2.6.26-rc6 using two simple CPU hog programs.
The values noted prior to the fix did not account for the time spent on
the runqueue waiting. After the fix, the correct values were reported
back to user space.

Signed-off-by: Bharath Ravi <bharathravi1@gmail.com>
Signed-off-by: Madhava K R <madhavakr@gmail.com>
Cc: dhaval@linux.vnet.ibm.com
Cc: vatsa@in.ibm.com
Cc: balbir@in.ibm.com
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agohwmon: (lm75) sensor reading bugfix
David Brownell [Sun, 4 May 2008 02:19:16 +0000 (19:19 -0700)] 
hwmon: (lm75) sensor reading bugfix

LM75 sensor reading bugfix: never save error status as valid
sensor output.  This could be improved, but at least this
prevents certain rude failure modes.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
15 years agohwmon: (abituguru3) update driver detection
Hans de Goede [Fri, 23 May 2008 14:10:41 +0000 (16:10 +0200)] 
hwmon: (abituguru3) update driver detection

It has been reported that the abituguru3 driver fails to load after a BIOS
update. This patch fixes this by loosening the detection routine so that it
will work after the BIOS update too. To compensate for the now very loose
detection an additional check is added on the DMI Base Board vendor string to
make sure we only load on Abit motherboards, this is the same as the check in
the abituguru (1 / 2) driver.

Signed-of-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: Alistair John Strachan <alistair@devzero.co.uk>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
15 years agohwmon: (w83791d) new maintainer
Marc Hulsman [Sun, 8 Jun 2008 14:59:41 +0000 (10:59 -0400)] 
hwmon: (w83791d) new maintainer

Signed-off-by: Charles Spirakis <bezaur@gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
15 years agohwmon: (abituguru3) Identify Abit AW8D board as such
Hans de Goede [Tue, 26 Feb 2008 18:34:48 +0000 (19:34 +0100)] 
hwmon: (abituguru3) Identify Abit AW8D board as such

This patch identifies the Abit AW8D board as such, and adds support for its
aux5 fan connector

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
15 years agohwmon: Update the sysfs interface documentation
Jean Delvare [Sat, 23 Feb 2008 09:57:53 +0000 (10:57 +0100)] 
hwmon: Update the sysfs interface documentation

* Document the characteristics of libsensors 3.0.0 and 3.0.1.
* The sysfs interface is no longer subject to changes.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Juerg Haefliger <juergh at gmail.com>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
15 years agohwmon: (adt7473) Initialize max_duty_at_overheat before use
Jean Delvare [Sat, 26 Apr 2008 14:34:26 +0000 (16:34 +0200)] 
hwmon: (adt7473) Initialize max_duty_at_overheat before use

data->max_duty_at_overheat is not updated in adt7473_update_device,
so it might be used before it is initialized (if the user reads from
sysfs file max_duty_at_crit before writing to it.)

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
15 years agohwmon: (lm85) Fix function RANGE_TO_REG()
Jean Delvare [Thu, 3 Apr 2008 08:40:39 +0000 (10:40 +0200)] 
hwmon: (lm85) Fix function RANGE_TO_REG()

Function RANGE_TO_REG() is broken. For a requested range of 2000 (2
degrees C), it will return an index value of 15, i.e. 80.0 degrees C,
instead of the expected index value of 0. All other values are handled
properly, just 2000 isn't.

The bug was introduced back in November 2004 by this patch:
http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commit;h=1c28d80f1992240373099d863e4996cdd5d646d0

While this can be fixed easily with the current code, I'd rather
rewrite the whole function in a way which is more obviously correct.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Justin Thiessen <jthiessen@penguincomputing.com>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
15 years agoBlackfin Serial Driver: Use timer to poll CTS PIN instead of workqueue.
Sonic Zhang [Thu, 19 Jun 2008 09:46:39 +0000 (17:46 +0800)] 
Blackfin Serial Driver: Use timer to poll CTS PIN instead of workqueue.

This allows other threads to run when the serial driver polls the CTS
PIN in a loop.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
15 years agoBlackfin arch: fix typo error in bf548 serial header file
Sonic Zhang [Thu, 19 Jun 2008 09:07:15 +0000 (17:07 +0800)] 
Blackfin arch: fix typo error in bf548 serial header file

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
15 years agox86: use BOOTMEM_EXCLUSIVE on 32-bit
Bernhard Walle [Sun, 8 Jun 2008 14:16:07 +0000 (16:16 +0200)] 
x86: use BOOTMEM_EXCLUSIVE on 32-bit

This patch uses the BOOTMEM_EXCLUSIVE for crashkernel reservation also for
i386 and prints a error message on failure.

The patch is still for 2.6.26 since it is only bug fixing. The unification
of reserve_crashkernel() between i386 and x86_64 should be done for 2.6.27.

Signed-off-by: Bernhard Walle <bwalle@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: <stable@kernel.org>
15 years agox86, 32-bit: fix boot failure on TSC-less processors
Mikael Pettersson [Sun, 15 Jun 2008 00:19:56 +0000 (02:19 +0200)] 
x86, 32-bit: fix boot failure on TSC-less processors

Booting 2.6.26-rc6 on my 486 DX/4 fails with a "BUG: Int 6"
(invalid opcode) and a kernel halt immediately after the
kernel has been uncompressed. The BUG shows EIP pointing
to an rdtsc instruction in native_read_tsc(), invoked from
native_sched_clock().

(This error occurs so early that not even the serial console
can capture it.)

A bisection showed that this bug first occurs in 2.6.26-rc3-git7,
via commit 9ccc906c97e34fd91dc6aaf5b69b52d824386910:

>x86: distangle user disabled TSC from unstable
>
>tsc_enabled is set to 0 from the command line switch "notsc" and from
>the mark_tsc_unstable code. Seperate those functionalities and replace
>tsc_enable with tsc_disable. This makes also the native_sched_clock()
>decision when to use TSC understandable.
>
>Preparatory patch to solve the sched_clock() issue on 32 bit.
>
>Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

The core reason for this bug is that native_sched_clock() gets
called before tsc_init().

Before the commit above, tsc_32.c used a "tsc_enabled" variable
which defaulted to 0 == disabled, and which only got enabled late
in tsc_init(). Thus early calls to native_sched_clock() would skip
the TSC and use jiffies instead.

After the commit above, tsc_32.c uses a "tsc_disabled" variable
which defaults to 0, meaning that the TSC is Ok to use. Early calls
to native_sched_clock() now erroneously try to use the TSC on
!cpu_has_tsc processors, leading to invalid opcode exceptions.

My proposed fix is to initialise tsc_disabled to a "soft disabled"
state distinct from the hard disabled state set up by the "notsc"
kernel option. This fixes the native_sched_clock() problem. It also
allows tsc_init() to be simplified: instead of setting tsc_disabled = 1
on every error return, we just set tsc_disabled = 0 once when all
checks have succeeded.

I've verified that this lets my 486 boot again. I've also verified
that a Core2 machine still uses the TSC as clocksource after the patch.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: fix NULL pointer deref in __switch_to
Suresh Siddha [Fri, 13 Jun 2008 22:47:12 +0000 (15:47 -0700)] 
x86: fix NULL pointer deref in __switch_to

Patrick McHardy reported a crash:

> > I get this oops once a day, its apparently triggered by something
> > run by cron, but the process is a different one each time.
> >
> > Kernel is -git from yesterday shortly before the -rc6 release
> > (last commit is the usb-2.6 merge, the x86 patches are missing),
> > .config is attached.
> >
> > I'll retry with current -git, but the patches that have gone in
> > since I last updated don't look related.
> >
> > [62060.043009] BUG: unable to handle kernel NULL pointer dereference at
> > 000001ff
> > [62060.043009] IP: [<c0102a9b>] __switch_to+0x2f/0x118
> > [62060.043009] *pde = 00000000
> > [62060.043009] Oops: 0002 [#1] PREEMPT

Vegard Nossum analyzed it:

> This decodes to
>
>    0:   0f ae 00                fxsave (%eax)
>
> so it's related to the floating-point context. This is the exact
> location of the crash:
>
> $ addr2line -e arch/x86/kernel/process_32.o -i ab0
> include/asm/i387.h:232
> include/asm/i387.h:262
> arch/x86/kernel/process_32.c:595
>
> ...so it looks like prev_task->thread.xstate->fxsave has become NULL.
> Or maybe it never had any other value.

Somehow (as described below) TS_USEDFPU is set but the fpu is not
allocated or freed.

Another possible FPU pre-emption issue with the sleazy FPU optimization
which was benign before but not so anymore, with the dynamic FPU allocation
patch.

New task is getting exec'd and it is prempted at the below point.

flush_thread() {
...
/*
* Forget coprocessor state..
*/
clear_fpu(tsk);
<----- Preemption point
clear_used_math();
...
}

Now when it context switches in again, as the used_math() is still set
and fpu_counter can be > 5, we will do a math_state_restore() which sets
the task's TS_USEDFPU. After it continues from the above preemption point
it does clear_used_math() and much later free_thread_xstate().

Now, at the next context switch, it is quite possible that xstate is
null, used_math() is not set and TS_USEDFPU is still set. This will
trigger unlazy_fpu() causing kernel oops.

Fix this  by clearing tsk's fpu_counter before clearing task's fpu.

Reported-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: set PAE PHYSICAL_MASK_SHIFT to 44 bits.
Jeremy Fitzhardinge [Fri, 6 Jun 2008 09:21:39 +0000 (10:21 +0100)] 
x86: set PAE PHYSICAL_MASK_SHIFT to 44 bits.

When a 64-bit x86 processor runs in 32-bit PAE mode, a pte can
potentially have the same number of physical address bits as the
64-bit host ("Enhanced Legacy PAE Paging").  This means, in theory,
we could have up to 52 bits of physical address in a pte.

The 32-bit kernel uses a 32-bit unsigned long to represent a pfn.
This means that it can only represent physical addresses up to 32+12=44
bits wide.  Rather than widening pfns everywhere, just set 2^44 as the
Linux x86_32-PAE architectural limit for physical address size.

This is a bugfix for two cases:
1. running a 32-bit PAE kernel on a machine with
  more than 64GB RAM.
2. running a 32-bit PAE Xen guest on a host machine with
  more than 64GB RAM

In both cases, a pte could need to have more than 36 bits of physical,
and masking it to 36-bits will cause fairly severe havoc.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Jan Beulich <jbeulich@novell.com>
Cc: <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agosoftlockup: fix NMI hangs due to lock race - 2.6.26-rc regression
Jason Wessel [Tue, 27 May 2008 17:23:29 +0000 (12:23 -0500)] 
softlockup: fix NMI hangs due to lock race - 2.6.26-rc regression

The touch_nmi_watchdog() routine on x86 ultimately calls
touch_softlockup_watchdog().  The problem is that to touch the
softlockup watchdog, the cpu_clock code has to be called which could
involve multiple cpu locks and can lead to a hard hang if one of the
locks is held by a processor that is not going to return anytime soon
(such as could be the case with kgdb or perhaps even with some other
kind of exception).

This patch causes the public version of the
touch_softlockup_watchdog() to defer the cpu clock access to a later
point.

The test case for this problem is to use the following kernel config
options:

CONFIG_KGDB_TESTS=y
CONFIG_KGDB_TESTS_ON_BOOT=y
CONFIG_KGDB_TESTS_BOOT_STRING="V1F100I100000"

It should be noted that kgdb test suite and these options were not
available until 2.6.26-rc2, so it was necessary to patch the kgdb
test suite during the bisection.

I would consider this patch a regression fix because the problem first
appeared in commit 27ec4407790d075c325e1f4da0a19c56953cce23 when some
logic was added to try to periodically sync the clocks.  It was
possible to work around this particular problem by simply not
performing the sync anytime the system was in a critical context.
This was ok until commit 3e51f33fcc7f55e6df25d15b55ed10c8b4da84cd,
which added config option CONFIG_HAVE_UNSTABLE_SCHED_CLOCK and some
multi-cpu locks to sync the clocks.  It became clear that accessing
this code from an nmi was the source of the lockups.  Avoiding the
access to the low level clock code from an code inside the NMI
processing also fixed the problem with the 27ec44... commit.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agorcupreempt: remove export of rcu_batches_completed_bh
Steven Rostedt [Thu, 22 May 2008 18:18:17 +0000 (14:18 -0400)] 
rcupreempt: remove export of rcu_batches_completed_bh

In rcupreempt, rcu_batches_completed_bh is defined as a static inline in
the header file. This does not need to be exported, and not only that,
this breaks my PPC build.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: paulus@samba.org
Cc: linuxppc-dev@ozlabs.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
15 years agocpuset: limit the input of cpuset.sched_relax_domain_level
Li Zefan [Tue, 13 May 2008 02:27:17 +0000 (10:27 +0800)] 
cpuset: limit the input of cpuset.sched_relax_domain_level

We allow the inputs to be [-1 ... SD_LV_MAX), and return -EINVAL
for inputs outside this range.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Acked-by: Paul Jackson <pj@sgi.com>
Acked-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
15 years agoMerge branch 'linus' into sched/urgent
Ingo Molnar [Thu, 19 Jun 2008 07:37:31 +0000 (09:37 +0200)] 
Merge branch 'linus' into sched/urgent

15 years agosched: CPU hotplug events must not destroy scheduler domains created by the cpusets
Max Krasnyansky [Thu, 29 May 2008 18:17:01 +0000 (11:17 -0700)] 
sched: CPU hotplug events must not destroy scheduler domains created by the cpusets

First issue is not related to the cpusets. We're simply leaking doms_cur.
It's allocated in arch_init_sched_domains() which is called for every
hotplug event. So we just keep reallocation doms_cur without freeing it.
I introduced free_sched_domains() function that cleans things up.

Second issue is that sched domains created by the cpusets are
completely destroyed by the CPU hotplug events. For all CPU hotplug
events scheduler attaches all CPUs to the NULL domain and then puts
them all into the single domain thereby destroying domains created
by the cpusets (partition_sched_domains).
The solution is simple, when cpusets are enabled scheduler should not
create default domain and instead let cpusets do that. Which is
exactly what the patch does.

Signed-off-by: Max Krasnyansky <maxk@qualcomm.com>
Cc: pj@sgi.com
Cc: menage@google.com
Cc: rostedt@goodmis.org
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
15 years agosched: rt-group: fix RR buglet
Peter Zijlstra [Thu, 19 Jun 2008 07:06:59 +0000 (09:06 +0200)] 
sched: rt-group: fix RR buglet

In tick_task_rt() we first call update_curr_rt() which can dequeue a runqueue
due to it running out of runtime, and then we try to requeue it, of it also
having exhausted its RR quota. Obviously requeueing something that is no longer
on the runqueue will not have the expected result.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Tested-by: Daniel K. <dk@uw.no>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agosched: rt-group: heirarchy aware throttle
Peter Zijlstra [Thu, 19 Jun 2008 07:06:57 +0000 (09:06 +0200)] 
sched: rt-group: heirarchy aware throttle

The bandwidth throttle code dequeues a group when it runs out of quota, and
re-queues it once the period rolls over and the quota gets refreshed.

Sadly it failed to take the hierarchy into consideration. Share more of the
enqueue/dequeue code with regular task opterations.

Also, some operations like sched_setscheduler() can dequeue/enqueue tasks that
are in throttled runqueues, we should not inadvertly re-enqueue empty runqueues
so check for that.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Tested-by: Daniel K. <dk@uw.no>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agosched: rt-group: fix hierarchy
Peter Zijlstra [Thu, 19 Jun 2008 07:06:56 +0000 (09:06 +0200)] 
sched: rt-group: fix hierarchy

Don't re-set the entity's runqueue to the wrong rq after we've set it
to the right one.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Tested-by: Daniel K. <dk@uw.no>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agosched: NULL pointer dereference while setting sched_rt_period_us
Dario Faggioli [Wed, 18 Jun 2008 07:18:38 +0000 (09:18 +0200)] 
sched: NULL pointer dereference while setting sched_rt_period_us

When CONFIG_RT_GROUP_SCHED and CONFIG_CGROUP_SCHED are enabled, with:

 echo 10000 > /proc/sys/kernel/sched_rt_period_us

We get this:

 BUG: unable to handle kernel NULL pointer dereference at 0000008c
 [  947.682233] IP: [<c0216b72>] __rt_schedulable+0x12/0x160
 [  947.683123] *pde = 00000000=20
 [  947.683782] Oops: 0000 [#1]
 [  947.684307] Modules linked in:
 [  947.684308]
 [  947.684308] Pid: 2359, comm: bash Not tainted (2.6.26-rc6 #8)
 [  947.684308] EIP: 0060:[<c0216b72>] EFLAGS: 00000246 CPU: 0
 [  947.684308] EIP is at __rt_schedulable+0x12/0x160
 [  947.684308] EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX: 00000001
 [  947.684308] ESI: c0521db4 EDI: 00000001 EBP: c6cc9f00 ESP: c6cc9ed0
 [  947.684308]  DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
 [  947.684308] Process bash (pid: 2359, tiÆcc8000 taskÇa54f00=20 task.tiÆcc8000)
 [  947.684308] Stack: c0222790 00000000 080f8c08 c0521db4 c6cc9f00 00000001 00000000 00000000
 [  947.684308]        c6cc9f9c 00000000 c0521db4 00000001 c6cc9f28 c0216d40 00000000 00000000
 [  947.684308]        c6cc9f9c 000f4240 000e7ef0 ffffffff c0521db4 c79dfb60 c6cc9f58 c02af2cc
 [  947.684308] Call Trace:
 [  947.684308]  [<c0222790>] ? do_proc_dointvec_conv+0x0/0x50
 [  947.684308]  [<c0216d40>] ? sched_rt_handler+0x80/0x110
 [  947.684308]  [<c02af2cc>] ? proc_sys_call_handler+0x9c/0xb0
 [  947.684308]  [<c02af2fa>] ? proc_sys_write+0x1a/0x20
 [  947.684308]  [<c0273c36>] ? vfs_write+0x96/0x160
 [  947.684308]  [<c02af2e0>] ? proc_sys_write+0x0/0x20
 [  947.684308]  [<c027423d>] ? sys_write+0x3d/0x70
 [  947.684308]  [<c0202ef5>] ? sysenter_past_esp+0x6a/0x91
 [  947.684308]  =======================
 [  947.684308] Code: 24 04 e8 62 b1 0e 00 89 c7 89 f8 8b 5d f4 8b 75
 f8 8b 7d fc 89 ec 5d c3 90 55 89 e5 57 56 53 83 ec 24 89 45 ec 89 55 e4
 89 4d e8 <8b> b8 8c 00 00 00 85 ff 0f 84 c9 00 00 00 8b 57 24 39 55 e8
 8b
 [  947.684308] EIP: [<c0216b72>] __rt_schedulable+0x12/0x160 SS:ESP  0068:c6cc9ed0

We think the following patch solves the issue.

Signed-off-by: Dario Faggioli <raistlin@linux.it>
Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoagp: brown paper bag patch - put back two lines that got lost
Dave Airlie [Thu, 19 Jun 2008 04:57:31 +0000 (14:57 +1000)] 
agp: brown paper bag patch - put back two lines that got lost

Commit 62c96b9d0917894c164aa3e474a3ff3bca1554ae ("agp/intel: cleanup
some serious whitespace badness") didn't just fix whitespace.  It also
lost two lines.

Noticed by Linus. No more whitespace diffs for me.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoagp: brown paper bag patch - put back the two lines it took out.
Dave Airlie [Thu, 19 Jun 2008 04:57:31 +0000 (14:57 +1000)] 
agp: brown paper bag patch - put back the two lines it took out.

no more whitespace diffs for me.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoMerge branch 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Thu, 19 Jun 2008 04:52:35 +0000 (21:52 -0700)] 
Merge branch 'agp-patches' of git://git./linux/kernel/git/airlied/agp-2.6

* 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6:
  agp/intel: cleanup some serious whitespace badness
  [AGP] intel_agp: Add support for Intel 4 series chipsets
  [AGP] intel_agp: extra stolen mem size available for IGD_GM chipset
  agp: more boolean conversions.
  drivers/char/agp - use bool
  agp: two-stage page destruction issue
  agp/via: fixup pci ids

15 years agoagp/intel: cleanup some serious whitespace badness
Dave Airlie [Thu, 19 Jun 2008 04:27:53 +0000 (14:27 +1000)] 
agp/intel: cleanup some serious whitespace badness

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years ago[AGP] intel_agp: Add support for Intel 4 series chipsets
Zhenyu Wang [Thu, 19 Jun 2008 04:17:58 +0000 (14:17 +1000)] 
[AGP] intel_agp: Add support for Intel 4 series chipsets

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years ago[AGP] intel_agp: extra stolen mem size available for IGD_GM chipset
Zhenyu Wang [Thu, 19 Jun 2008 04:00:37 +0000 (14:00 +1000)] 
[AGP] intel_agp: extra stolen mem size available for IGD_GM chipset

This adds missing stolen memory size detect for IGD_GM, be sure to
detect right size as current X intel driver (2.3.2) which has already
worked out.

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: add hier-z registers for r300 and r500 chipsets
Dave Airlie [Thu, 19 Jun 2008 03:01:58 +0000 (13:01 +1000)] 
drm/radeon: add hier-z registers for r300 and r500 chipsets

15 years agodrm/radeon: use DSTCACHE_CTLSTAT rather than RB2D_DSTCACHE_CTLSTAT
Alex Deucher [Thu, 19 Jun 2008 02:39:23 +0000 (12:39 +1000)] 
drm/radeon: use DSTCACHE_CTLSTAT rather than RB2D_DSTCACHE_CTLSTAT

According to the hw guys, you should use DSTCACHE_CTLSTAT to flush
the 2D dst cache rather than RB2D_DSTCACHE_CTLSTAT.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: switch IGP gart to use radeon_write_agp_base()
Alex Deucher [Thu, 19 Jun 2008 02:38:29 +0000 (12:38 +1000)] 
drm/radeon: switch IGP gart to use radeon_write_agp_base()

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: Restore sw interrupt on resume
Dennis Kasprzyk [Thu, 19 Jun 2008 02:36:55 +0000 (12:36 +1000)] 
drm/radeon: Restore sw interrupt on resume

Fixes performance drop after suspend/resume on some systems.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/r500: add support for AGP based cards.
Dave Airlie [Thu, 19 Jun 2008 01:40:44 +0000 (11:40 +1000)] 
drm/r500: add support for AGP based cards.

AGP registers weren't programmed properly for r500 cards.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: fix texture uploads with large 3d textures (bug 13980)
Roland Scheidegger [Thu, 19 Jun 2008 01:36:04 +0000 (11:36 +1000)] 
drm/radeon: fix texture uploads with large 3d textures (bug 13980)

Texture uploads could hit the blitter coordinate limit, adjust the texture
offset when uploading the pieces. Make sure to check the end address of the
upload too.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: add initial r500 support.
Dave Airlie [Wed, 28 May 2008 03:52:28 +0000 (13:52 +1000)] 
drm/radeon: add initial r500 support.

This contains all the command buffer processing for the r500 cards.
It doesn't yet contain vblank support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: init pipe setup in kernel code.
Alex Deucher [Wed, 28 May 2008 01:57:40 +0000 (11:57 +1000)] 
drm/radeon: init pipe setup in kernel code.

This inits the card pipes in the kernel and lets userspace getparam
the correct setup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: fixup radeon_do_engine_reset
Alex Deucher [Wed, 28 May 2008 01:54:06 +0000 (11:54 +1000)] 
drm/radeon: fixup radeon_do_engine_reset

Cleanup do engine reset for different chip families.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: fix pixcache and purge/cache flushing registers
Alex Deucher [Wed, 28 May 2008 01:51:12 +0000 (11:51 +1000)] 
drm/radeon: fix pixcache and purge/cache flushing registers

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: write AGP_BASE_2 on chips that support it.
Alex Deucher [Wed, 28 May 2008 01:46:36 +0000 (11:46 +1000)] 
drm/radeon: write AGP_BASE_2 on chips that support it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: merge IGP chip setup and fixup RS400 vs RS480 support
Alex Deucher [Wed, 28 May 2008 03:28:59 +0000 (13:28 +1000)] 
drm/radeon: merge IGP chip setup and fixup RS400 vs RS480 support

We only support RS480 (AMD based IGP) at the moment not
RS400 (Intel based IGP) ones.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: IGP clean up register and magic numbers.
Alex Deucher [Wed, 28 May 2008 02:54:16 +0000 (12:54 +1000)] 
drm/radeon: IGP clean up register and magic numbers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/rs690: set base 2 to 0.
Dave Airlie [Wed, 28 May 2008 01:28:27 +0000 (11:28 +1000)] 
drm/rs690: set base 2 to 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/rs690: set all of gart base address.
Dave Airlie [Wed, 28 May 2008 01:27:01 +0000 (11:27 +1000)] 
drm/rs690: set all of gart base address.

Docs state bits 4-11 maps to bits 32-39 of the 40-bit range

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoradeon: add production microcode from AMD
Alex Deucher [Wed, 28 May 2008 01:21:25 +0000 (11:21 +1000)] 
radeon: add production microcode from AMD

This adds production microcode for r100->r500 from AMD.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: pcigart use proper pci map interfaces.
Dave Airlie [Thu, 19 Jun 2008 01:27:23 +0000 (11:27 +1000)] 
drm: pcigart use proper pci map interfaces.

Switch to using more correct pci dma mapping interfaces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoahci: sis can't do PMP
Tejun Heo [Thu, 19 Jun 2008 00:56:58 +0000 (20:56 -0400)] 
ahci: sis can't do PMP

From: Piter PUNK <piterpunk@slackware.com>

SiS AHCIs say they can do PMP but can't and fail detection if SRST w/
pmp==15 is used.  Turn off PMP support.

tj: added patch description, adapted patch to #upstream-fixes and
    renamed board_ahci_sis to board_ahci_nopmp.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agoagp: more boolean conversions.
Dave Airlie [Thu, 19 Jun 2008 00:42:17 +0000 (10:42 +1000)] 
agp: more boolean conversions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoata_piix: add TECRA M4 to broken suspend list
Tejun Heo [Fri, 13 Jun 2008 09:05:02 +0000 (18:05 +0900)] 
ata_piix: add TECRA M4 to broken suspend list

TOSHIBA also used "TECRA M4" in additon to "Tecra M4", add it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agoLIBATA: Add HAVE_PATA_PLATFORM to select PATA_PLATFORM driver
Ben Dooks [Mon, 16 Jun 2008 11:16:26 +0000 (12:16 +0100)] 
LIBATA: Add HAVE_PATA_PLATFORM to select PATA_PLATFORM driver

Add HAVE_PATA_PLATFORM to select the pata platform driver
to ensure that we do not end up with a long 'depends on' list
when other users of this driver turn up.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosata_mv: warn on PIO with multiple DRQs
Mark Lord [Wed, 18 Jun 2008 16:13:02 +0000 (12:13 -0400)] 
sata_mv: warn on PIO with multiple DRQs

Chip errata sometimes prevents reliable use of PIO commands which involve
more than a single DRQ (data request).  In normal operation, libata should
not generate such PIO commands (uses DMA instead), but they could be sent
in via SG_IO from userspace.

A full workaround might be to break up such commands into sequences
of single DRQ ones, but that's just way too complex for something
that doesn't normally happen in real life.

So, allow the attempt (it often works, despite the errata),
but log the event for reference when somebody screams.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosata_mv: enable async_notify for 60x1 Rev.C0 and higher
Mark Lord [Wed, 18 Jun 2008 16:11:16 +0000 (12:11 -0400)] 
sata_mv: enable async_notify for 60x1 Rev.C0 and higher

The early chipsets cannot safely handle Async Notification (AN),
but 6041/6081 chip revision "C0" (and newer) can handle it.

So allow AN for "C0" and higher.

This enables use of hotplug on PMP ports for the 6041/6081 PCI Rev.9 chips.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agolibata: don't check whether to use DMA or not for no data commands
Tejun Heo [Tue, 17 Jun 2008 03:36:26 +0000 (12:36 +0900)] 
libata: don't check whether to use DMA or not for no data commands

There's no reason to check whether to use DMA or not for no data
commands.  Don't do it.  While at it, make local variable using_pio in
atapi_xlat() set iff ATAPI_PROT_PIO is going to be used and rename
ata_check_atapi_dma() to atapi_check_dma() for consistency.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agoahci: jmb361 has only one port
Tejun Heo [Tue, 17 Jun 2008 03:46:30 +0000 (12:46 +0900)] 
ahci: jmb361 has only one port

JMB361 has only one port but reports it has two causing longish probe
failure on the second one.  Quirk it.

Reported by Gajo Petrovic in bz 10911.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Gajo Petrovic <gajo01@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agodrivers/char/agp - use bool
Joe Perches [Wed, 26 Mar 2008 21:10:02 +0000 (14:10 -0700)] 
drivers/char/agp - use bool

Use boolean in AGP instead of having own TRUE/FALSE

--
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoagp: two-stage page destruction issue
Jan Beulich [Wed, 18 Jun 2008 08:28:00 +0000 (09:28 +0100)] 
agp: two-stage page destruction issue

besides it apparently being useful only in 2.6.24 (the changes in 2.6.25
really mean that it could be converted back to a single-stage mechanism),
I'm seeing an issue in Xen Dom0 kernels, which is caused by the calling
of gart_to_virt() in the second stage invocations of the destroy function.
I think that besides this being a real issue with Xen (where
unmap_page_from_agp() is not just a page table attribute change), this
also is invalid from a theoretical perspective: One should not assume that
gart_to_virt() is still valid after unmapping a page. So minimally (keeping
the 2-stage mechanism) a patch like the one below would be needed.

Jan

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoagp/via: fixup pci ids
Greg KH [Wed, 18 Jun 2008 23:52:26 +0000 (09:52 +1000)] 
agp/via: fixup pci ids

add a new PCI ID and remove an old dodgy one, include the explaination
in the commented code so nobody readds later.

(davej also sent the pci id addition).

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Wed, 18 Jun 2008 23:08:59 +0000 (16:08 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/uverbs: Fix check of is_closed flag check in ib_uverbs_async_handler()
  RDMA/nes: Fix off-by-one in nes_reg_user_mr() error path

15 years agomac80211: detect driver tx bugs
Johannes Berg [Wed, 18 Jun 2008 22:39:48 +0000 (15:39 -0700)] 
mac80211: detect driver tx bugs

When a driver rejects a frame in it's ->tx() callback, it must also
stop queues, otherwise mac80211 can go into a loop here. Detect this
situation and abort the loop after five retries, warning about the
driver bug.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoIB/uverbs: Fix check of is_closed flag check in ib_uverbs_async_handler()
Jack Morgenstein [Wed, 18 Jun 2008 22:36:38 +0000 (15:36 -0700)] 
IB/uverbs: Fix check of is_closed flag check in ib_uverbs_async_handler()

Commit 1ae5c187 ("IB/uverbs: Don't store struct file * for event
files") changed the way that closed files are handled in the uverbs
code.  However, after the conversion, is_closed flag is checked
incorrectly in ib_uverbs_async_handler().  As a result, no async
events are ever passed to applications.

Found by: Ronni Zimmerman <ronniz@mellanox.co.il>

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoieee1394: Kconfig menu touch-up
Stefan Richter [Sun, 15 Jun 2008 23:39:28 +0000 (01:39 +0200)] 
ieee1394: Kconfig menu touch-up

Rename and reorder some prompts and modify some help texts.
The result:

  -------------------- IEEE 1394 (FireWire) support --------------------
  *** Enable only one of the two stacks, unless you know what you are doing ***
  New FireWire stack, EXPERIMENTAL
    OHCI-1394 controllers
    Storage devices (SBP-2 protocol)
  Stable FireWire stack
    OHCI-1394 controllers
    PCILynx controller
    Storage devices (SBP-2 protocol)
      Enable replacement for physical DMA in SBP2
    IP over 1394
    raw1394 userspace interface
    video1394 userspace interface
    dv1394 userspace interface (deprecated)
    Excessive debugging output

The old prompts for reference:

  -------------------- IEEE 1394 (FireWire) support --------------------
  IEEE 1394 (FireWire) support - alternative stack, EXPERIMENTAL
    Support for OHCI FireWire host controllers
    Support for storage devices (SBP-2 protocol driver)
  IEEE 1394 (FireWire) support
    *** Subsystem Options ***
    Excessive debugging output
    *** Controllers ***
    Texas Instruments PCILynx support
    OHCI-1394 support
    *** Protocols ***
    OHCI-1394 Video support
    SBP-2 support (Harddisks etc.)
      Enable replacement for physical DMA in SBP2
    IP over 1394
    OHCI-DV I/O support (deprecated)
    Raw IEEE1394 I/O support

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
15 years agofirewire: Kconfig menu touch-up
Stefan Richter [Sat, 14 Jun 2008 12:24:53 +0000 (14:24 +0200)] 
firewire: Kconfig menu touch-up

Emphasize the recommendation to build only one stack.
Trim the prompts to better fit into short attention spans.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
15 years agofirewire: deadline for PHY config transmission
Stefan Richter [Wed, 18 Jun 2008 16:20:45 +0000 (18:20 +0200)] 
firewire: deadline for PHY config transmission

If the low-level driver failed to initialize a card properly without
noticing it, fw-core was blocked indefinitely when trying to send a
PHY config packet.  This hung up the events kernel thread, e.g. locked
up keyboard input.
https://bugzilla.redhat.com/show_bug.cgi?id=444694
https://bugzilla.redhat.com/show_bug.cgi?id=446763

This problem was introduced between 2.6.25 and 2.6.26-rc1 by commit
2a0a2590498be7b92e3e76409c9b8ee722e23c8f "firewire: wait until PHY
configuration packet was transmitted (fix bus reset loop)".

The solution is to wait with timeout.  I tested it with 7 different
working controllers and 1 non-working controller.  On the working ones,
the packet callback complete()s usually --- but not always --- before a
timeout of 10ms.  Hence I chose a safer timeout of 100ms.

On the few tests with the non-working controller ALi M5271, PHY config
packet transmission always timed out so far.  (Fw-ohci needs to be fixed
for this controller independently of this deadline fix.  Often the core
doesn't even attempt to send a phy config because not even self ID
reception works.)

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
15 years agofirewire: fw-ohci: unify printk prefixes
Stefan Richter [Sat, 14 Jun 2008 12:23:43 +0000 (14:23 +0200)] 
firewire: fw-ohci: unify printk prefixes

The messages which can be enabled by fw-ohci's debug module parameter
are changed from KERN_DEBUG to KERN_NOTICE level and uniformly prefixed
with "firewire_ohci: ".  This further simplifies communication with
users when we ask them to capture debug messages.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
15 years agofirewire: fill_bus_reset_event needs lock protection
Stefan Richter [Fri, 6 Jun 2008 20:11:30 +0000 (22:11 +0200)] 
firewire: fill_bus_reset_event needs lock protection

Callers of fill_bus_reset_event() have to take card->lock.  Otherwise
access to node data may oops if node removal is in progress.

A lockless alternative would be

- event->local_node_id = card->local_node->node_id;
+ tmp = fw_node_get(card->local_node);
+ event->local_node_id = tmp->node_id;
+ fw_node_put(tmp);

and ditto with the other node pointers which fill_bus_reset_event()
accesses.  But I went the locked route because one of the two callers
already holds the lock.  As a bonus, we don't need the memory barrier
anymore because device->generation and device->node_id are written in
a card->lock protected section.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
15 years agofirewire: fw-ohci: write selfIDBufferPtr before LinkControl.rcvSelfID
Stefan Richter [Thu, 5 Jun 2008 18:50:53 +0000 (20:50 +0200)] 
firewire: fw-ohci: write selfIDBufferPtr before LinkControl.rcvSelfID

OHCI 1.1 clause 5.10 requires that selfIDBufferPtr is valid when a 1 is
written into LinkControl.rcvSelfID.

This driver bug has so far not been known to cause harm because most
chips obviously accept a later selfIDBufferPtr write, at least before
HCControl.linkEnable is written.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Jarod Wilson <jwilson@redhat.com>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
15 years agofirewire: fw-ohci: disable PHY packet reception into AR context
Stefan Richter [Thu, 5 Jun 2008 18:49:38 +0000 (20:49 +0200)] 
firewire: fw-ohci: disable PHY packet reception into AR context

We want the rcvPhyPkt bit in LinkControl off before we start using the
chip.  However, the spec says that the reset value of it is undefined.
Hence switch it explicitly off.

https://bugzilla.redhat.com/show_bug.cgi?id=244576#c48 shows that for
example the nForce2 integrated FireWire controller seems to have it on
by default.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Jarod Wilson <jwilson@redhat.com>
15 years agofirewire: fw-ohci: use of uninitialized data in AR handler
Stefan Richter [Sat, 31 May 2008 17:36:06 +0000 (19:36 +0200)] 
firewire: fw-ohci: use of uninitialized data in AR handler

header_length and payload_length are filled with random data if an
unknown tcode was read from the AR buffer (i.e. if the AR buffer
contained invalid data).

We still need a better strategy to recover from this, but at least
handle_ar_packet now doesn't return out of bound buffer addresses
anymore.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
15 years agofirewire: don't panic on invalid AR request buffer
Stefan Richter [Sat, 31 May 2008 17:01:26 +0000 (19:01 +0200)] 
firewire: don't panic on invalid AR request buffer

BUG() at this place is wrong.  (Unless if the low level driver would
already do higher-level input validation of incoming request headers.)

Invalid incoming requests or bugs in the controller which corrupt the
AR-req buffer needlessly crashed the box because this is run in tasklet
context.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
Linus Torvalds [Wed, 18 Jun 2008 19:55:00 +0000 (12:55 -0700)] 
Merge git://git./linux/kernel/git/wim/linux-2.6-watchdog

* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  Revert "[WATCHDOG] hpwdt: Fix NMI handling."
  [WATCHDOG] hpwdt: Add CFLAGS to get driver working
  Revert "[WATCHDOG] make watchdog/hpwdt.c:asminline_call() static"

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Wed, 18 Jun 2008 18:55:43 +0000 (11:55 -0700)] 
Merge git://git./linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] dpt_i2o: Add PROC_IA64 define
  [SCSI] scsi_host regression: fix scsi host leak
  [SCSI] sr: fix corrupt CD data after media change and delay

15 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
Linus Torvalds [Wed, 18 Jun 2008 18:55:19 +0000 (11:55 -0700)] 
Merge branch 'merge' of git://git./linux/kernel/git/paulus/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [POWERPC] Clear sub-page HPTE present bits when demoting page size
  [POWERPC] 4xx: Clear new TLB cache attribute bits in Data Storage vector

15 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
Linus Torvalds [Wed, 18 Jun 2008 18:55:03 +0000 (11:55 -0700)] 
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-udf-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6:
  udf: restore UDFFS_DEBUG to being undefined by default

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Wed, 18 Jun 2008 18:48:40 +0000 (11:48 -0700)] 
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (43 commits)
  netlink: genl: fix circular locking
  Revert "mac80211: Use skb_header_cloned() on TX path."
  af_unix: fix 'poll for write'/ connected DGRAM sockets
  tun: Proper handling of IPv6 header in tun driver when TUN_NO_PI is set
  atl1: relax eeprom mac address error check
  net/enc28j60: low power mode
  net/enc28j60: section fix
  sky2: 88E8040T pci device id
  netxen: download firmware in pci probe
  netxen: cleanup debug messages
  netxen: remove global physical_port array
  netxen: fix portnum for hp mezz cards
  ibm_newemac: select CRC32 in Kconfig
  xfrm: fix fragmentation for ipv4 xfrm tunnel
  netfilter: nf_conntrack_h323: fix module unload crash
  netfilter: nf_conntrack_h323: fix memory leak in module initialization error path
  netfilter: nf_nat: fix RCU races
  atm: [he] send idle cells instead of unassigned when in SDH mode
  atm: [he] limit queries to the device's register space
  atm: [br2864] fix routed vcmux support
  ...

15 years agoRevert "[WATCHDOG] hpwdt: Fix NMI handling."
Wim Van Sebroeck [Wed, 18 Jun 2008 16:22:48 +0000 (16:22 +0000)] 
Revert "[WATCHDOG] hpwdt: Fix NMI handling."

The old setup works better.

Signed-off-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>