linux-2.6
16 years ago[POWERPC] 83xx: Handle mpc8360 rev. 2.1 RGMII timing erratum
Kim Phillips [Mon, 5 Nov 2007 18:15:51 +0000 (12:15 -0600)] 
[POWERPC] 83xx: Handle mpc8360 rev. 2.1 RGMII timing erratum

If on a rev. 2.1, adjust UCC clock and data timing characteristics
as specified in the rev.2.1 erratum #2.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Document rgmii-rxid and rgmii-txid phy-connection-types
Kim Phillips [Mon, 5 Nov 2007 18:15:35 +0000 (12:15 -0600)] 
[POWERPC] Document rgmii-rxid and rgmii-txid phy-connection-types

A h/w bug requires we program the PHY in RGMII mode for internal delay
on the receive or transmit side only; document the new property values.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 83xx: Fix 2nd UCC entry in mpc832x_mds.dts
Kim Phillips [Tue, 13 Nov 2007 23:26:31 +0000 (17:26 -0600)] 
[POWERPC] 83xx: Fix 2nd UCC entry in mpc832x_mds.dts

correct the reg property, remove duplicate io port entry, whitespace fixes.

Thanks to Peter Van Ackeren for pointing this out.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 83xx: mpc832x mds: Fix board PHY reset code
Kim Phillips [Tue, 20 Nov 2007 01:04:43 +0000 (19:04 -0600)] 
[POWERPC] 83xx: mpc832x mds: Fix board PHY reset code

currently the board-level PHY reset code for the mpc832x MDS messes with
reset configuration words source settings which is plain wrong (it
looks like this board code was cut-n-pasted from the mpc8360 mds code,
which has the PHY reset bits in a different BCSR); this patch points
the PHY reset code to the proper mpc832x mds PHY reset bits in the BCSR.

Signed-off-by: Peter Van Ackeren <peter.vanackeren@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Fix potential NULL dereference
Cyrill Gorcunov [Thu, 15 Nov 2007 18:47:06 +0000 (21:47 +0300)] 
[POWERPC] Fix potential NULL dereference

This patch does fix potential NULL pointer dereference that could take
place inside of strcmp() if of_get_property() call failed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] vdso: Fixes for cache block sizes
Olof Johansson [Tue, 20 Nov 2007 01:24:45 +0000 (12:24 +1100)] 
[POWERPC] vdso: Fixes for cache block sizes

The current VDSO implementation is hardcoded to 128 byte cache blocks,
which are only used on IBM's 64-bit processors.

Convert it to get the cache block sizes out of vdso_data instead,
similar to how the ppc64 in-kernel cache flush does it.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoMerge branch 'for-2.6.24' of master.kernel.org:/pub/scm/linux/kernel/git/olof/pasemi...
Paul Mackerras [Tue, 20 Nov 2007 02:54:46 +0000 (13:54 +1100)] 
Merge branch 'for-2.6.24' of /linux/kernel/git/olof/pasemi into merge

16 years agoACPI: Add missing spaces to printk format
Joe Perches [Tue, 20 Nov 2007 01:48:02 +0000 (17:48 -0800)] 
ACPI: Add missing spaces to printk format

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agocpuidle: fix HP nx6125 regression
Venkatesh Pallipadi [Tue, 20 Nov 2007 02:43:22 +0000 (21:43 -0500)] 
cpuidle: fix HP nx6125 regression

Fix for http://bugzilla.kernel.org/show_bug.cgi?id=9355

cpuidle always used to fallback to C2 if there is some bm activity while
entering C3. But, presence of C2 is not always guaranteed. Change cpuidle
algorithm to detect a safe_state to fallback in case of bm_activity and
use that state instead of C2.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agocpuidle: add sched_clock_idle_[sleep|wakeup]_event() hooks
Venkatesh Pallipadi [Tue, 20 Nov 2007 00:49:00 +0000 (19:49 -0500)] 
cpuidle: add sched_clock_idle_[sleep|wakeup]_event() hooks

Port 2aa44d0567ed21b47b87d68819415d48194cb923
(sched: sched_clock_idle_[sleep|wakeup]_event()) to cpuidle.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agocpuidle: fix C3 for no bus-master control case
Venkatesh Pallipadi [Tue, 20 Nov 2007 00:48:00 +0000 (19:48 -0500)] 
cpuidle: fix C3 for no bus-master control case

Port 18eab8550397f1f3d4b8b2c5257c88dae25d58ed
(Enable C3 even when PM2_control is zero) to cpuidle.

Without this patch, some systems will notice a regression
when enabling CPU_IDLE -- C3 would no longer be available.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years ago[CIFS] Fix spurious reconnect on 2nd peek from read of SMB length
Petr Tesarik [Tue, 20 Nov 2007 02:24:08 +0000 (02:24 +0000)] 
[CIFS] Fix spurious reconnect on 2nd peek from read of SMB length

When retrying kernel_recvmsg() because of a short read, check returned
length against the remaining length, not against total length. This
avoids unneeded session reconnects which would otherwise occur when
kernel_recvmsg() finally returns zero when asked to read zero bytes.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
16 years ago[POWERPC] pasemi: Don't reset mpic at boot
Olof Johansson [Tue, 6 Nov 2007 02:35:33 +0000 (20:35 -0600)] 
[POWERPC] pasemi: Don't reset mpic at boot

Due to an erratum, we don't want to reset the mpic at boot time. It can
sometimes cause problems with lost interrupts later on while running.

Signed-off-by: Olof Johansson <olof@lixom.net>
16 years agoMerge branch 'for-2.6.24' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
Paul Mackerras [Tue, 20 Nov 2007 00:39:26 +0000 (11:39 +1100)] 
Merge branch 'for-2.6.24' of /linux/kernel/git/jwboyer/powerpc-4xx into merge

16 years ago[POWERPC] Fix kmalloc alignment on non-coherent DMA platforms
Benjamin Herrenschmidt [Mon, 19 Nov 2007 08:25:06 +0000 (19:25 +1100)] 
[POWERPC] Fix kmalloc alignment on non-coherent DMA platforms

On platforms doing non-coherent DMA (4xx, 8xx, ...), it's important
that the kmalloc minimum alignment is set to the cache line size, to
avoid sharing cache lines between different objects, so that DMA to
one of the objects doesn't corrupt the other.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix build failure on legacy iSeries
Kamalesh Babulal [Mon, 19 Nov 2007 06:44:05 +0000 (17:44 +1100)] 
[POWERPC] Fix build failure on legacy iSeries

Include <asm/iseries/hv_call.h> in arch/powerpc/mm/stab.c to fix the
following compile error (found with randconfig):

  CC      arch/powerpc/mm/stab.o
