Dave Jones [Fri, 7 May 2004 16:40:59 +0000 (17:40 +0100)]
[CPUFREQ] arm-integrator ->get() implementation
arm-integrator had its ->get() implementation inside
integrator_cpufreq_init(). Move it to an extra function,
and add it as ->get() function.
Dave Jones [Fri, 7 May 2004 16:32:21 +0000 (17:32 +0100)]
[CPUFREQ] Add p4-clockmod ->get
p4-clockmod is a bit more complicated as it might run on SMP, HT, and
the instructions need to run on the specific (physical) CPU.
Dave Jones [Fri, 7 May 2004 16:31:46 +0000 (17:31 +0100)]
[CPUFREQ] Add longrun ->get
Longrun users might be interested in their CPU's current frequency as
well, so use a longrun-specific cpuid-call in longrun_get().
Dave Jones [Fri, 7 May 2004 16:17:28 +0000 (17:17 +0100)]
[CPUFREQ] Handle CPUFREQ_RESUMECHANGE notifications
Notifications in i386, sparc64, x86_64, sh-sci and sa11xx-pcmcia notifiers.
sa1100-framebuffer doesn't seem to be able to handle frequency transitions
behind its back well. So, sa11xx will be marked
CPUFREQ_PANIC_OUTOFSYNC | CPUFREQ_PANIC_RESUME_OUTOFSYNC later.
Dave Jones [Fri, 7 May 2004 16:11:44 +0000 (17:11 +0100)]
[CPUFREQ] Fix 'out of sync' issue.
Sometimes we might discover during a call to cpufreq_get() that we're "out of sync",
meaning the actual CPU frequency changed "behind our back". If this happens, the flag
CPUFREQ_PANIC_OUTOFSYNC decides what can be done: if it is set, the kernel panic's,
it it is not set, the cpufreq transition notifiers are informed of this change, and
a call to cpufreq_update_policy() is scheduled [using the default workqueue] so that
the user-defined values override BIOS / external interaction.
Dave Jones [Fri, 7 May 2004 16:08:05 +0000 (17:08 +0100)]
[CPUFREQ] Move cpufreq_get() from the userspace governor to the core.
Contrary to the previous implementation, it now calls the cpufreq driver,
and reads out the _actual_ current frequency, and not the frequency the
CPUfreq core _thinks_ the CPU is running at. Most cpufreq drivers do provide
such a "hw get" function (only ACPI-io can definitely not be supported,
I'm not sure about sh, sparc64 and powermac) anyway, and it is useful for
other issues.
Dave Jones [Fri, 7 May 2004 16:06:16 +0000 (17:06 +0100)]
[CPUFREQ] Export scaling cur frequencies
Many users want to know the current cpu freqeuncy, even if not using
the userspace frequency. On ->target cpufreq drivers (if they do their
calls to cpufreq_notify_transition correctly) this just means reading
out cpufreq_policy->cur.
Dave Jones [Thu, 22 Apr 2004 17:01:36 +0000 (18:01 +0100)]
[CPUFREQ] powernow-k8 cpuid changes.
cpuid changes to support new processors that will be coming out in the
future. Also works around a processor that we have released to the field
that can have an erroneous cpuid value.
Dave Jones [Wed, 21 Apr 2004 20:49:59 +0000 (21:49 +0100)]
[CPUFREQ] Fix security hole in proc handler.
Brad Spengler <spender@grsecurity.net> found an exploitable bug in the proc handler
of cpufreq, where a user-supplied unsigned int is cast to a signed int and then
passed on to copy_[to|from]_user() allowing arbitary amounts of memory to be written
(root only thankfully), or read (as any user).
The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned
the name CAN-2004-0228 to this issue.
Dave Jones [Wed, 21 Apr 2004 20:18:57 +0000 (21:18 +0100)]
[CPUFREQ] Make an educated guess at the current P-state in the ACPI driver.
One big limitation of the ACPI specification is that it's impossible to
detect the current P-State by reading from ACPI-defined registers. And the
CPU isn't always at P0 when the system boots. So, try to "guess" the current
P-State by analyzing cpu_khz.
Dave Jones [Wed, 21 Apr 2004 18:58:29 +0000 (19:58 +0100)]
[CPUFREQ] Remove redundant part of powernow-k7 module parm
If used as a bootparam, this would've become powernow-k7.powernow_acpi_force which looks silly.
Dave Jones [Mon, 19 Apr 2004 10:23:44 +0000 (11:23 +0100)]
[CPUFREQ] Fix broken cast.
This breaks on x86-64 with the following warning.
drivers/cpufreq/cpufreq_userspace.c: In function `cpufreq_procctl':
drivers/cpufreq/cpufreq_userspace.c:170: warning: cast from pointer to integer of different size
drivers/cpufreq/cpufreq_userspace.c: In function `cpufreq_sysctl':
drivers/cpufreq/cpufreq_userspace.c:208: warning: cast from pointer to integer of different size
Dave Jones [Wed, 14 Apr 2004 23:22:30 +0000 (00:22 +0100)]
[CPUFREQ] powernow-k7 ACPI->PST values were a factor of 10 off.
As much as I like the idea of a 13GHz laptop, setting it to 1.3GHz is probably
for the best for the time being.
Dave Jones [Wed, 14 Apr 2004 14:26:15 +0000 (15:26 +0100)]
[CPUFREQ] powernow-k7 ACPI integration.
More from Bruno Ducrot.
Warning: it will only half work on the ACER Aspire, though: there is
no pstate in the DSDT corresponding to the max frequency...
I'm looking how to handle that correctly, probably at the init stage,
if the max frequency is not given, then add it to powernow_table.
* Integrate acpi perflib from Dominik.
* Use acpi if the PST tables are known to be broken (ASUS Aspire match one PST,
but give brain damaged values), or use ACPI if no PST found.
Dave Jones [Wed, 14 Apr 2004 12:49:47 +0000 (13:49 +0100)]
Merge delerium.codemonkey.org.uk:/mnt/nfs/sepia/bar/src/kernel/2.6/trees/bk-linus
into delerium.codemonkey.org.uk:/mnt/nfs/sepia/bar/src/kernel/2.6/trees/cpufreq
Dave Jones [Wed, 14 Apr 2004 12:40:42 +0000 (13:40 +0100)]
[CPUFREQ] Correcting SGTC. Timer is based upon FSB
From: Bruno Ducrot <ducrot@poupinou.org>
I think this patch is needed especially if the FSB is around 166MHz or
200MHz, or else I believe we get instabilities on some K7's motherboard
powernow capable (it's called Cool'n Quiet IIRC).
* Deduce fsb from cpu_khz and the max multiplier. It will be given as kHz now,
so that frequency associated to a multiplier will be computate more
accurately. Also, we need it for SGTC (see below).
* Fix how cpuid is computed in powernow_decode_bios().
* Be more restrictive for PST. It may be possible (on desktop shipped with
low power Athlon models) that FSB can be changed by dip switchs on
motherboard for example.
* Fix computation for SGTC. It use the bus timer (and then the bus
frequency given by fsb).
Andrew Morton [Tue, 13 Apr 2004 02:26:22 +0000 (19:26 -0700)]
[PATCH] ppc64: Fix ibmveth.c compilation
From: Paul Mackerras <paulus@samba.org>
This patch changes PCI_DMA_TODEVICE to DMA_TO_DEVICE in a couple of
places in drivers/net/ibmveth.c, since it doesn't compile without this
change and it does compile with it. It also reformats a couple of
over-long lines in the vicinity of the other changes.
Andrew Morton [Tue, 13 Apr 2004 02:24:35 +0000 (19:24 -0700)]
[PATCH] Wrong return value in hfs_fill_super
From: Nick Wellnhofer <wellnhofer@aevum.de>
hfs_fill_super in 2.6.5 returns -EIO instead of -EINVAL if a valid supe=
block isn't found. So mount_block_root in init/do_mounts.c bails out before
trying to mount the root device as XFS.
Andrew Morton [Tue, 13 Apr 2004 02:24:22 +0000 (19:24 -0700)]
[PATCH] m68knommu: fixes to the 68328 DragonBall serial driver
From: <gerg@snapgear.com>
A few fixes for the 68328 "DragonBall" serial driver:
. use irqreturn_t for interrupt handlers
. correct a few variable types (stop compiler warnings)
. correctly use return values from put_user(), get_user() and copy_to_user()
Andrew Morton [Tue, 13 Apr 2004 02:24:08 +0000 (19:24 -0700)]
[PATCH] m68knommu: fixes to the ColdFire serial driver
From: <gerg@snapgear.com>
A whole bunch of fixes for the ColdFire serial driver:
. remove unused CONFIG_LEDMAN code
. reformat port definitions to new style structure init
. change "addr" field type to reduce casting in ColdFire serial driver
. cleanup locking problems in mcfrs_write().
. implement fraction baud rate clock support for hardware that
supports it (namely the ColdFire 5272)
. implement wait_until_sent, some ColdFire parts of hardware support
for this (again the 5272).
. correctly use return values from put_user(), get_user() and copy_to_user()
Andrew Morton [Tue, 13 Apr 2004 02:22:50 +0000 (19:22 -0700)]
[PATCH] fix vga16fb.c frame buffer bad memory mapping
From: Vincent Sanders <vince@kyllikki.org>
The vga16fb driver uses a direct ioremap on 0xa00000 to gain access to the
vga card. This is wrong on architectures other than x86, every other driver
uses VGA_MAP_MEM macro from vga.h to ensure the correct memory mapping.
Andrew Morton [Tue, 13 Apr 2004 02:22:37 +0000 (19:22 -0700)]
[PATCH] shrink VFS hash sizes on small machines
From: Matt Mackall <mpm@selenic.com>
Base hash sizes on available memory rather than total memory. An
additional 50% above current used memory is considered reserved for the
purposes of hash sizing to compensate for the hashes themselves and the
remainder of kernel and userspace initialization.
Andrew Morton [Tue, 13 Apr 2004 02:21:59 +0000 (19:21 -0700)]
[PATCH] kbuild: Create .tmp_versions when building external modules
From: Sam Ravnborg <sam@ravnborg.org>
When building external modules the $PWD/.tmp_versions directory is used.
The .tmp_versions directory in the kernel tree cannot be used because this
would clutter up the kernel tree especially when more than one external
module is being build for the same kernel tree.
This patch make sure to create $PWD/.tmp_versions, and to delete it during
make clean. It also removes warning about 'messed with SUBDIRS', this is
no longer relevant when .tmp_versions is made outside the kernel tree.
M68k TLB fixes from Roman Zippel:
- Check current->active_mm for currently active mm
- Set correct context to flush the right ATC entry
This is especially important for kswapd to correctly flush unmapped entries (it
caused random segfaults during large compiles)
Randy Dunlap [Mon, 12 Apr 2004 19:03:14 +0000 (20:03 +0100)]
[ARM] use errno #defines in assembly
Patch from: Randy Dunlap
From: Danilo Piazzalunga
Some assembly code (on various archs) either
1. uses hardcoded errno numbers instead of the canonical macro
names, or
2. defines them locally, instead of including the appropriate
header (while including other headers).
This patch "fixes" such usage in
- getuser.S for arm
- putuser.S for arm
Andrew Morton [Mon, 12 Apr 2004 08:07:11 +0000 (01:07 -0700)]
[PATCH] Oprofile: ARM/XScale PMU driver
From: Zwane Mwaikambo <zwane@linuxpower.ca>
The following patch adds support for the XScale performance monitoring unit
to OProfile. It uses not only the performance monitoring counters, but
also the clock cycle counter (CCNT) allowing for upto 5 usable counters.
The code has been developed and tested on an IOP331 (hardware courtesy of
Intel) therefore i haven't been able to test it on XScale PMU1 systems.
Testing on said systems would be appreciated, and if done, please uncomment
the #define DEBUG line at the top of op_model_xscale.c
OProfile userspace support has already been committed and should be
available via CVS.
Andrew Morton [Mon, 12 Apr 2004 08:06:06 +0000 (01:06 -0700)]
[PATCH] Add CONFIG_SYSFS
From: Patrick Mochel <mochel@digitalimplant.org>
Here is a patch to make sysfs optional. Note that with CONFIG_SYSFS=n you
must specify the boot device's major:minor on the kernel boot command line
with
root=03:01
For embedded systems, it will save a significant amount of memory during
runtime. And, it saves 4k from the built kernel image for me.
Andrew Morton [Mon, 12 Apr 2004 08:05:52 +0000 (01:05 -0700)]
[PATCH] parport: no procfs warning fix
drivers/parport/procfs.c: In function `parport_default_proc_unregister':
drivers/parport/procfs.c:529: warning: `return' with a value, in function returning void
Andrew Morton [Mon, 12 Apr 2004 08:05:40 +0000 (01:05 -0700)]
[PATCH] kbuild: external module support
From: Sam Ravnborg <sam@ravnborg.org>
Based on initial patch from Andreas Gruenbacher there is now better support
for building external modules with kbuild.
The preferred syntax is now:
make -C $KERNELSRC M=$PWD
but the old syntax:
make -C $KERNELSRC SUBDIRS=$PWD modules
will remain supported.
The major differences compared to before are that:
1) No attempt is made to neither check nor update any files in $KERNELSRC
2) Module versions are now supported
During stage 2 of kernel compilation where the modules are built, a new file
Module.symvers is created. This file contains the version for all symbols
exported by the kernel and any module compiled within the kernel tree.
When the external module is build the Module.symvers file is being read and
symbol versions are used from that file.
The purpose of avoiding any updates in the kernel src is that usually in a
distribution the kernel src will be read-only, and there is no need to try to
update it. And when building an external module the focus is on the module,
not the kernel.
I expect the distributions will start using something like this:
kernel src - with no generated files. Not even .config:
/usr/src/linux-<version>
Output from build:
/lib/modules/linux-<version>/build
where build is a real directory with relevant output files and the
appropriate .config.
I have some Documentation in the pipe-line, but wants to see how this
approach is received before completing it.
This patch is made on top of the previously posted patch to divide
make clean in three steps.
And you may need to edit the following line in the patch to make it apply:
%docs: scripts_basic FORCE
to
%docs: scripts FORCE
Andrew Morton [Mon, 12 Apr 2004 08:05:26 +0000 (01:05 -0700)]
[PATCH] kbuild: cleaning in three steps
From: Sam Ravnborg <sam@ravnborg.org>
Previously 'make clean' deleted all automatically generated files. The
following patch revert this behaviour, and now 'make clean' leaves enough
behind to allow external modules to be built.
The cleaning is now done in three steps:
make clean - delete everything not needed for building external modules
make mrproper - delete all generated files, including .config
make distclean - delete all temporary files such as *.orig, *~, *.rej etc.
This fixes reports about nvidia and vmware build issues.
Andrew Morton [Mon, 12 Apr 2004 08:05:14 +0000 (01:05 -0700)]
[PATCH] Make %docs depend on scripts_basic
From: Sam Ravnborg <sam@ravnborg.org>
From: Herbert Xu <herbert@gondor.apana.org.au>
It seems that the %docs targets only needs scripts_basic. The following
patch does just that. This removes its dependency on the existence of a
.config file.