You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'master' into upstream
This commit is contained in:
@@ -153,10 +153,13 @@ scaling_governor, and by "echoing" the name of another
|
||||
that some governors won't load - they only
|
||||
work on some specific architectures or
|
||||
processors.
|
||||
scaling_min_freq and
|
||||
scaling_min_freq and
|
||||
scaling_max_freq show the current "policy limits" (in
|
||||
kHz). By echoing new values into these
|
||||
files, you can change these limits.
|
||||
NOTE: when setting a policy you need to
|
||||
first set scaling_max_freq, then
|
||||
scaling_min_freq.
|
||||
|
||||
|
||||
If you have selected the "userspace" governor which allows you to
|
||||
|
||||
@@ -211,9 +211,8 @@ Controls the kernel's behaviour when an oops or BUG is encountered.
|
||||
|
||||
0: try to continue operation
|
||||
|
||||
1: delay a few seconds (to give klogd time to record the oops output) and
|
||||
then panic. If the `panic' sysctl is also non-zero then the machine will
|
||||
be rebooted.
|
||||
1: panic immediatly. If the `panic' sysctl is also non-zero then the
|
||||
machine will be rebooted.
|
||||
|
||||
==============================================================
|
||||
|
||||
|
||||
+15
@@ -298,6 +298,13 @@ L: info-linux@geode.amd.com
|
||||
W: http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
|
||||
S: Supported
|
||||
|
||||
AOA (Apple Onboard Audio) ALSA DRIVER
|
||||
P: Johannes Berg
|
||||
M: johannes@sipsolutions.net
|
||||
L: linuxppc-dev@ozlabs.org
|
||||
L: alsa-devel@alsa-project.org
|
||||
S: Maintained
|
||||
|
||||
APM DRIVER
|
||||
P: Stephen Rothwell
|
||||
M: sfr@canb.auug.org.au
|
||||
@@ -2659,6 +2666,14 @@ M: dbrownell@users.sourceforge.net
|
||||
L: spi-devel-general@lists.sourceforge.net
|
||||
S: Maintained
|
||||
|
||||
STABLE BRANCH:
|
||||
P: Greg Kroah-Hartman
|
||||
M: greg@kroah.com
|
||||
P: Chris Wright
|
||||
M: chrisw@sous-sol.org
|
||||
L: stable@kernel.org
|
||||
S: Maintained
|
||||
|
||||
TPM DEVICE DRIVER
|
||||
P: Kylene Hall
|
||||
M: kjhall@us.ibm.com
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
VERSION = 2
|
||||
PATCHLEVEL = 6
|
||||
SUBLEVEL = 18
|
||||
EXTRAVERSION = -rc3
|
||||
EXTRAVERSION = -rc4
|
||||
NAME=Crazed Snow-Weasel
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
||||
@@ -96,6 +96,7 @@ config X86_POWERNOW_K8_ACPI
|
||||
|
||||
config X86_GX_SUSPMOD
|
||||
tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation"
|
||||
depends on PCI
|
||||
help
|
||||
This add the CPUFreq driver for NatSemi Geode processors which
|
||||
support suspend modulation.
|
||||
@@ -202,7 +203,7 @@ config X86_LONGRUN
|
||||
config X86_LONGHAUL
|
||||
tristate "VIA Cyrix III Longhaul"
|
||||
select CPU_FREQ_TABLE
|
||||
depends on BROKEN
|
||||
depends on ACPI_PROCESSOR
|
||||
help
|
||||
This adds the CPUFreq driver for VIA Samuel/CyrixIII,
|
||||
VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T
|
||||
|
||||
@@ -384,8 +384,7 @@ static int acpi_cpufreq_early_init_acpi(void)
|
||||
}
|
||||
|
||||
/* Do initialization in ACPI core */
|
||||
acpi_processor_preregister_performance(acpi_perf_data);
|
||||
return 0;
|
||||
return acpi_processor_preregister_performance(acpi_perf_data);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -29,11 +29,13 @@
|
||||
#include <linux/cpufreq.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
#include <asm/msr.h>
|
||||
#include <asm/timex.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/acpi.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <acpi/processor.h>
|
||||
|
||||
#include "longhaul.h"
|
||||
|
||||
@@ -56,6 +58,8 @@ static int minvid, maxvid;
|
||||
static unsigned int minmult, maxmult;
|
||||
static int can_scale_voltage;
|
||||
static int vrmrev;
|
||||
static struct acpi_processor *pr = NULL;
|
||||
static struct acpi_processor_cx *cx = NULL;
|
||||
|
||||
/* Module parameters */
|
||||
static int dont_scale_voltage;
|
||||
@@ -118,84 +122,65 @@ static int longhaul_get_cpu_mult(void)
|
||||
return eblcr_table[invalue];
|
||||
}
|
||||
|
||||
/* For processor with BCR2 MSR */
|
||||
|
||||
static void do_powersaver(union msr_longhaul *longhaul,
|
||||
unsigned int clock_ratio_index)
|
||||
static void do_longhaul1(int cx_address, unsigned int clock_ratio_index)
|
||||
{
|
||||
struct pci_dev *dev;
|
||||
unsigned long flags;
|
||||
unsigned int tmp_mask;
|
||||
int version;
|
||||
int i;
|
||||
u16 pci_cmd;
|
||||
u16 cmd_state[64];
|
||||
union msr_bcr2 bcr2;
|
||||
u32 t;
|
||||
|
||||
switch (cpu_model) {
|
||||
case CPU_EZRA_T:
|
||||
version = 3;
|
||||
break;
|
||||
case CPU_NEHEMIAH:
|
||||
version = 0xf;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
|
||||
longhaul->bits.SoftBusRatio = clock_ratio_index & 0xf;
|
||||
longhaul->bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
|
||||
longhaul->bits.EnableSoftBusRatio = 1;
|
||||
longhaul->bits.RevisionKey = 0;
|
||||
|
||||
preempt_disable();
|
||||
local_irq_save(flags);
|
||||
|
||||
/*
|
||||
* get current pci bus master state for all devices
|
||||
* and clear bus master bit
|
||||
*/
|
||||
dev = NULL;
|
||||
i = 0;
|
||||
do {
|
||||
dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
|
||||
if (dev != NULL) {
|
||||
pci_read_config_word(dev, PCI_COMMAND, &pci_cmd);
|
||||
cmd_state[i++] = pci_cmd;
|
||||
pci_cmd &= ~PCI_COMMAND_MASTER;
|
||||
pci_write_config_word(dev, PCI_COMMAND, pci_cmd);
|
||||
}
|
||||
} while (dev != NULL);
|
||||
|
||||
tmp_mask=inb(0x21); /* works on C3. save mask. */
|
||||
outb(0xFE,0x21); /* TMR0 only */
|
||||
outb(0xFF,0x80); /* delay */
|
||||
rdmsrl(MSR_VIA_BCR2, bcr2.val);
|
||||
/* Enable software clock multiplier */
|
||||
bcr2.bits.ESOFTBF = 1;
|
||||
bcr2.bits.CLOCKMUL = clock_ratio_index;
|
||||
|
||||
/* Sync to timer tick */
|
||||
safe_halt();
|
||||
wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
|
||||
halt();
|
||||
ACPI_FLUSH_CPU_CACHE();
|
||||
/* Change frequency on next halt or sleep */
|
||||
wrmsrl(MSR_VIA_BCR2, bcr2.val);
|
||||
/* Invoke C3 */
|
||||
inb(cx_address);
|
||||
/* Dummy op - must do something useless after P_LVL3 read */
|
||||
t = inl(acpi_fadt.xpm_tmr_blk.address);
|
||||
|
||||
/* Disable software clock multiplier */
|
||||
local_irq_disable();
|
||||
rdmsrl(MSR_VIA_BCR2, bcr2.val);
|
||||
bcr2.bits.ESOFTBF = 0;
|
||||
wrmsrl(MSR_VIA_BCR2, bcr2.val);
|
||||
}
|
||||
|
||||
outb(tmp_mask,0x21); /* restore mask */
|
||||
/* For processor with Longhaul MSR */
|
||||
|
||||
/* restore pci bus master state for all devices */
|
||||
dev = NULL;
|
||||
i = 0;
|
||||
do {
|
||||
dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
|
||||
if (dev != NULL) {
|
||||
pci_cmd = cmd_state[i++];
|
||||
pci_write_config_byte(dev, PCI_COMMAND, pci_cmd);
|
||||
}
|
||||
} while (dev != NULL);
|
||||
local_irq_restore(flags);
|
||||
preempt_enable();
|
||||
static void do_powersaver(int cx_address, unsigned int clock_ratio_index)
|
||||
{
|
||||
union msr_longhaul longhaul;
|
||||
u32 t;
|
||||
|
||||
/* disable bus ratio bit */
|
||||
rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
|
||||
longhaul->bits.EnableSoftBusRatio = 0;
|
||||
longhaul->bits.RevisionKey = version;
|
||||
wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
|
||||
rdmsrl(MSR_VIA_LONGHAUL, longhaul.val);
|
||||
longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
|
||||
longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf;
|
||||
longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
|
||||
longhaul.bits.EnableSoftBusRatio = 1;
|
||||
|
||||
/* Sync to timer tick */
|
||||
safe_halt();
|
||||
ACPI_FLUSH_CPU_CACHE();
|
||||
/* Change frequency on next halt or sleep */
|
||||
wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
|
||||
/* Invoke C3 */
|
||||
inb(cx_address);
|
||||
/* Dummy op - must do something useless after P_LVL3 read */
|
||||
t = inl(acpi_fadt.xpm_tmr_blk.address);
|
||||
|
||||
/* Disable bus ratio bit */
|
||||
local_irq_disable();
|
||||
longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
|
||||
longhaul.bits.EnableSoftBusRatio = 0;
|
||||
longhaul.bits.EnableSoftBSEL = 0;
|
||||
longhaul.bits.EnableSoftVID = 0;
|
||||
wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,9 +194,9 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
|
||||
{
|
||||
int speed, mult;
|
||||
struct cpufreq_freqs freqs;
|
||||
union msr_longhaul longhaul;
|
||||
union msr_bcr2 bcr2;
|
||||
static unsigned int old_ratio=-1;
|
||||
unsigned long flags;
|
||||
unsigned int pic1_mask, pic2_mask;
|
||||
|
||||
if (old_ratio == clock_ratio_index)
|
||||
return;
|
||||
@@ -234,6 +219,20 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
|
||||
dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
|
||||
fsb, mult/10, mult%10, print_speed(speed/1000));
|
||||
|
||||
preempt_disable();
|
||||
local_irq_save(flags);
|
||||
|
||||
pic2_mask = inb(0xA1);
|
||||
pic1_mask = inb(0x21); /* works on C3. save mask. */
|
||||
outb(0xFF,0xA1); /* Overkill */
|
||||
outb(0xFE,0x21); /* TMR0 only */
|
||||
|
||||
/* Disable bus master arbitration */
|
||||
if (pr->flags.bm_check) {
|
||||
acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1,
|
||||
ACPI_MTX_DO_NOT_LOCK);
|
||||
}
|
||||
|
||||
switch (longhaul_version) {
|
||||
|
||||
/*
|
||||
@@ -245,20 +244,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
|
||||
*/
|
||||
case TYPE_LONGHAUL_V1:
|
||||
case TYPE_LONGHAUL_V2:
|
||||
rdmsrl (MSR_VIA_BCR2, bcr2.val);
|
||||
/* Enable software clock multiplier */
|
||||
bcr2.bits.ESOFTBF = 1;
|
||||
bcr2.bits.CLOCKMUL = clock_ratio_index;
|
||||
local_irq_disable();
|
||||
wrmsrl (MSR_VIA_BCR2, bcr2.val);
|
||||
safe_halt();
|
||||
|
||||
/* Disable software clock multiplier */
|
||||
rdmsrl (MSR_VIA_BCR2, bcr2.val);
|
||||
bcr2.bits.ESOFTBF = 0;
|
||||
local_irq_disable();
|
||||
wrmsrl (MSR_VIA_BCR2, bcr2.val);
|
||||
local_irq_enable();
|
||||
do_longhaul1(cx->address, clock_ratio_index);
|
||||
break;
|
||||
|
||||
/*
|
||||
@@ -273,10 +259,22 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
|
||||
* to work in practice.
|
||||
*/
|
||||
case TYPE_POWERSAVER:
|
||||
do_powersaver(&longhaul, clock_ratio_index);
|
||||
do_powersaver(cx->address, clock_ratio_index);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Enable bus master arbitration */
|
||||
if (pr->flags.bm_check) {
|
||||
acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0,
|
||||
ACPI_MTX_DO_NOT_LOCK);
|
||||
}
|
||||
|
||||
outb(pic2_mask,0xA1); /* restore mask */
|
||||
outb(pic1_mask,0x21);
|
||||
|
||||
local_irq_restore(flags);
|
||||
preempt_enable();
|
||||
|
||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||
}
|
||||
|
||||
@@ -324,9 +322,11 @@ static int guess_fsb(void)
|
||||
static int __init longhaul_get_ranges(void)
|
||||
{
|
||||
unsigned long invalue;
|
||||
unsigned int multipliers[32]= {
|
||||
50,30,40,100,55,35,45,95,90,70,80,60,120,75,85,65,
|
||||
-1,110,120,-1,135,115,125,105,130,150,160,140,-1,155,-1,145 };
|
||||
unsigned int ezra_t_multipliers[32]= {
|
||||
90, 30, 40, 100, 55, 35, 45, 95,
|
||||
50, 70, 80, 60, 120, 75, 85, 65,
|
||||
-1, 110, 120, -1, 135, 115, 125, 105,
|
||||
130, 150, 160, 140, -1, 155, -1, 145 };
|
||||
unsigned int j, k = 0;
|
||||
union msr_longhaul longhaul;
|
||||
unsigned long lo, hi;
|
||||
@@ -355,13 +355,13 @@ static int __init longhaul_get_ranges(void)
|
||||
invalue = longhaul.bits.MaxMHzBR;
|
||||
if (longhaul.bits.MaxMHzBR4)
|
||||
invalue += 16;
|
||||
maxmult=multipliers[invalue];
|
||||
maxmult=ezra_t_multipliers[invalue];
|
||||
|
||||
invalue = longhaul.bits.MinMHzBR;
|
||||
if (longhaul.bits.MinMHzBR4 == 1)
|
||||
minmult = 30;
|
||||
else
|
||||
minmult = multipliers[invalue];
|
||||
minmult = ezra_t_multipliers[invalue];
|
||||
fsb = eblcr_fsb_table_v2[longhaul.bits.MaxMHzFSB];
|
||||
break;
|
||||
}
|
||||
@@ -527,6 +527,18 @@ static unsigned int longhaul_get(unsigned int cpu)
|
||||
return calc_speed(longhaul_get_cpu_mult());
|
||||
}
|
||||
|
||||
static acpi_status longhaul_walk_callback(acpi_handle obj_handle,
|
||||
u32 nesting_level,
|
||||
void *context, void **return_value)
|
||||
{
|
||||
struct acpi_device *d;
|
||||
|
||||
if ( acpi_bus_get_device(obj_handle, &d) ) {
|
||||
return 0;
|
||||
}
|
||||
*return_value = (void *)acpi_driver_data(d);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
@@ -534,6 +546,15 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
|
||||
char *cpuname=NULL;
|
||||
int ret;
|
||||
|
||||
/* Check ACPI support for C3 state */
|
||||
acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
|
||||
&longhaul_walk_callback, NULL, (void *)&pr);
|
||||
if (pr == NULL) goto err_acpi;
|
||||
|
||||
cx = &pr->power.states[ACPI_STATE_C3];
|
||||
if (cx->address == 0 || cx->latency > 1000) goto err_acpi;
|
||||
|
||||
/* Now check what we have on this motherboard */
|
||||
switch (c->x86_model) {
|
||||
case 6:
|
||||
cpu_model = CPU_SAMUEL;
|
||||
@@ -634,6 +655,10 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
|
||||
cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu);
|
||||
|
||||
return 0;
|
||||
|
||||
err_acpi:
|
||||
printk(KERN_ERR PFX "No ACPI support for CPU frequency changes.\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int __devexit longhaul_cpu_exit(struct cpufreq_policy *policy)
|
||||
@@ -666,6 +691,18 @@ static int __init longhaul_init(void)
|
||||
if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6)
|
||||
return -ENODEV;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
if (num_online_cpus() > 1) {
|
||||
return -ENODEV;
|
||||
printk(KERN_ERR PFX "More than 1 CPU detected, longhaul disabled.\n");
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_X86_IO_APIC
|
||||
if (cpu_has_apic) {
|
||||
printk(KERN_ERR PFX "APIC detected. Longhaul is currently broken in this configuration.\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
switch (c->x86_model) {
|
||||
case 6 ... 9:
|
||||
return cpufreq_register_driver(&longhaul_driver);
|
||||
@@ -699,6 +736,6 @@ MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>");
|
||||
MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors.");
|
||||
MODULE_LICENSE ("GPL");
|
||||
|
||||
module_init(longhaul_init);
|
||||
late_initcall(longhaul_init);
|
||||
module_exit(longhaul_exit);
|
||||
|
||||
|
||||
+57
-29
@@ -32,32 +32,38 @@
|
||||
|
||||
extern void __init efi_memmap_walk_uc(efi_freemem_callback_t, void *);
|
||||
|
||||
#define MAX_UNCACHED_GRANULES 5
|
||||
static int allocated_granules;
|
||||
struct uncached_pool {
|
||||
struct gen_pool *pool;
|
||||
struct mutex add_chunk_mutex; /* serialize adding a converted chunk */
|
||||
int nchunks_added; /* #of converted chunks added to pool */
|
||||
atomic_t status; /* smp called function's return status*/
|
||||
};
|
||||
|
||||
struct gen_pool *uncached_pool[MAX_NUMNODES];
|
||||
#define MAX_CONVERTED_CHUNKS_PER_NODE 2
|
||||
|
||||
struct uncached_pool uncached_pools[MAX_NUMNODES];
|
||||
|
||||
|
||||
static void uncached_ipi_visibility(void *data)
|
||||
{
|
||||
int status;
|
||||
struct uncached_pool *uc_pool = (struct uncached_pool *)data;
|
||||
|
||||
status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
|
||||
if ((status != PAL_VISIBILITY_OK) &&
|
||||
(status != PAL_VISIBILITY_OK_REMOTE_NEEDED))
|
||||
printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on "
|
||||
"CPU %i\n", status, raw_smp_processor_id());
|
||||
atomic_inc(&uc_pool->status);
|
||||
}
|
||||
|
||||
|
||||
static void uncached_ipi_mc_drain(void *data)
|
||||
{
|
||||
int status;
|
||||
struct uncached_pool *uc_pool = (struct uncached_pool *)data;
|
||||
|
||||
status = ia64_pal_mc_drain();
|
||||
if (status)
|
||||
printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on "
|
||||
"CPU %i\n", status, raw_smp_processor_id());
|
||||
if (status != PAL_STATUS_SUCCESS)
|
||||
atomic_inc(&uc_pool->status);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,21 +76,34 @@ static void uncached_ipi_mc_drain(void *data)
|
||||
* This is accomplished by first allocating a granule of cached memory pages
|
||||
* and then converting them to uncached memory pages.
|
||||
*/
|
||||
static int uncached_add_chunk(struct gen_pool *pool, int nid)
|
||||
static int uncached_add_chunk(struct uncached_pool *uc_pool, int nid)
|
||||
{
|
||||
struct page *page;
|
||||
int status, i;
|
||||
int status, i, nchunks_added = uc_pool->nchunks_added;
|
||||
unsigned long c_addr, uc_addr;
|
||||
|
||||
if (allocated_granules >= MAX_UNCACHED_GRANULES)
|
||||
if (mutex_lock_interruptible(&uc_pool->add_chunk_mutex) != 0)
|
||||
return -1; /* interrupted by a signal */
|
||||
|
||||
if (uc_pool->nchunks_added > nchunks_added) {
|
||||
/* someone added a new chunk while we were waiting */
|
||||
mutex_unlock(&uc_pool->add_chunk_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (uc_pool->nchunks_added >= MAX_CONVERTED_CHUNKS_PER_NODE) {
|
||||
mutex_unlock(&uc_pool->add_chunk_mutex);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* attempt to allocate a granule's worth of cached memory pages */
|
||||
|
||||
page = alloc_pages_node(nid, GFP_KERNEL | __GFP_ZERO,
|
||||
IA64_GRANULE_SHIFT-PAGE_SHIFT);
|
||||
if (!page)
|
||||
if (!page) {
|
||||
mutex_unlock(&uc_pool->add_chunk_mutex);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* convert the memory pages from cached to uncached */
|
||||
|
||||
@@ -102,11 +121,14 @@ static int uncached_add_chunk(struct gen_pool *pool, int nid)
|
||||
flush_tlb_kernel_range(uc_addr, uc_adddr + IA64_GRANULE_SIZE);
|
||||
|
||||
status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
|
||||
if (!status) {
|
||||
status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1);
|
||||
if (status)
|
||||
if (status == PAL_VISIBILITY_OK_REMOTE_NEEDED) {
|
||||
atomic_set(&uc_pool->status, 0);
|
||||
status = smp_call_function(uncached_ipi_visibility, uc_pool,
|
||||
0, 1);
|
||||
if (status || atomic_read(&uc_pool->status))
|
||||
goto failed;
|
||||
}
|
||||
} else if (status != PAL_VISIBILITY_OK)
|
||||
goto failed;
|
||||
|
||||
preempt_disable();
|
||||
|
||||
@@ -120,20 +142,24 @@ static int uncached_add_chunk(struct gen_pool *pool, int nid)
|
||||
|
||||
preempt_enable();
|
||||
|
||||
ia64_pal_mc_drain();
|
||||
status = smp_call_function(uncached_ipi_mc_drain, NULL, 0, 1);
|
||||
if (status)
|
||||
status = ia64_pal_mc_drain();
|
||||
if (status != PAL_STATUS_SUCCESS)
|
||||
goto failed;
|
||||
atomic_set(&uc_pool->status, 0);
|
||||
status = smp_call_function(uncached_ipi_mc_drain, uc_pool, 0, 1);
|
||||
if (status || atomic_read(&uc_pool->status))
|
||||
goto failed;
|
||||
|
||||
/*
|
||||
* The chunk of memory pages has been converted to uncached so now we
|
||||
* can add it to the pool.
|
||||
*/
|
||||
status = gen_pool_add(pool, uc_addr, IA64_GRANULE_SIZE, nid);
|
||||
status = gen_pool_add(uc_pool->pool, uc_addr, IA64_GRANULE_SIZE, nid);
|
||||
if (status)
|
||||
goto failed;
|
||||
|
||||
allocated_granules++;
|
||||
uc_pool->nchunks_added++;
|
||||
mutex_unlock(&uc_pool->add_chunk_mutex);
|
||||
return 0;
|
||||
|
||||
/* failed to convert or add the chunk so give it back to the kernel */
|
||||
@@ -142,6 +168,7 @@ failed:
|
||||
ClearPageUncached(&page[i]);
|
||||
|
||||
free_pages(c_addr, IA64_GRANULE_SHIFT-PAGE_SHIFT);
|
||||
mutex_unlock(&uc_pool->add_chunk_mutex);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -158,7 +185,7 @@ failed:
|
||||
unsigned long uncached_alloc_page(int starting_nid)
|
||||
{
|
||||
unsigned long uc_addr;
|
||||
struct gen_pool *pool;
|
||||
struct uncached_pool *uc_pool;
|
||||
int nid;
|
||||
|
||||
if (unlikely(starting_nid >= MAX_NUMNODES))
|
||||
@@ -171,14 +198,14 @@ unsigned long uncached_alloc_page(int starting_nid)
|
||||
do {
|
||||
if (!node_online(nid))
|
||||
continue;
|
||||
pool = uncached_pool[nid];
|
||||
if (pool == NULL)
|
||||
uc_pool = &uncached_pools[nid];
|
||||
if (uc_pool->pool == NULL)
|
||||
continue;
|
||||
do {
|
||||
uc_addr = gen_pool_alloc(pool, PAGE_SIZE);
|
||||
uc_addr = gen_pool_alloc(uc_pool->pool, PAGE_SIZE);
|
||||
if (uc_addr != 0)
|
||||
return uc_addr;
|
||||
} while (uncached_add_chunk(pool, nid) == 0);
|
||||
} while (uncached_add_chunk(uc_pool, nid) == 0);
|
||||
|
||||
} while ((nid = (nid + 1) % MAX_NUMNODES) != starting_nid);
|
||||
|
||||
@@ -197,7 +224,7 @@ EXPORT_SYMBOL(uncached_alloc_page);
|
||||
void uncached_free_page(unsigned long uc_addr)
|
||||
{
|
||||
int nid = paddr_to_nid(uc_addr - __IA64_UNCACHED_OFFSET);
|
||||
struct gen_pool *pool = uncached_pool[nid];
|
||||
struct gen_pool *pool = uncached_pools[nid].pool;
|
||||
|
||||
if (unlikely(pool == NULL))
|
||||
return;
|
||||
@@ -224,7 +251,7 @@ static int __init uncached_build_memmap(unsigned long uc_start,
|
||||
unsigned long uc_end, void *arg)
|
||||
{
|
||||
int nid = paddr_to_nid(uc_start - __IA64_UNCACHED_OFFSET);
|
||||
struct gen_pool *pool = uncached_pool[nid];
|
||||
struct gen_pool *pool = uncached_pools[nid].pool;
|
||||
size_t size = uc_end - uc_start;
|
||||
|
||||
touch_softlockup_watchdog();
|
||||
@@ -242,7 +269,8 @@ static int __init uncached_init(void)
|
||||
int nid;
|
||||
|
||||
for_each_online_node(nid) {
|
||||
uncached_pool[nid] = gen_pool_create(PAGE_SHIFT, nid);
|
||||
uncached_pools[nid].pool = gen_pool_create(PAGE_SHIFT, nid);
|
||||
mutex_init(&uncached_pools[nid].add_chunk_mutex);
|
||||
}
|
||||
|
||||
efi_memmap_walk_uc(uncached_build_memmap, NULL);
|
||||
|
||||
@@ -421,18 +421,22 @@ static struct miscdevice sq_dev = {
|
||||
|
||||
static int __init sq_api_init(void)
|
||||
{
|
||||
int ret;
|
||||
printk(KERN_NOTICE "sq: Registering store queue API.\n");
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);
|
||||
#endif
|
||||
|
||||
return misc_register(&sq_dev);
|
||||
ret = misc_register(&sq_dev);
|
||||
if (ret)
|
||||
remove_proc_entry("sq_mapping", NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __exit sq_api_exit(void)
|
||||
{
|
||||
misc_deregister(&sq_dev);
|
||||
remove_proc_entry("sq_mapping", NULL);
|
||||
}
|
||||
|
||||
module_init(sq_api_init);
|
||||
|
||||
@@ -203,7 +203,7 @@ int __cpuinit init_smp_flush(void)
|
||||
{
|
||||
int i;
|
||||
for_each_cpu_mask(i, cpu_possible_map) {
|
||||
spin_lock_init(&per_cpu(flush_state.tlbstate_lock, i));
|
||||
spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -129,11 +129,15 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
|
||||
struct acpi_memory_info *info, *n;
|
||||
|
||||
|
||||
if (!list_empty(&mem_device->res_list))
|
||||
return 0;
|
||||
|
||||
status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
|
||||
acpi_memory_get_resource, mem_device);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
list_for_each_entry_safe(info, n, &mem_device->res_list, list)
|
||||
kfree(info);
|
||||
INIT_LIST_HEAD(&mem_device->res_list);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -230,17 +234,10 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
|
||||
* (i.e. memory-hot-remove function)
|
||||
*/
|
||||
list_for_each_entry(info, &mem_device->res_list, list) {
|
||||
u64 start_pfn, end_pfn;
|
||||
|
||||
start_pfn = info->start_addr >> PAGE_SHIFT;
|
||||
end_pfn = (info->start_addr + info->length - 1) >> PAGE_SHIFT;
|
||||
|
||||
if (pfn_valid(start_pfn) || pfn_valid(end_pfn)) {
|
||||
/* already enabled. try next area */
|
||||
if (info->enabled) { /* just sanity check...*/
|
||||
num_enabled++;
|
||||
continue;
|
||||
}
|
||||
|
||||
result = add_memory(node, info->start_addr, info->length);
|
||||
if (result)
|
||||
continue;
|
||||
|
||||
+3
-5
@@ -311,7 +311,8 @@ static void hvsi_recv_control(struct hvsi_struct *hp, uint8_t *packet,
|
||||
/* CD went away; no more connection */
|
||||
pr_debug("hvsi%i: CD dropped\n", hp->index);
|
||||
hp->mctrl &= TIOCM_CD;
|
||||
if (!(hp->tty->flags & CLOCAL))
|
||||
/* If userland hasn't done an open(2) yet, hp->tty is NULL. */
|
||||
if (hp->tty && !(hp->tty->flags & CLOCAL))
|
||||
*to_hangup = hp->tty;
|
||||
}
|
||||
break;
|
||||
@@ -986,10 +987,7 @@ static void hvsi_write_worker(void *arg)
|
||||
start_j = 0;
|
||||
#endif /* DEBUG */
|
||||
wake_up_all(&hp->emptyq);
|
||||
if (test_bit(TTY_DO_WRITE_WAKEUP, &hp->tty->flags)
|
||||
&& hp->tty->ldisc.write_wakeup)
|
||||
hp->tty->ldisc.write_wakeup(hp->tty);
|
||||
wake_up_interruptible(&hp->tty->write_wait);
|
||||
tty_wakeup(hp->tty);
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/hw_random.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/hardware/clock.h>
|
||||
|
||||
#define RNG_OUT_REG 0x00 /* Output register */
|
||||
#define RNG_STAT_REG 0x04 /* Status register
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
static void __iomem *rng_base;
|
||||
static struct clk *rng_ick;
|
||||
static struct device *rng_dev;
|
||||
static struct platform_device *rng_dev;
|
||||
|
||||
static u32 omap_rng_read_reg(int reg)
|
||||
{
|
||||
@@ -83,9 +83,8 @@ static struct hwrng omap_rng_ops = {
|
||||
.data_read = omap_rng_data_read,
|
||||
};
|
||||
|
||||
static int __init omap_rng_probe(struct device *dev)
|
||||
static int __init omap_rng_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct resource *res, *mem;
|
||||
int ret;
|
||||
|
||||
@@ -95,16 +94,14 @@ static int __init omap_rng_probe(struct device *dev)
|
||||
*/
|
||||
BUG_ON(rng_dev);
|
||||
|
||||
if (cpu_is_omap24xx()) {
|
||||
if (cpu_is_omap24xx()) {
|
||||
rng_ick = clk_get(NULL, "rng_ick");
|
||||
if (IS_ERR(rng_ick)) {
|
||||
dev_err(dev, "Could not get rng_ick\n");
|
||||
dev_err(&pdev->dev, "Could not get rng_ick\n");
|
||||
ret = PTR_ERR(rng_ick);
|
||||
return ret;
|
||||
}
|
||||
else {
|
||||
clk_use(rng_ick);
|
||||
}
|
||||
} else
|
||||
clk_enable(rng_ick);
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
@@ -117,7 +114,7 @@ static int __init omap_rng_probe(struct device *dev)
|
||||
if (mem == NULL)
|
||||
return -EBUSY;
|
||||
|
||||
dev_set_drvdata(dev, mem);
|
||||
dev_set_drvdata(&pdev->dev, mem);
|
||||
rng_base = (u32 __iomem *)io_p2v(res->start);
|
||||
|
||||
ret = hwrng_register(&omap_rng_ops);
|
||||
@@ -127,25 +124,25 @@ static int __init omap_rng_probe(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
dev_info(dev, "OMAP Random Number Generator ver. %02x\n",
|
||||
dev_info(&pdev->dev, "OMAP Random Number Generator ver. %02x\n",
|
||||
omap_rng_read_reg(RNG_REV_REG));
|
||||
omap_rng_write_reg(RNG_MASK_REG, 0x1);
|
||||
|
||||
rng_dev = dev;
|
||||
rng_dev = pdev;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __exit omap_rng_remove(struct device *dev)
|
||||
static int __exit omap_rng_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *mem = dev_get_drvdata(dev);
|
||||
struct resource *mem = dev_get_drvdata(&pdev->dev);
|
||||
|
||||
hwrng_unregister(&omap_rng_ops);
|
||||
|
||||
omap_rng_write_reg(RNG_MASK_REG, 0x0);
|
||||
|
||||
if (cpu_is_omap24xx()) {
|
||||
clk_unuse(rng_ick);
|
||||
clk_disable(rng_ick);
|
||||
clk_put(rng_ick);
|
||||
}
|
||||
|
||||
@@ -157,18 +154,16 @@ static int __exit omap_rng_remove(struct device *dev)
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
static int omap_rng_suspend(struct device *dev, pm_message_t message, u32 level)
|
||||
static int omap_rng_suspend(struct platform_device *pdev, pm_message_t message)
|
||||
{
|
||||
omap_rng_write_reg(RNG_MASK_REG, 0x0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level)
|
||||
static int omap_rng_resume(struct platform_device *pdev)
|
||||
{
|
||||
omap_rng_write_reg(RNG_MASK_REG, 0x1);
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -179,9 +174,11 @@ static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level)
|
||||
#endif
|
||||
|
||||
|
||||
static struct device_driver omap_rng_driver = {
|
||||
.name = "omap_rng",
|
||||
.bus = &platform_bus_type,
|
||||
static struct platform_driver omap_rng_driver = {
|
||||
.driver = {
|
||||
.name = "omap_rng",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
.probe = omap_rng_probe,
|
||||
.remove = __exit_p(omap_rng_remove),
|
||||
.suspend = omap_rng_suspend,
|
||||
@@ -193,12 +190,12 @@ static int __init omap_rng_init(void)
|
||||
if (!cpu_is_omap16xx() && !cpu_is_omap24xx())
|
||||
return -ENODEV;
|
||||
|
||||
return driver_register(&omap_rng_driver);
|
||||
return platform_driver_register(&omap_rng_driver);
|
||||
}
|
||||
|
||||
static void __exit omap_rng_exit(void)
|
||||
{
|
||||
driver_unregister(&omap_rng_driver);
|
||||
platform_driver_unregister(&omap_rng_driver);
|
||||
}
|
||||
|
||||
module_init(omap_rng_init);
|
||||
|
||||
+78
-61
@@ -107,7 +107,6 @@ const int NR_TYPES = ARRAY_SIZE(max_vals);
|
||||
|
||||
struct kbd_struct kbd_table[MAX_NR_CONSOLES];
|
||||
static struct kbd_struct *kbd = kbd_table;
|
||||
static struct kbd_struct kbd0;
|
||||
|
||||
int spawnpid, spawnsig;
|
||||
|
||||
@@ -223,13 +222,13 @@ static void kd_nosound(unsigned long ignored)
|
||||
{
|
||||
struct list_head *node;
|
||||
|
||||
list_for_each(node,&kbd_handler.h_list) {
|
||||
list_for_each(node, &kbd_handler.h_list) {
|
||||
struct input_handle *handle = to_handle_h(node);
|
||||
if (test_bit(EV_SND, handle->dev->evbit)) {
|
||||
if (test_bit(SND_TONE, handle->dev->sndbit))
|
||||
input_event(handle->dev, EV_SND, SND_TONE, 0);
|
||||
input_inject_event(handle, EV_SND, SND_TONE, 0);
|
||||
if (test_bit(SND_BELL, handle->dev->sndbit))
|
||||
input_event(handle->dev, EV_SND, SND_BELL, 0);
|
||||
input_inject_event(handle, EV_SND, SND_BELL, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -247,11 +246,11 @@ void kd_mksound(unsigned int hz, unsigned int ticks)
|
||||
struct input_handle *handle = to_handle_h(node);
|
||||
if (test_bit(EV_SND, handle->dev->evbit)) {
|
||||
if (test_bit(SND_TONE, handle->dev->sndbit)) {
|
||||
input_event(handle->dev, EV_SND, SND_TONE, hz);
|
||||
input_inject_event(handle, EV_SND, SND_TONE, hz);
|
||||
break;
|
||||
}
|
||||
if (test_bit(SND_BELL, handle->dev->sndbit)) {
|
||||
input_event(handle->dev, EV_SND, SND_BELL, 1);
|
||||
input_inject_event(handle, EV_SND, SND_BELL, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -272,15 +271,15 @@ int kbd_rate(struct kbd_repeat *rep)
|
||||
unsigned int d = 0;
|
||||
unsigned int p = 0;
|
||||
|
||||
list_for_each(node,&kbd_handler.h_list) {
|
||||
list_for_each(node, &kbd_handler.h_list) {
|
||||
struct input_handle *handle = to_handle_h(node);
|
||||
struct input_dev *dev = handle->dev;
|
||||
|
||||
if (test_bit(EV_REP, dev->evbit)) {
|
||||
if (rep->delay > 0)
|
||||
input_event(dev, EV_REP, REP_DELAY, rep->delay);
|
||||
input_inject_event(handle, EV_REP, REP_DELAY, rep->delay);
|
||||
if (rep->period > 0)
|
||||
input_event(dev, EV_REP, REP_PERIOD, rep->period);
|
||||
input_inject_event(handle, EV_REP, REP_PERIOD, rep->period);
|
||||
d = dev->rep[REP_DELAY];
|
||||
p = dev->rep[REP_PERIOD];
|
||||
}
|
||||
@@ -988,7 +987,7 @@ static inline unsigned char getleds(void)
|
||||
* interrupt routines for this thing allows us to easily mask
|
||||
* this when we don't want any of the above to happen.
|
||||
* This allows for easy and efficient race-condition prevention
|
||||
* for kbd_refresh_leds => input_event(dev, EV_LED, ...) => ...
|
||||
* for kbd_start => input_inject_event(dev, EV_LED, ...) => ...
|
||||
*/
|
||||
|
||||
static void kbd_bh(unsigned long dummy)
|
||||
@@ -998,11 +997,11 @@ static void kbd_bh(unsigned long dummy)
|
||||
|
||||
if (leds != ledstate) {
|
||||
list_for_each(node, &kbd_handler.h_list) {
|
||||
struct input_handle * handle = to_handle_h(node);
|
||||
input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));
|
||||
input_event(handle->dev, EV_LED, LED_NUML, !!(leds & 0x02));
|
||||
input_event(handle->dev, EV_LED, LED_CAPSL, !!(leds & 0x04));
|
||||
input_sync(handle->dev);
|
||||
struct input_handle *handle = to_handle_h(node);
|
||||
input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));
|
||||
input_inject_event(handle, EV_LED, LED_NUML, !!(leds & 0x02));
|
||||
input_inject_event(handle, EV_LED, LED_CAPSL, !!(leds & 0x04));
|
||||
input_inject_event(handle, EV_SYN, SYN_REPORT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1011,23 +1010,6 @@ static void kbd_bh(unsigned long dummy)
|
||||
|
||||
DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
|
||||
|
||||
/*
|
||||
* This allows a newly plugged keyboard to pick the LED state.
|
||||
*/
|
||||
static void kbd_refresh_leds(struct input_handle *handle)
|
||||
{
|
||||
unsigned char leds = ledstate;
|
||||
|
||||
tasklet_disable(&keyboard_tasklet);
|
||||
if (leds != 0xff) {
|
||||
input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));
|
||||
input_event(handle->dev, EV_LED, LED_NUML, !!(leds & 0x02));
|
||||
input_event(handle->dev, EV_LED, LED_CAPSL, !!(leds & 0x04));
|
||||
input_sync(handle->dev);
|
||||
}
|
||||
tasklet_enable(&keyboard_tasklet);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\
|
||||
defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\
|
||||
defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\
|
||||
@@ -1043,7 +1025,7 @@ static const unsigned short x86_keycodes[256] =
|
||||
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
|
||||
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
|
||||
80, 81, 82, 83, 84,118, 86, 87, 88,115,120,119,121,112,123, 92,
|
||||
284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339,
|
||||
284,285,309, 0,312, 91,327,328,329,331,333,335,336,337,338,339,
|
||||
367,288,302,304,350, 89,334,326,267,126,268,269,125,347,348,349,
|
||||
360,261,262,263,268,376,100,101,321,316,373,286,289,102,351,355,
|
||||
103,104,105,275,287,279,306,106,274,107,294,364,358,363,362,361,
|
||||
@@ -1065,38 +1047,55 @@ extern void sun_do_break(void);
|
||||
static int emulate_raw(struct vc_data *vc, unsigned int keycode,
|
||||
unsigned char up_flag)
|
||||
{
|
||||
if (keycode > 255 || !x86_keycodes[keycode])
|
||||
return -1;
|
||||
int code;
|
||||
|
||||
switch (keycode) {
|
||||
case KEY_PAUSE:
|
||||
put_queue(vc, 0xe1);
|
||||
put_queue(vc, 0x1d | up_flag);
|
||||
put_queue(vc, 0x45 | up_flag);
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case KEY_HANGEUL:
|
||||
if (!up_flag)
|
||||
put_queue(vc, 0xf2);
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case KEY_HANJA:
|
||||
if (!up_flag)
|
||||
put_queue(vc, 0xf1);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
if (keycode == KEY_SYSRQ && sysrq_alt) {
|
||||
put_queue(vc, 0x54 | up_flag);
|
||||
return 0;
|
||||
}
|
||||
case KEY_SYSRQ:
|
||||
/*
|
||||
* Real AT keyboards (that's what we're trying
|
||||
* to emulate here emit 0xe0 0x2a 0xe0 0x37 when
|
||||
* pressing PrtSc/SysRq alone, but simply 0x54
|
||||
* when pressing Alt+PrtSc/SysRq.
|
||||
*/
|
||||
if (sysrq_alt) {
|
||||
put_queue(vc, 0x54 | up_flag);
|
||||
} else {
|
||||
put_queue(vc, 0xe0);
|
||||
put_queue(vc, 0x2a | up_flag);
|
||||
put_queue(vc, 0xe0);
|
||||
put_queue(vc, 0x37 | up_flag);
|
||||
}
|
||||
break;
|
||||
|
||||
if (x86_keycodes[keycode] & 0x100)
|
||||
put_queue(vc, 0xe0);
|
||||
default:
|
||||
if (keycode > 255)
|
||||
return -1;
|
||||
|
||||
put_queue(vc, (x86_keycodes[keycode] & 0x7f) | up_flag);
|
||||
code = x86_keycodes[keycode];
|
||||
if (!code)
|
||||
return -1;
|
||||
|
||||
if (keycode == KEY_SYSRQ) {
|
||||
put_queue(vc, 0xe0);
|
||||
put_queue(vc, 0x37 | up_flag);
|
||||
if (code & 0x100)
|
||||
put_queue(vc, 0xe0);
|
||||
put_queue(vc, (code & 0x7f) | up_flag);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1298,16 +1297,15 @@ static struct input_handle *kbd_connect(struct input_handler *handler,
|
||||
if (i == BTN_MISC && !test_bit(EV_SND, dev->evbit))
|
||||
return NULL;
|
||||
|
||||
if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))
|
||||
handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);
|
||||
if (!handle)
|
||||
return NULL;
|
||||
memset(handle, 0, sizeof(struct input_handle));
|
||||
|
||||
handle->dev = dev;
|
||||
handle->handler = handler;
|
||||
handle->name = "kbd";
|
||||
|
||||
input_open_device(handle);
|
||||
kbd_refresh_leds(handle);
|
||||
|
||||
return handle;
|
||||
}
|
||||
@@ -1318,6 +1316,24 @@ static void kbd_disconnect(struct input_handle *handle)
|
||||
kfree(handle);
|
||||
}
|
||||
|
||||
/*
|
||||
* Start keyboard handler on the new keyboard by refreshing LED state to
|
||||
* match the rest of the system.
|
||||
*/
|
||||
static void kbd_start(struct input_handle *handle)
|
||||
{
|
||||
unsigned char leds = ledstate;
|
||||
|
||||
tasklet_disable(&keyboard_tasklet);
|
||||
if (leds != 0xff) {
|
||||
input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));
|
||||
input_inject_event(handle, EV_LED, LED_NUML, !!(leds & 0x02));
|
||||
input_inject_event(handle, EV_LED, LED_CAPSL, !!(leds & 0x04));
|
||||
input_inject_event(handle, EV_SYN, SYN_REPORT, 0);
|
||||
}
|
||||
tasklet_enable(&keyboard_tasklet);
|
||||
}
|
||||
|
||||
static struct input_device_id kbd_ids[] = {
|
||||
{
|
||||
.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
|
||||
@@ -1338,6 +1354,7 @@ static struct input_handler kbd_handler = {
|
||||
.event = kbd_event,
|
||||
.connect = kbd_connect,
|
||||
.disconnect = kbd_disconnect,
|
||||
.start = kbd_start,
|
||||
.name = "kbd",
|
||||
.id_table = kbd_ids,
|
||||
};
|
||||
@@ -1346,15 +1363,15 @@ int __init kbd_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
kbd0.ledflagstate = kbd0.default_ledflagstate = KBD_DEFLEDS;
|
||||
kbd0.ledmode = LED_SHOW_FLAGS;
|
||||
kbd0.lockstate = KBD_DEFLOCK;
|
||||
kbd0.slockstate = 0;
|
||||
kbd0.modeflags = KBD_DEFMODE;
|
||||
kbd0.kbdmode = VC_XLATE;
|
||||
|
||||
for (i = 0 ; i < MAX_NR_CONSOLES ; i++)
|
||||
kbd_table[i] = kbd0;
|
||||
for (i = 0; i < MAX_NR_CONSOLES; i++) {
|
||||
kbd_table[i].ledflagstate = KBD_DEFLEDS;
|
||||
kbd_table[i].default_ledflagstate = KBD_DEFLEDS;
|
||||
kbd_table[i].ledmode = LED_SHOW_FLAGS;
|
||||
kbd_table[i].lockstate = KBD_DEFLOCK;
|
||||
kbd_table[i].slockstate = 0;
|
||||
kbd_table[i].modeflags = KBD_DEFMODE;
|
||||
kbd_table[i].kbdmode = VC_XLATE;
|
||||
}
|
||||
|
||||
input_register_handler(&kbd_handler);
|
||||
|
||||
|
||||
+54
-21
@@ -284,39 +284,69 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_transition);
|
||||
* SYSFS INTERFACE *
|
||||
*********************************************************************/
|
||||
|
||||
static struct cpufreq_governor *__find_governor(const char *str_governor)
|
||||
{
|
||||
struct cpufreq_governor *t;
|
||||
|
||||
list_for_each_entry(t, &cpufreq_governor_list, governor_list)
|
||||
if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN))
|
||||
return t;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* cpufreq_parse_governor - parse a governor string
|
||||
*/
|
||||
static int cpufreq_parse_governor (char *str_governor, unsigned int *policy,
|
||||
struct cpufreq_governor **governor)
|
||||
{
|
||||
int err = -EINVAL;
|
||||
|
||||
if (!cpufreq_driver)
|
||||
return -EINVAL;
|
||||
goto out;
|
||||
|
||||
if (cpufreq_driver->setpolicy) {
|
||||
if (!strnicmp(str_governor, "performance", CPUFREQ_NAME_LEN)) {
|
||||
*policy = CPUFREQ_POLICY_PERFORMANCE;
|
||||
return 0;
|
||||
err = 0;
|
||||
} else if (!strnicmp(str_governor, "powersave", CPUFREQ_NAME_LEN)) {
|
||||
*policy = CPUFREQ_POLICY_POWERSAVE;
|
||||
return 0;
|
||||
err = 0;
|
||||
}
|
||||
return -EINVAL;
|
||||
} else {
|
||||
} else if (cpufreq_driver->target) {
|
||||
struct cpufreq_governor *t;
|
||||
|
||||
mutex_lock(&cpufreq_governor_mutex);
|
||||
if (!cpufreq_driver || !cpufreq_driver->target)
|
||||
goto out;
|
||||
list_for_each_entry(t, &cpufreq_governor_list, governor_list) {
|
||||
if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN)) {
|
||||
*governor = t;
|
||||
|
||||
t = __find_governor(str_governor);
|
||||
|
||||
if (t == NULL) {
|
||||
char *name = kasprintf(GFP_KERNEL, "cpufreq_%s", str_governor);
|
||||
|
||||
if (name) {
|
||||
int ret;
|
||||
|
||||
mutex_unlock(&cpufreq_governor_mutex);
|
||||
return 0;
|
||||
ret = request_module(name);
|
||||
mutex_lock(&cpufreq_governor_mutex);
|
||||
|
||||
if (ret == 0)
|
||||
t = __find_governor(str_governor);
|
||||
}
|
||||
|
||||
kfree(name);
|
||||
}
|
||||
out:
|
||||
|
||||
if (t != NULL) {
|
||||
*governor = t;
|
||||
err = 0;
|
||||
}
|
||||
|
||||
mutex_unlock(&cpufreq_governor_mutex);
|
||||
}
|
||||
return -EINVAL;
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -1265,23 +1295,21 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
|
||||
|
||||
int cpufreq_register_governor(struct cpufreq_governor *governor)
|
||||
{
|
||||
struct cpufreq_governor *t;
|
||||
int err;
|
||||
|
||||
if (!governor)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&cpufreq_governor_mutex);
|
||||
|
||||
list_for_each_entry(t, &cpufreq_governor_list, governor_list) {
|
||||
if (!strnicmp(governor->name,t->name,CPUFREQ_NAME_LEN)) {
|
||||
mutex_unlock(&cpufreq_governor_mutex);
|
||||
return -EBUSY;
|
||||
}
|
||||
err = -EBUSY;
|
||||
if (__find_governor(governor->name) == NULL) {
|
||||
err = 0;
|
||||
list_add(&governor->governor_list, &cpufreq_governor_list);
|
||||
}
|
||||
list_add(&governor->governor_list, &cpufreq_governor_list);
|
||||
|
||||
mutex_unlock(&cpufreq_governor_mutex);
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(cpufreq_register_governor);
|
||||
|
||||
@@ -1343,6 +1371,11 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
|
||||
|
||||
memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo));
|
||||
|
||||
if (policy->min > data->min && policy->min > policy->max) {
|
||||
ret = -EINVAL;
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
/* verify the cpu speed can be set within this limit */
|
||||
ret = cpufreq_driver->verify(policy);
|
||||
if (ret)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#define EDAC_MC_LABEL_LEN 31
|
||||
#define MC_PROC_NAME_MAX_LEN 7
|
||||
|
||||
@@ -232,7 +232,7 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
|
||||
unsigned long timeout;
|
||||
|
||||
timeout = jiffies + POLL_TIMEOUT;
|
||||
while (time_before(jiffies, timeout)) {
|
||||
while (1) {
|
||||
status = inb(ACBST);
|
||||
|
||||
/* Reset the status register to avoid the hang */
|
||||
@@ -242,7 +242,10 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
|
||||
scx200_acb_machine(iface, status);
|
||||
return;
|
||||
}
|
||||
yield();
|
||||
if (time_after(jiffies, timeout))
|
||||
break;
|
||||
cpu_relax();
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
dev_err(&iface->adapter.dev, "timeout in state %s\n",
|
||||
|
||||
@@ -2515,6 +2515,9 @@ static int sbp2scsi_slave_configure(struct scsi_device *sdev)
|
||||
sdev->skip_ms_page_8 = 1;
|
||||
if (scsi_id->workarounds & SBP2_WORKAROUND_FIX_CAPACITY)
|
||||
sdev->fix_capacity = 1;
|
||||
if (scsi_id->ne->guid_vendor_id == 0x0010b9 && /* Maxtor's OUI */
|
||||
(sdev->type == TYPE_DISK || sdev->type == TYPE_RBC))
|
||||
sdev->allow_restart = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,14 +127,10 @@ static int evdev_open(struct inode * inode, struct file * file)
|
||||
{
|
||||
struct evdev_list *list;
|
||||
int i = iminor(inode) - EVDEV_MINOR_BASE;
|
||||
int accept_err;
|
||||
|
||||
if (i >= EVDEV_MINORS || !evdev_table[i] || !evdev_table[i]->exist)
|
||||
return -ENODEV;
|
||||
|
||||
if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file)))
|
||||
return accept_err;
|
||||
|
||||
if (!(list = kzalloc(sizeof(struct evdev_list), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -260,7 +256,7 @@ static ssize_t evdev_write(struct file * file, const char __user * buffer, size_
|
||||
|
||||
if (evdev_event_from_user(buffer + retval, &event))
|
||||
return -EFAULT;
|
||||
input_event(list->evdev->handle.dev, event.type, event.code, event.value);
|
||||
input_inject_event(&list->evdev->handle, event.type, event.code, event.value);
|
||||
retval += evdev_event_size();
|
||||
}
|
||||
|
||||
@@ -428,8 +424,8 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd,
|
||||
if (get_user(v, ip + 1))
|
||||
return -EFAULT;
|
||||
|
||||
input_event(dev, EV_REP, REP_DELAY, u);
|
||||
input_event(dev, EV_REP, REP_PERIOD, v);
|
||||
input_inject_event(&evdev->handle, EV_REP, REP_DELAY, u);
|
||||
input_inject_event(&evdev->handle, EV_REP, REP_PERIOD, v);
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -106,10 +106,10 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device
|
||||
gp->gameport = port;
|
||||
gp->res_port = request_region(port->io, 0x10, "FM801 GP");
|
||||
if (!gp->res_port) {
|
||||
kfree(gp);
|
||||
gameport_free_port(port);
|
||||
printk(KERN_DEBUG "fm801-gp: unable to grab region 0x%x-0x%x\n",
|
||||
port->io, port->io + 0x0f);
|
||||
gameport_free_port(port);
|
||||
kfree(gp);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user