arch/powerpc/mm/stab.c: In function "stab_initialize":
arch/powerpc/mm/stab.c:282: error: implicit declaration of function "HvCall1"
arch/powerpc/mm/stab.c:282: error: "HvCallBaseSetASR" undeclared (first use in this function)
arch/powerpc/mm/stab.c:282: error: (Each undeclared identifier is reported only once
arch/powerpc/mm/stab.c:282: error: for each function it appears in.)
make[1]: *** [arch/powerpc/mm/stab.o] Error 1
make: *** [arch/powerpc/mm] Error 2

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoACPI: thinkpad-acpi: fix oops when a module parameter has no value
Henrique de Moraes Holschuh [Sun, 18 Nov 2007 11:18:29 +0000 (09:18 -0200)] 
ACPI: thinkpad-acpi: fix oops when a module parameter has no value

set_ibm_param() could OOPS with a NULL pointer derreference if one did not give
any values for a module parameter it handles.  This would, of course, cause all
sort of trouble for future modprobing and require a reboot to clean up
properly.

Fix it by returning -EINVAL if no values are given for the parameter, and also
avoid any nastyness from BUG_ON while at it.

How to reproduce: modprobe thinkpad-acpi brightness

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Tested-by: Mike Kershaw <dragorn@kismetwireless.net>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years ago[ALSA] ca0106 - Check value range in ctl callbacks
Takashi Iwai [Thu, 15 Nov 2007 13:42:34 +0000 (14:42 +0100)] 
[ALSA] ca0106 - Check value range in ctl callbacks

Check the value ranges in ctl put callbacks properly.
Some callbacks may access a wrong pointer depending on the value passed.
Also, fixed the access to the wrong field for enum values, and fixed
some callbacks to return the proper error code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
16 years ago[ALSA] hda-codec - Check PINCAP only for PIN widgets
Takashi Iwai [Wed, 14 Nov 2007 13:53:42 +0000 (14:53 +0100)] 
[ALSA] hda-codec - Check PINCAP only for PIN widgets

The recent addition of checking PINCAP for EAPD seems to break some
systems due to unexpected response from the codec chip.  We shouldn't
issue GET_PINCAP verb to non-PIN widgets.  Now checks the widget type
before checking EAPD bit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
16 years ago[ALSA] mpu401: fix recursive locking in timer
Clemens Ladisch [Mon, 12 Nov 2007 07:47:57 +0000 (08:47 +0100)] 
[ALSA] mpu401: fix recursive locking in timer

When the output and input ports are used at the same time, the timer can
be interrupted by the hardware interrupt, so we have to disable
interrupts when we take a lock in the timer.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
16 years ago[ALSA] cmipci: fix FLINKON/OFF bits
Clemens Ladisch [Tue, 30 Oct 2007 07:59:14 +0000 (08:59 +0100)] 
[ALSA] cmipci: fix FLINKON/OFF bits

Fix the definitions of the CM_FLINKON/CM_FLINKOFF register bits that
were garbled in the last 'update register definitions' patch.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
16 years ago[ALSA] hda-codec - Disable shared stream on AD1986A
Takashi Iwai [Fri, 26 Oct 2007 10:35:56 +0000 (12:35 +0200)] 
[ALSA] hda-codec - Disable shared stream on AD1986A

AD1986A has a hardware problem that it cannot share a stream with
multiple pins properly.  The problem occurs e.g. when a volume is changed
during playback.
So far, hda-intel driver unconditionally assigns the stream to multiple
output pins in copy-front mode, and this should be avoided for AD1986A
codec.
The original fix patch was by zhejiang <zhe.jiang@intel.com>.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
16 years agoRevert "Fix very high interrupt rate for IRQ8 (rtc) unless pnpacpi=off"
Len Brown [Mon, 19 Nov 2007 17:23:59 +0000 (12:23 -0500)] 
Revert "Fix very high interrupt rate for IRQ8 (rtc) unless pnpacpi=off"

This reverts commit 9cd8047b463f213c294f756119ac353312e7a152.

16 years agoACPI: EC: Don't init EC early if it has no _INI
Alexey Starikovskiy [Thu, 15 Nov 2007 18:52:47 +0000 (21:52 +0300)] 
ACPI: EC: Don't init EC early if it has no _INI

Option to init EC early inserted to handle #8598 ASUS problem,
introduced several others.

EC driver in this particular case has fake _INI method, not present on
other machines, which don't need or break from this workaround, so lets use
its presence as a flag for early init.

http://bugzilla.kernel.org/show_bug.cgi?id=9262
http://bugzilla.kernel.org/show_bug.cgi?id=8598
https://bugzilla.novell.com/show_bug.cgi?id=334806

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoRevert "acpi: make ACPI_PROCFS default to y"
Len Brown [Mon, 19 Nov 2007 16:22:44 +0000 (11:22 -0500)] 
Revert "acpi: make ACPI_PROCFS default to y"

This reverts commit cbff2fbf55c21f50298b1aef1263b11bf510e35f.

16 years agoRevert "ACPI: add documentation for deprecated /proc/acpi/battery in ACPI_PROCFS"
Len Brown [Mon, 19 Nov 2007 16:22:35 +0000 (11:22 -0500)] 
Revert "ACPI: add documentation for deprecated /proc/acpi/battery in ACPI_PROCFS"

This reverts commit 6e800af233e0bdf108efb7bd23c11ea6fa34cdeb.

16 years agoACPI: Split out control for /proc/acpi entries from battery, ac, and sbs.
Alexey Starikovskiy [Mon, 19 Nov 2007 13:33:45 +0000 (16:33 +0300)] 
ACPI: Split out control for /proc/acpi entries from battery, ac, and sbs.

Introduce new ACPI_PROCFS_POWER (default Yes) config option and move
procfs code in battery, ac, and sbs drivers under it.
This is done to allow ACPI_PROCFS to be default No.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years ago[POWERPC] 4xx: Use virtual PVR value to init FPU on arch/ppc 440EP
Josh Boyer [Fri, 16 Nov 2007 17:29:56 +0000 (04:29 +1100)] 
[POWERPC] 4xx: Use virtual PVR value to init FPU on arch/ppc 440EP

This fixes arch/ppc 440EP platforms to setup the FPU correctly.  A virtual
PVR is used, as 440GR platforms share an identical hardware PVR value and do
not have an FPU.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years ago[POWERPC] 4xx: UIC add mask_ack callback
Valentine Barshak [Tue, 13 Nov 2007 20:25:21 +0000 (07:25 +1100)] 
[POWERPC] 4xx: UIC add mask_ack callback

This adds uic_mask_ack_irq() callback to PowerPC 4xx uic code
to avoid kernel crash. It is used for edge-triggered interrupts
by handle_uic_irq().

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years ago[POWERPC] 4xx: balance ioremap/ioumap calls for Yucca
Roel Kluin [Wed, 7 Nov 2007 22:22:48 +0000 (09:22 +1100)] 
[POWERPC] 4xx: balance ioremap/ioumap calls for Yucca

Call iounmap before returning from an error case.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years ago[POWERPC] Xilinx: Register AC97 Controller Reference with the platform bus
Joachim Foerster [Wed, 7 Nov 2007 16:14:15 +0000 (03:14 +1100)] 
[POWERPC] Xilinx: Register AC97 Controller Reference with the platform bus

Add AC97 platform bus registration for Xilinx Virtex platforms.

Signed-off-by: Joachim Foerster <JOFT@gmx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years ago[POWERPC] 4xx: Replace #includes of asm/of_platform.h with linux/of_platform.h.
Jon Loeliger [Tue, 6 Nov 2007 18:13:04 +0000 (05:13 +1100)] 
[POWERPC] 4xx: Replace #includes of asm/of_platform.h with linux/of_platform.h.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
16 years agoACPI: Video: Increase buffer size for writes to brightness proc file.
Danny Baumann [Fri, 2 Nov 2007 12:47:53 +0000 (13:47 +0100)] 
ACPI: Video: Increase buffer size for writes to brightness proc file.

In order to be able to write the value "100"
to /proc/acpi/video/.../brightness, we have to allocate 5 bytes:
4 characters will be written (1, 0, 0 plus null byte),
and 1 byte should be buffer for a terminating NULL character.

http://bugzilla.kernel.org/show_bug.cgi?id=9278

Signed-off-by: Danny Baumann <dannybaumann@web.de>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: EC: Workaround for optimized controllers
Alexey Starikovskiy [Sun, 18 Nov 2007 22:37:03 +0000 (01:37 +0300)] 
ACPI: EC: Workaround for optimized controllers

Some controllers fail to send confirmation GPE after address write.
Detect this and don't expect such confirmation in future.
This is a generalization of previous workaround
(66c5f4e7367b0085652931b2f3366de29e7ff5ec), which did only read address.

http://bugzilla.kernel.org/show_bug.cgi?id=9327

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Romano Giannetti <romano.giannetti@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years ago[POWERPC] Fix declaration of pcibios_free_controller
Benjamin Herrenschmidt [Fri, 16 Nov 2007 07:42:18 +0000 (18:42 +1100)] 
[POWERPC] Fix declaration of pcibios_free_controller

pcibios_free_controller() is now available for both 32 and 64 bits
but the header only declares it for 64 bits.  This moves the
declaration down next to the pcibios_alloc_controller() one.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] prpmc2800: Enable L2 cache
Mark A. Greer [Wed, 14 Nov 2007 19:04:02 +0000 (06:04 +1100)] 
[POWERPC] prpmc2800: Enable L2 cache

Turn on the L2 cache on the prpmc2800 platform.

Signed-off-by: Mark A. Greer <mgreer@mvista.com
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] pSeries: make pseries_defconfig minus PCI build again
Stephen Rothwell [Wed, 14 Nov 2007 04:07:39 +0000 (15:07 +1100)] 
[POWERPC] pSeries: make pseries_defconfig minus PCI build again

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix multiple bugs in rtas_ibm_suspend_me code
Nathan Lynch [Tue, 13 Nov 2007 16:15:13 +0000 (03:15 +1100)] 
[POWERPC] Fix multiple bugs in rtas_ibm_suspend_me code

There are several issues with the rtas_ibm_suspend_me code, which
enables platform-assisted suspension of an LPAR as covered in PAPR
2.2.

1.) rtas_ibm_suspend_me uses on_each_cpu() to invoke
rtas_percpu_suspend_me on all cpus via IPI:

if (on_each_cpu(rtas_percpu_suspend_me, &data, 1, 0))
...

'data' is on the calling task's stack, but rtas_ibm_suspend_me takes
no measures to ensure that all instances of rtas_percpu_suspend_me are
finished accessing 'data' before returning.  This can result in the
IPI'd cpus accessing random stack data and getting stuck in H_JOIN.

This is addressed by using an atomic count of workers and a completion
on the stack.

2.) rtas_percpu_suspend_me is needlessly calling H_JOIN in a loop.
The only event that can cause a cpu to return from H_JOIN is an H_PROD
from another cpu or a NMI/system reset.  Each cpu need call H_JOIN
only once per suspend operation.

Remove the loop and the now unnecessary 'waiting' state variable.

3.) H_JOIN must be called with MSR[EE] off, but lazy interrupt
disabling may cause the caller of rtas_ibm_suspend_me to call H_JOIN
with it on; the local_irq_disable() in on_each_cpu() is not
sufficient.

Fix this by explicitly saving the MSR and clearing the EE bit before
calling H_JOIN.

4.) H_PROD is being called with the Linux logical cpu number as the
parameter, not the platform interrupt server value.  (It's also being
called for all possible cpus, which is harmless, but unnecessary.)

This is fixed by calling H_PROD for each online cpu using
get_hard_smp_processor_id(cpu) for the argument.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agofb: Orphan imsttfb.
Paul Mundt [Mon, 19 Nov 2007 04:11:04 +0000 (13:11 +0900)] 
fb: Orphan imsttfb.

I haven't had this hardware in years, so kill off my MAINTAINERS entry
for this and flag it as orphaned.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agoata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3
Tejun Heo [Mon, 19 Nov 2007 03:06:37 +0000 (12:06 +0900)] 
ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3

ICH8 and 9 use two SFF controllers to show 6 SATA ports.  The first
controllre hosts the first 4 ports while the second one hosts the last
2.  The PCS register of the first controller encompasses the first
four ports or all six ports depending on configuration while PCS of
the second controller controls the last two ports.  Using 0xf for the
first controller and 0x3 for the second controller always result in
the correct configuration.

Signed-off-by: Tejun Heo <htejun@gmail.com>
16 years agosh: Update mailing list info.
Paul Mundt [Mon, 19 Nov 2007 04:08:37 +0000 (13:08 +0900)] 
sh: Update mailing list info.

DaveM has provided a vger list, update MAINTAINERS to reflect this.

Also, rip out the sh64 entry (as this can just be rolled in to the
general sh case), and add the git path.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agosh: lockless UTLB miss fast-path.
Paul Mundt [Mon, 19 Nov 2007 04:05:18 +0000 (13:05 +0900)] 
sh: lockless UTLB miss fast-path.

With the refactored update_mmu_cache() introduced in older kernels,
there's no longer any need to take the page_table_lock in this path,
so simply drop it completely.

Without this, performance degradation is seen on SMP on heavily
threaded workloads that don't use the split ptlock, and ultimately
we have no reason to contend for the lock in the first place.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agosh: Kill off UTLB flush in fast-path.
Paul Mundt [Mon, 19 Nov 2007 04:00:32 +0000 (13:00 +0900)] 
sh: Kill off UTLB flush in fast-path.

The __do_page_fault() fast-path contains a UTLB flush in order to
force an ITLB reload, this isn't needed in practice as the ITLB is
auto-reloaded from the UTLB anyways, which is already displaced by
the manual 'ldtlb' in the update_mmu_cache() path.

This provides a measurable speed up in the TLB miss fast-path.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agosh: Fix copy_{to,from}_user_page() with cache disabled.
Heiko Schocher [Sun, 11 Nov 2007 04:17:44 +0000 (13:17 +0900)] 
sh: Fix copy_{to,from}_user_page() with cache disabled.

Signed-off-by: Heiko Schocher <heiko.schocher@invitel.hu>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agoata_piix: only enable the first port on apple macbook pro
Thomas Rohwer [Mon, 19 Nov 2007 02:54:24 +0000 (11:54 +0900)] 
ata_piix: only enable the first port on apple macbook pro

ICH8M on apple macbook pro occasionally locks up completely during PCS
initialization if ports other than the first one are enabled.  Add a
separate controller ID and only enable the first port.

tj: commit description added and patch updated to fit with the
    previous controller ID update.

Signed-off-by: Thomas Rohwer <tr@tng.de>
Signed-off-by: Tejun Heo <htejun@gmail.com>
16 years agoata_piix: reorganize controller IDs
Tejun Heo [Mon, 19 Nov 2007 02:24:25 +0000 (11:24 +0900)] 
ata_piix: reorganize controller IDs

Move piix_pata_mwdma to top, rename ich9_2port_sata to ich8_2port_sata
for consistency and use automatically incremented values instead of
assigning fixed values to ease adding new controller IDs.

Signed-off-by: Tejun Heo <htejun@gmail.com>
16 years agopata_sis.c: Add Packard Bell EasyNote K5305 to laptops
Gabriel C [Thu, 15 Nov 2007 04:14:00 +0000 (13:14 +0900)] 
pata_sis.c: Add Packard Bell EasyNote K5305 to laptops

With newer kernels HDD in my old laptop is limited to UDMA 33.
With this patch I get UDMA 100 again.

Signed-off-by: Gabriel Craciunescu <nix.or.die@googlemail.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
16 years agolibata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs
Mark Lord [Thu, 15 Nov 2007 04:13:59 +0000 (13:13 +0900)] 
libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs

Sebastian Kemper reported that issuing CD/DVD commands under libata is
not fully compatible with ide-scsi.  In particular, the
GPCMD_SET_STREAMING was being rejected at the host level in some
instances.

The reason is that libata-scsi insists upon the cmd_len field exactly
matching the SCSI opcode being issued, whereas ide-scsi tolerates
12-byte commands contained within a 16-byte (cmd_len) CDB.

There doesn't seem to be a good reason for us to not be compatible
there, so here is a patch to fix libata-scsi to permit SCSI opcodes so
long as they fit within whatever size CDB is provided.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
16 years agolibata: use ATA_HORKAGE_STUCK_ERR for ATAPI tape drives
Albert Lee [Thu, 15 Nov 2007 01:35:47 +0000 (10:35 +0900)] 
libata: use ATA_HORKAGE_STUCK_ERR for ATAPI tape drives

Per Mark's comments, maybe all ATAPI tape drives need ATA_HORKAGE_STUCK_ERR.
This patch applys ATA_HORKAGE_STUCK_ERR for all ATAPI tape drives.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Cc: Mark Lord <liml@rtr.ca>
Signed-off-by: Tejun Heo <htejun@gmail.com>
16 years agolibata: workaround DRQ=1 ERR=1 for ATAPI tape drives
Albert Lee [Thu, 15 Nov 2007 01:35:46 +0000 (10:35 +0900)] 
libata: workaround DRQ=1 ERR=1 for ATAPI tape drives

After an error condition, some ATAPI tape drives set DRQ=1 together
with ERR=1 when asking the host to transfer the CDB of the next packet
command (i.e. request sense).  This patch, a revised version of
Alan/Mark's previous patch, adds ATA_HORKAGE_STUCK_ERR to workaround
the problem by ignoring the ERR bit and proceed sending the CDB.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mark Lord <liml@rtr.ca>
Signed-off-by: Tejun Heo <htejun@gmail.com>
16 years agolibata: remove unused functions
Adrian Bunk [Thu, 15 Nov 2007 01:35:45 +0000 (10:35 +0900)] 
libata: remove unused functions

This patch removes the following obsolete functions:
- libata-core.c: __sata_phy_reset()
- libata-core.c: sata_phy_reset()
- libata-eh.c: ata_qc_timeout()
- libata-eh.c: ata_eng_timeout()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Tejun Heo <htejun@gmail.com>
16 years agoata_piix: add SATELLITE U205 to broken suspend list
Tejun Heo [Mon, 12 Nov 2007 08:56:24 +0000 (17:56 +0900)] 
ata_piix: add SATELLITE U205 to broken suspend list

Satellite U205 has alternate product name where the satellite part is
all capatalized.  Add it to the blacklist.

This is reported by Ross Patterson in kernel bugzilla bug #7780.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Ross Patterson <me@rpatterson.net>
16 years ago[TCP]: Fix TCP header misalignment
Herbert Xu [Mon, 19 Nov 2007 02:48:08 +0000 (18:48 -0800)] 
[TCP]: Fix TCP header misalignment

Indeed my previous change to alloc_pskb has made it possible
for the TCP header to be misaligned iff the MTU is not a multiple
of 4 (and less than a page).  So I suspect the optimised IPsec
MTU calculation is giving you just such an MTU :)

This patch fixes it by changing alloc_pskb to make sure that
the size is at least 32-bit aligned.  This does not cause the
problem fixed by the previous patch because max_header is always
32-bit aligned which means that in the SG/NOTSO case this will
be a no-op.

I thought about putting this in the callers but all the current
callers are from TCP.  If and when we get a non-TCP caller we
can always create a TCP wrapper for this function and move the
alignment over there.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: Corrects a bug in ip_rt_acct_read()
Eric Dumazet [Fri, 16 Nov 2007 10:29:24 +0000 (02:29 -0800)] 
[NET]: Corrects a bug in ip_rt_acct_read()

It seems that stats of cpu 0 are counted twice, since
for_each_possible_cpu() is looping on all possible cpus, including 0

Before percpu conversion of ip_rt_acct, we should also remove the
assumption that CPU 0 is online (or even possible)

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agort2x00: Request usb_maxpacket() once
Ivo van Doorn [Thu, 15 Nov 2007 22:41:31 +0000 (23:41 +0100)] 
rt2x00: Request usb_maxpacket() once

The usb max packet size won't change during the
device's presence. We should store it in a
variable inside rt2x00dev and use that.
This should also fix a division error when the
device is being hot-unplugged while a frame is
being send out.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agovirtio: fix net driver loop case where we fail to restart
Rusty Russell [Mon, 19 Nov 2007 16:20:43 +0000 (11:20 -0500)] 
virtio: fix net driver loop case where we fail to restart

skb is only NULL the first time around: it's more correct to test for
being under-budget.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agomodule: fix and elaborate comments
Matti Linnanvuori [Thu, 8 Nov 2007 16:37:38 +0000 (08:37 -0800)] 
module: fix and elaborate comments

Fix and elaborate comments.

Signed-off-by: Matti Linnanvuori <mattilinnanvuori@yahoo.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agovirtio: fix module/device unloading
Rusty Russell [Mon, 19 Nov 2007 16:20:42 +0000 (11:20 -0500)] 
virtio: fix module/device unloading

The virtio code never hooked through the ->remove callback.  Although
noone supports device removal at the moment, this code is already
needed for module unloading.

This of course also revealed bugs in virtio_blk, virtio_net and lguest
unloading paths.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agolguest: Fix uninitialized members in example launcher
Rusty Russell [Mon, 19 Nov 2007 16:20:40 +0000 (11:20 -0500)] 
lguest: Fix uninitialized members in example launcher

Thanks valgrind!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agoACPI: SBS: Fix retval warning
Jeff Garzik [Sat, 17 Nov 2007 21:32:31 +0000 (00:32 +0300)] 
ACPI: SBS: Fix retval warning

drivers/acpi/sbs.c: In function acpi_battery_add:
drivers/acpi/sbs.c:811: warning: ignoring return value of device_create_file,
declared with attribute warn_unused_result

Additional cleanups:
* use struct acpi_battery in acpi_battery_remove() to clean up function
calls, just like acpi_battery_add() already does.

* put braces around unregister call, as it depends on dev being not NULL.

* remove unneeded braces

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agokernel BUG at fs/nfs/namespace.c:108! - can be triggered by bad server
Neil Brown [Thu, 1 Nov 2007 05:50:20 +0000 (16:50 +1100)] 
kernel BUG at fs/nfs/namespace.c:108! - can be triggered by bad server

Hi Trond,

I have discovered that the BUG_ON in nfs_follow_mountpoint:

BUG_ON(IS_ROOT(dentry));

can be triggered by a misbehaving server.

What happens is the client does a lookup and discoveres that the named
directory has a different fsid, so it initiates a mount.
It then performs a GETATTR on the mounted directory and gets a
different fsid again (due to a bug in the NFS server).
This causes nfs_follow_mountpoint to be called on the newly mounted
root, which triggers the BUG_ON.

To duplicate this, have a directory which contains some mountpoints,
and export that directory with the "crossmnt" flag using nfs-utils
1.1.1 (or 1.1.0 I think)

The GETATTR on the root of the mounted filesystem will return the
information for the top exportpoint, while a lookup will return the
correct information.  This difference causes the NFS client to BUG.

I think the best way to fix this is to trap this possibility early, so
just before completing the mount in the NFS client, check that it isn't
going to use nfs_mountpoint_inode_operations.
As long as i_op will never change once set (is that true?), this
should be adequately safe.

The following patch shows a possible approach, and it works for me.
i.e. when the NFS server is misbehaving, I get ESTALE on those
mountpoints, while when the NFS server is working correctly, I get
correct behaviour on the client.

NeilBrown

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agosunrpc: rpc_pipe_poll may miss available data in some cases
J. Bruce Fields [Tue, 6 Nov 2007 18:05:36 +0000 (13:05 -0500)] 
sunrpc: rpc_pipe_poll may miss available data in some cases

Pipe messages start out life on a queue on the inode, but when first
read they're moved to the filp's private pointer.  So it's possible for
a poll here to return null even though there's a partially read message
available.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agosunrpc: return error if unsupported enctype or cksumtype is encountered
Kevin Coffman [Fri, 9 Nov 2007 23:42:09 +0000 (18:42 -0500)] 
sunrpc: return error if unsupported enctype or cksumtype is encountered

Return an error from gss_import_sec_context_kerberos if the
negotiated context contains encryption or checksum types not
supported by the kernel code.

This fixes an Oops because success was assumed and later code found
no internal_ctx_id.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agosunrpc: gss_pipe_downcall(), don't assume all errors are transient
Kevin Coffman [Fri, 9 Nov 2007 23:42:04 +0000 (18:42 -0500)] 
sunrpc: gss_pipe_downcall(), don't assume all errors are transient

Instead of mapping all errors except EACCES to EAGAIN, map all errors
except EAGAIN to EACCES.

An example is user-land negotiating a Kerberos context with an encryption
type that is not supported by the kernel code.  (This can happen due to
mis-configuration or a bug in the Kerberos code that does not honor our
request to limit the encryption types negotiated.)  This failure is not
transient, and returning EAGAIN causes mount to continuously retry rather
than giving up.

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoNFS: Fix the ustat() regression
Trond Myklebust [Thu, 25 Oct 2007 17:56:10 +0000 (13:56 -0400)] 
NFS: Fix the ustat() regression

Since 2.6.18, the superblock sb->s_root has been a dummy dentry with a
dummy inode. This breaks ustat(), which actually uses sb->s_root in a
vfstat() call.

Fix this by making the s_root a dummy alias to the directory inode that was
used when creating the superblock.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
Linus Torvalds [Sat, 17 Nov 2007 16:36:10 +0000 (08:36 -0800)] 
Merge branch 'master' of git://git./linux/kernel/git/x86/linux-2.6-x86

* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
  x86: simplify "make ARCH=x86" and fix kconfig all.config
  x86: reboot fixup for wrap2c board
  x86: check boundary in count setup resource
  x86: fix reboot with no keyboard attached
  x86: add hpet sanity checks
  x86: on x86_64, correct reading of PC RTC when update in progress in time_64.c
  x86: fix freeze in x86_64 RTC update code in time_64.c
  ntp: fix typo that makes sync_cmos_clock erratic
  Remove x86 merge artifact from top Makefile
  x86: fixup cpu_info array conversion
  x86: show cpuinfo only for online CPUs
  x86: fix cpu-hotplug regression
  x86: ignore the sys_getcpu() tcache parameter
  x86: voyager use correct header file name
  x86: fix smp init sections
  x86: fix voyager_cat_init section
  x86: fix bogus memcpy in es7000_check_dsdt()

16 years agox86: simplify "make ARCH=x86" and fix kconfig all.config
Sam Ravnborg [Sat, 17 Nov 2007 14:37:31 +0000 (15:37 +0100)] 
x86: simplify "make ARCH=x86" and fix kconfig all.config

Simplify "make ARCH=x86" and fix kconfig so we again can set 64BIT in
all.config.

For a fix the diffstat is nice:
 6 files changed, 3 insertions(+), 36 deletions(-)

The patch reverts these commits:
 - 0f855aa64b3f63d35a891510cf7db932a435c116 ("kconfig: add helper to set
   config symbol from environment variable")
 - 2a113281f5cd2febbab21a93c8943f8d3eece4d3 ("kconfig: use $K64BIT to
   set 64BIT with all*config targets")

Roman Zippel pointed out that kconfig supported string compares so
the additional complexity introduced by the above two patches were
not needed.

With this patch we have following behaviour:

  # make {allno,allyes,allmod,rand}config [ARCH=...]
  option \ host arch      | 32bit         | 64bit
  =====================================================
  ./.                     | 32bit         | 64bit
  ARCH=x86                | 32bit         | 32bit
  ARCH=i386               | 32bit         | 32bit
  ARCH=x86_64             | 64bit         | 64bit

The general rule are that ARCH= and native architecture takes
precedence over the configuration.

So make ARCH=i386 [whatever] will always build a 32-bit kernel
no matter what the configuration says.  The configuration will
be updated to 32-bit if it was configured to 64-bit and the
other way around.

This behaviour is consistent with previous behaviour so no
suprises here.

make ARCH=x86 will per default result in a 32-bit kernel but as
the only ARCH= value x86 allow the user to select between 32-bit
and 64-bit using menuconfig.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Andreas Herrmann <aherrman@arcor.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoBlackfin arch: cleanup kernel exception message, don't insult the customer.
Robin Getz [Sat, 17 Nov 2007 16:35:33 +0000 (00:35 +0800)] 
Blackfin arch: cleanup kernel exception message, don't insult the customer.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agox86: simplify "make ARCH=x86" and fix kconfig all.config
Sam Ravnborg [Sat, 17 Nov 2007 14:37:31 +0000 (15:37 +0100)] 
x86: simplify "make ARCH=x86" and fix kconfig all.config

Simplify "make ARCH=x86" and fix kconfig so we again
can set 64BIT in all.config.

For a fix the diffstat is nice:
 6 files changed, 3 insertions(+), 36 deletions(-)

The patch reverts these commits:
0f855aa64b3f63d35a891510cf7db932a435c116
-> kconfig: add helper to set config symbol from environment variable

2a113281f5cd2febbab21a93c8943f8d3eece4d3
-> kconfig: use $K64BIT to set 64BIT with all*config targets

Roman Zippel pointed out that kconfig supported string
compares so the additional complexity introduced by the
above two patches were not needed.

With this patch we have following behaviour:

# make {allno,allyes,allmod,rand}config [ARCH=...]
option \ host arch      | 32bit         | 64bit
=====================================================
./.                     | 32bit         | 64bit
ARCH=x86                | 32bit         | 32bit
ARCH=i386               | 32bit         | 32bit
ARCH=x86_64             | 64bit         | 64bit

The general rule are that ARCH= and native architecture
takes precedence over the configuration.
So make ARCH=i386 [whatever] will always build a 32-bit
kernel no matter what the configuration says.
The configuration will be updated to 32-bit if it was
configured to 64-bit and the other way around.

This behaviour is consistent with previous behaviour so
no suprises here.

make ARCH=x86 will per default result in a 32-bit kernel
but as the only ARCH= value x86 allow the user to select
between 32-bit and 64-bit using menuconfig.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Andreas Herrmann <aherrman@arcor.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
16 years agoBlackfin arch: fix bug kernel not to boot up with mtd filesystems
Bernd Schmidt [Sat, 17 Nov 2007 16:09:49 +0000 (00:09 +0800)] 
Blackfin arch: fix bug kernel not to boot up with mtd filesystems

Revert this patch:
move the init sections to the end of memory, so that after they
are free, run time memory is all continugous - this should help decrease
memory fragementation. When doing this, we also pack some of the other
sections a little closer together, to make sure we don't waste memory.
To make this happen, we need to rename the .data.init_task section to
.init_task.data, so it doesn't get picked up by the linker script glob.

Since it causes the kernel not to boot up with mtd filesystems.

Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agoBlackfin arch: More explicitly describe what the instructions do in inline assembly.
Jie Zhang [Sat, 17 Nov 2007 16:00:10 +0000 (00:00 +0800)] 
Blackfin arch: More explicitly describe what the instructions do in inline assembly.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agoBlackfin arch: add AXIS AX88180 Gigabit Ethernet Hardware and Driver to board files
Michael Hennerich [Sat, 17 Nov 2007 15:56:08 +0000 (23:56 +0800)] 
Blackfin arch: add AXIS AX88180 Gigabit Ethernet Hardware and Driver to board files

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agoBlackfin arch: print out modules that are loaded if we get a kernel oops
Robin Getz [Sat, 17 Nov 2007 16:20:49 +0000 (00:20 +0800)] 
Blackfin arch: print out modules that are loaded if we get a kernel oops

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agoBlackfin arch: Add assembly function insl_16
Michael Hennerich [Sat, 17 Nov 2007 15:46:58 +0000 (23:46 +0800)] 
Blackfin arch: Add assembly function insl_16

/*
 * CPUs often take a performance hit when accessing unaligned memory
 * locations. The actual performance hit varies, it can be small if the
 * hardware handles it or large if we have to take an exception and fix
 * it
 * in software.
 *
 * Since an ethernet header is 14 bytes network drivers often end up
 * with
 * the IP header at an unaligned offset. The IP header can be aligned by
 * shifting the start of the packet by 2 bytes. Drivers should do this
 * with:
 *
 * skb_reserve(NET_IP_ALIGN);
 *
 * The downside to this alignment of the IP header is that the DMA is
 * now
 * unaligned. On some architectures the cost of an unaligned DMA is high
 * and this cost outweighs the gains made by aligning the IP header.
 *
 * Since this trade off varies between architectures, we allow
 * NET_IP_ALIGN
 * to be overridden.
 */

This new function insl_16 allows to read form 32-bit IO and writes to
16-bit aligned memory. This is useful in above described scenario -
In particular with the AXIS AX88180 Gigabit Ethernet MAC.
Once the device is in 32-bit mode, reads from the RX FIFO always
decrements 4bytes.
While on the other side the destination address in SDRAM is always
16-bit aligned.
If we use skb_reserve(0) the receive buffer is 32-bit aligned but later
we hit a unaligned exception in the IP code.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agoBlackfin arch: use do_div() for the 64bit division as pointed out by Bernd
Mike Frysinger [Fri, 23 Nov 2007 03:28:11 +0000 (11:28 +0800)] 
Blackfin arch: use do_div() for the 64bit division as pointed out by Bernd

If you need a 64 bit divide in the kernel, use asm/div64.h.
Revert the addition of udivdi3.

Cc: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agox86: reboot fixup for wrap2c board
Denys [Sat, 17 Nov 2007 15:27:02 +0000 (16:27 +0100)] 
x86: reboot fixup for wrap2c board

Needed to make the wireless board, WRAP2C reboot.

Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: check boundary in count setup resource
Yinghai Lu [Sat, 17 Nov 2007 15:27:01 +0000 (16:27 +0100)] 
x86: check boundary in count setup resource

need to check info->res_num less than PCI_BUS_NUM_RESOURCES, so
info->bus->resource[info->res_num] = res will not beyond of bus resource
array when acpi returns too many resource entries.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Gary Hade <gary.hade@us.ibm.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: fix reboot with no keyboard attached
Truxton Fulton [Sat, 17 Nov 2007 15:27:01 +0000 (16:27 +0100)] 
x86: fix reboot with no keyboard attached

Attempt to fix http://bugzilla.kernel.org/show_bug.cgi?id=8378

Hiroto Shibuya wrote to tell me that he has a VIA EPIA-EK10000 which
suffers from the reboot problem when no keyboard is attached.  My first
patch works for him:

  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=59f4e7d572980a521b7bdba74ab71b21f5995538

But the latest patch does not work for him :

  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b93789808756bcc1e5c90c99f1b1ef52f839a51

We found that it was necessary to also set the "disable keyboard" flag in
the command byte, as the first patch was doing.  The second patch tries to
minimally modify the command byte, but it is not enough.

Please consider this simple one-line patch to help people with low end VIA
motherboards reboot when no keyboard is attached.  Hiroto Shibuya has
verified that this works for him (as I no longer have an afflicted
machine).

Additional discussion:

Note that original patch from Truxton DOES
disable keyboard and this has been in main tree since 2.6.14, thus it must have
quite a bit of air time already.

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.14.y.git;a=commit;h=59f4e7d572980a521b7bdba74ab71b21f5995538

Note that he only mention "System flag" in the description and comment, but
in the code, "disable keyboard" flag is set.

  outb(0x14, 0x60);       /* set "System flag" */

In 2.6.23, he made a change to read the current byte and then mask the flags,
but along this change,  he only set the "System flag" and dropped the setting
of "disable keyboard" flag.

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.23.y.git;a=commit;h=8b93789808756bcc1e5c90c99f1b1ef52f839a51

   outb(cmd | 0x04, 0x60); /* set "System flag" */

So my request is to restore the setting of disable keyboard flag which has been
there since 2.6.14 but disappeared in 2.6.23.

Cc: Lee Garrett <lee-in-berlin@web.de>
Cc: "Hiroto Shibuya" <hiroto.shibuya@gmail.com>
Cc: Natalie Protasevich <protasnb@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Aristeu Rozanski <aris@ruivo.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: add hpet sanity checks
Thomas Gleixner [Fri, 16 Nov 2007 02:41:50 +0000 (21:41 -0500)] 
x86: add hpet sanity checks

Some BIOSes advertise HPET at 0x0. We really do no want to
allocate a resource there. Check for it and leave early.

Other BIOSes tell us the HPET is at 0xfed0000000000000
instead of 0xfed00000. Add a check and fix it up with a warning
on user request.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: on x86_64, correct reading of PC RTC when update in progress in time_64.c
David P. Reed [Thu, 15 Nov 2007 01:14:50 +0000 (20:14 -0500)] 
x86: on x86_64, correct reading of PC RTC when update in progress in time_64.c

Correct potentially unstable PC RTC time register reading in time_64.c

Stop the use of an incorrect technique for reading the standard PC RTC
timer, which is documented to "disconnect" time registers from the bus
while updates are in progress.  The use of UIP flag while interrupts
are disabled to protect a 244 microsecond window is one of the
Motorola spec sheet's documented ways to read the RTC time registers
reliably.

tglx: removed locking changes from original patch, as they gain nothing
(read_persistent_clock is only called during boot, suspend, resume - so
no hot path affected) and conflict with the paravirt locking scheme
(see 32bit code), which we do not want to complicate for no benefit.

Signed-off-by: David P. Reed <dpreed@reed.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: fix freeze in x86_64 RTC update code in time_64.c
David P. Reed [Wed, 14 Nov 2007 22:47:35 +0000 (17:47 -0500)] 
x86: fix freeze in x86_64 RTC update code in time_64.c

Fix hard freeze on x86_64 when the ntpd service calls
update_persistent_clock()

A repeatable but randomly timed freeze has been happening in Fedora 6
and 7 for the last year, whenever I run the ntpd service on my AMD64x2
HP Pavilion dv9000z laptop.  This freeze is due to the use of
spin_lock(&rtc_lock) under the assumption (per a bad comment) that
set_rtc_mmss is called only with interrupts disabled.  The call from
ntp.c to update_persistent_clock is made with interrupts enabled.

Signed-off-by: David P. Reed <dpreed@reed.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agontp: fix typo that makes sync_cmos_clock erratic
David P. Reed [Wed, 14 Nov 2007 22:49:21 +0000 (17:49 -0500)] 
ntp: fix typo that makes sync_cmos_clock erratic

Fix a typo in ntp.c that has caused updating of the persistent (RTC)
clock when synced to NTP to behave erratically.

When debugging a freeze that arises on my AMD64 machines when I
run the ntpd service, I added a number of printk's to monitor the
sync_cmos_clock procedure.  I discovered that it was not syncing to
cmos RTC every 11 minutes as documented, but instead would keep trying
every second for hours at a time.  The reason turned out to be a typo
in sync_cmos_clock, where it attempts to ensure that
update_persistent_clock is called very close to 500 msec. after a 1
second boundary (required by the PC RTC's spec). That typo referred to
"xtime" in one spot, rather than "now", which is derived from "xtime"
but not equal to it.  This makes the test erratic, creating a
"coin-flip" that decides when update_persistent_clock is called - when
it is called, which is rarely, it may be at any time during the one
second period, rather than close to 500 msec, so the value written is
needlessly incorrect, too.

Signed-off-by: David P. Reed
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agoRemove x86 merge artifact from top Makefile
Thomas Gleixner [Thu, 15 Nov 2007 06:11:12 +0000 (07:11 +0100)] 
Remove x86 merge artifact from top Makefile

The x86 merge modified the tags target to handle the two separate
source directories. Remove it now that i386/x86_64 are gone completely.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: fixup cpu_info array conversion
Thomas Gleixner [Sat, 17 Nov 2007 12:18:42 +0000 (13:18 +0100)] 
x86: fixup cpu_info array conversion

92cb7612aee39642d109b8d935ad265e602c0563 sets cpu_info->cpu_index to zero
for no reason. Referencing cpu_info->cpu_index now points always to CPU#0,
which is apparently not what we want.

Remove it.

Spotted-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: show cpuinfo only for online CPUs
Andreas Herrmann [Thu, 1 Nov 2007 18:32:17 +0000 (19:32 +0100)] 
x86: show cpuinfo only for online CPUs

Fix regressions introduced with 92cb7612aee39642d109b8d935ad265e602c0563.

It can happen that cpuinfo is displayed for CPUs that are not online or
even worse for CPUs not present at all. As an example, following was
shown for a "second" CPU of a single core K8 variant:

    processor       : 0
    vendor_id       : unknown
    cpu family      : 0
    model           : 0
    model name      : unknown
    stepping        : 0
    cache size      : 0 KB
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 0
    wp              : yes
    flags           :
    bogomips        : 0.00
    clflush size    : 0
    cache_alignment : 0
    address sizes   : 0 bits physical, 0 bits virtual
    power management:

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: fix cpu-hotplug regression
Andreas Herrmann [Wed, 7 Nov 2007 01:12:58 +0000 (02:12 +0100)] 
x86: fix cpu-hotplug regression

Commit d435d862baca3e25e5eec236762a43251b1e7ffc
("cpu hotplug: mce: fix cpu hotplug error handling")
changed the error handling in mce_cpu_callback.

In cases where not all CPUs are brought up during
boot (e.g. using maxcpus and additional_cpus parameters)
mce_cpu_callback now returns NOTFIY_BAD because
for such CPUs cpu_data is not completely filled when
the notifier is called. Thus mce_create_device fails right
at its beginning:

        if (!mce_available(&cpu_data[cpu]))
                return -EIO;

As a quick fix I suggest to check boot_cpu_data for MCE.

To reproduce this regression:

(1) boot with maxcpus=2 addtional_cpus=2 on a 4 CPU x86-64 system
(2) # echo 1 >/sys/devices/system/cpu/cpu2/online
  -bash: echo: write error: Invalid argument

dmesg shows:

_cpu_up: attempt to bring up CPU 2 failed

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: ignore the sys_getcpu() tcache parameter
Ingo Molnar [Wed, 7 Nov 2007 17:37:48 +0000 (18:37 +0100)] 
x86: ignore the sys_getcpu() tcache parameter

dont use the vgetcpu tcache - it's causing problems with tasks
migrating, they'll see the old cache up to a jiffy after the
migration, further increasing the costs of the migration.

In the worst case they see a complete bogus information from
the tcache, when a sys_getcpu() call "invalidated" the cache
info by incrementing the jiffies _and_ the cpuid info in the
cache and the following vdso_getcpu() call happens after
vdso_jiffies have been incremented.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: voyager use correct header file name
Randy Dunlap [Mon, 12 Nov 2007 05:06:02 +0000 (21:06 -0800)] 
x86: voyager use correct header file name

Fix header file name for Voyager build.

In file included from arch/x86/kernel/setup_32.c:61:
include/asm-x86/mach-voyager/setup_arch.h:2:26: error: asm/setup_32.h: No such file or directory
make[1]: *** [arch/x86/kernel/setup_32.o] Error 1

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: fix smp init sections
Randy Dunlap [Mon, 12 Nov 2007 05:06:45 +0000 (21:06 -0800)] 
x86: fix smp init sections

Fix Voyager section mismatch due to using __devinit instead of __cpuinit.

WARNING: vmlinux.o(.text+0xd943): Section mismatch: reference to .init.text:init_gdt (between 'voyager_smp_prepare_boot_cpu' and 'smp_vic_cmn_interrupt')

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: fix voyager_cat_init section
Randy Dunlap [Mon, 12 Nov 2007 05:06:23 +0000 (21:06 -0800)] 
x86: fix voyager_cat_init section

Fix Voyager section mismatches:  voyager_cat_init() should be __init.

WARNING: vmlinux.o(.text+0xee83): Section mismatch: reference to .init.data:eprom_buf (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xeea6): Section mismatch: reference to .init.data: (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xeeac): Section mismatch: reference to .init.data: (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xeeb2): Section mismatch: reference to .init.data: (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xef4c): Section mismatch: reference to .init.data: (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xef56): Section mismatch: reference to .init.data: (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xf10f): Section mismatch: reference to .init.data:eprom_buf (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xf13b): Section mismatch: reference to .init.data: (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xf14b): Section mismatch: reference to .init.data: (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xf159): Section mismatch: reference to .init.data: (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xf1b1): Section mismatch: reference to .init.data:eprom_buf (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xf1bb): Section mismatch: reference to .init.data: (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xf1c1): Section mismatch: reference to .init.data:eprom_buf (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xf1c7): Section mismatch: reference to .init.data:eprom_buf (between 'voyager_cat_init' and 'aes_enc_blk')
WARNING: vmlinux.o(.text+0xf1e6): Section mismatch: reference to .init.data: (between 'voyager_cat_init' and 'aes_enc_blk')

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: fix bogus memcpy in es7000_check_dsdt()
Thomas Gleixner [Wed, 14 Nov 2007 12:20:48 +0000 (13:20 +0100)] 
x86: fix bogus memcpy in es7000_check_dsdt()

es7000_check_dst() contains a memcpy from 0, which probably should have been
a memset. Remove it and check the retunr value from acpi_get_table_header.

Noticed by: Joe Perches <joe@perches.com>

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agoBlackfin arch: fix spurious newline in header
Mike Frysinger [Sat, 17 Nov 2007 15:24:07 +0000 (23:24 +0800)] 
Blackfin arch: fix spurious newline in header

Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agoBlackfin arch: unexport get_wchan
Adrian Bunk [Sat, 17 Nov 2007 15:05:06 +0000 (23:05 +0800)] 
Blackfin arch: unexport get_wchan

The only user of get_wchan I was able to find is the proc fs - and proc
can't be built modular.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agoBlackfin arch: remove dump_thread()
Adrian Bunk [Sat, 17 Nov 2007 16:41:56 +0000 (00:41 +0800)] 
Blackfin arch: remove dump_thread()

The only user is the a.out support.

It was therefore removed prior to the blackfin merge from all
architectures not supporting a.out.

Currently, Blackfin doesn't suppport a.out.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agoBlackfin arch: Typo: "CONFIG_RTC_BFIN_MODULE" -> "CONFIG_RTC_DRV_BFIN_MODULE"
Robert P. J. Day [Sat, 17 Nov 2007 14:57:03 +0000 (22:57 +0800)] 
Blackfin arch: Typo: "CONFIG_RTC_BFIN_MODULE" -> "CONFIG_RTC_DRV_BFIN_MODULE"

i'm *reasonably* confident that this is a typo that should be fixed.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
16 years agoLinux 2.6.24-rc3 v2.6.24-rc3
Linus Torvalds [Sat, 17 Nov 2007 05:16:36 +0000 (21:16 -0800)] 
Linux 2.6.24-rc3

16 years agoACPI: Enable MSR (FixedHW) support for T-States
Zhao Yakui [Thu, 15 Nov 2007 09:06:36 +0000 (17:06 +0800)] 
ACPI: Enable MSR (FixedHW) support for T-States

Add throttling control via MSR when T-states uses
the FixHW Control Status registers.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: Get throttling info from BIOS only after evaluating _PDC
Zhao Yakui [Thu, 15 Nov 2007 09:05:46 +0000 (17:05 +0800)] 
ACPI: Get throttling info from BIOS only after evaluating _PDC

Previously _PDC was evaluated later, and thus we'd not get
the chance to tell the BIOS that we can suport FixedHW registers (MSRs)
and the BIOS would always ask us to use System I/O access
for throttling.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: Use _TSS for throttling control, when present. Add error checks.
Zhao Yakui [Thu, 15 Nov 2007 09:05:05 +0000 (17:05 +0800)] 
ACPI: Use _TSS for throttling control, when present. Add error checks.

_TSS was erroneously ignored, in favor of the FADT.

When TSS is used, the access width is included in the PTC control/status
register.  So it is unnecessary that the access bit width is multiplied by 8.
At the same time the bit_offset should be considered for system I/O Access.

It should be checked the bit_width and bit_offset of PTC regsiter in order to
avoid the failure of system I/O access. It means that bit_width plus
bit_offset can't be greater than 32.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: throttle: Change internal APIs better handle _PTC
Zhao Yakui [Thu, 15 Nov 2007 09:03:46 +0000 (17:03 +0800)] 
ACPI: throttle: Change internal APIs better handle _PTC

Change the function interface for throttling control via PTC.
The following functions are concerned:

acpi_read_throttling_status()
acpi_write_throttling_state()
acpi_get_throttling_value()
acpi_get_throttling_state()

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>