Commit 727e6e93 authored by Dave Airlie's avatar Dave Airlie Committed by Dave Airlie

Merge ../linux-2.6/

parents bdf242ee 889371f6
......@@ -144,7 +144,21 @@ vgapal Use the standard vga registers for palette changes.
This is the default.
pmipal Use the protected mode interface for palette changes.
mtrr setup memory type range registers for the vesafb framebuffer.
mtrr:n setup memory type range registers for the vesafb framebuffer
where n:
0 - disabled (equivalent to nomtrr)
1 - uncachable
2 - write-back
3 - write-combining (default)
4 - write-through
If you see the following in dmesg, choose the type that matches the
old one. In this example, use "mtrr:2".
...
mtrr: type mismatch for e0000000,8000000 old: write-back new: write-combining
...
nomtrr disable mtrr
vremap:n
remap 'n' MiB of video RAM. If 0 or not specified, remap memory
......
......@@ -442,6 +442,13 @@ acpi_cpufreq_cpu_init (
(u32) data->acpi_data.states[i].transition_latency);
cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu);
/*
* the first call to ->target() should result in us actually
* writing something to the appropriate registers.
*/
data->resume = 1;
return (result);
err_freqfree:
......
......@@ -30,6 +30,7 @@ static int __init pci_acpi_init(void)
acpi_irq_penalty_init();
pcibios_scanned++;
pcibios_enable_irq = acpi_pci_irq_enable;
pcibios_disable_irq = acpi_pci_irq_disable;
if (pci_routeirq) {
/*
......
......@@ -254,3 +254,9 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
return pcibios_enable_irq(dev);
}
void pcibios_disable_device (struct pci_dev *dev)
{
if (pcibios_disable_irq)
pcibios_disable_irq(dev);
}
......@@ -56,6 +56,7 @@ struct irq_router_handler {
};
int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL;
void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL;
/*
* Check passed address for the PCI IRQ Routing Table signature
......
......@@ -73,3 +73,4 @@ extern int pcibios_scanned;
extern spinlock_t pci_config_lock;
extern int (*pcibios_enable_irq)(struct pci_dev *dev);
extern void (*pcibios_disable_irq)(struct pci_dev *dev);
......@@ -179,14 +179,14 @@ skpinv: addi r4,r4,1 /* Increment */
4:
#ifdef CONFIG_SERIAL_TEXT_DEBUG
/*
* Add temporary UART mapping for early debug. This
* mapping must be identical to that used by the early
* bootloader code since the same asm/serial.h parameters
* are used for polled operation.
* Add temporary UART mapping for early debug.
* We can map UART registers wherever we want as long as they don't
* interfere with other system mappings (e.g. with pinned entries).
* For an example of how we handle this - see ocotea.h. --ebs
*/
/* pageid fields */
lis r3,UART0_IO_BASE@h
ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_256M
ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_4K
/* xlat fields */
lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */
......@@ -196,7 +196,7 @@ skpinv: addi r4,r4,1 /* Increment */
li r5,0
ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G)
li r0,1 /* TLB slot 1 */
li r0,0 /* TLB slot 0 */
tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */
......
......@@ -1451,3 +1451,6 @@ _GLOBAL(sys_call_table)
.long sys_waitid
.long sys_ioprio_set
.long sys_ioprio_get
.long sys_inotify_init /* 275 */
.long sys_inotify_add_watch
.long sys_inotify_rm_watch
......@@ -7,7 +7,7 @@
* Copyright 2002-2005 MontaVista Software Inc.
*
* Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
* Copyright (c) 2003, 2004 Zultys Technologies
* Copyright (c) 2003-2005 Zultys Technologies
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
......@@ -50,6 +50,7 @@
#include <asm/bootinfo.h>
#include <asm/ppc4xx_pic.h>
#include <asm/ppcboot.h>
#include <asm/tlbflush.h>
#include <syslib/gen550.h>
#include <syslib/ibm440gp_common.h>
......@@ -248,6 +249,9 @@ ebony_early_serial_map(void)
#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
/* Configure debug serial access */
gen550_init(0, &port);
/* Purge TLB entry added in head_44x.S for early serial access */
_tlbie(UART0_IO_BASE);
#endif
port.membase = ioremap64(PPC440GP_UART1_ADDR, 8);
......
......@@ -56,9 +56,18 @@
* Serial port defines
*/
/* OpenBIOS defined UART mappings, used before early_serial_setup */
#if defined(__BOOTER__)
/* OpenBIOS defined UART mappings, used by bootloader shim */
#define UART0_IO_BASE 0xE0000200
#define UART1_IO_BASE 0xE0000300
#else
/* head_44x.S created UART mapping, used before early_serial_setup.
* We cannot use default OpenBIOS UART mappings because they
* don't work for configurations with more than 512M RAM. --ebs
*/
#define UART0_IO_BASE 0xF0000200
#define UART1_IO_BASE 0xF0000300
#endif
/* external Epson SG-615P */
#define BASE_BAUD 691200
......@@ -66,7 +75,7 @@
#define STD_UART_OP(num) \
{ 0, BASE_BAUD, 0, UART##num##_INT, \
(ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
iomem_base: UART##num##_IO_BASE, \
iomem_base: (void*)UART##num##_IO_BASE, \
io_type: SERIAL_IO_MEM},
#define SERIAL_PORT_DFNS \
......
......@@ -48,6 +48,7 @@
#include <asm/bootinfo.h>
#include <asm/ppc4xx_pic.h>
#include <asm/ppcboot.h>
#include <asm/tlbflush.h>
#include <syslib/gen550.h>
#include <syslib/ibm440gx_common.h>
......@@ -266,6 +267,9 @@ ocotea_early_serial_map(void)
#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
/* Configure debug serial access */
gen550_init(0, &port);
/* Purge TLB entry added in head_44x.S for early serial access */
_tlbie(UART0_IO_BASE);
#endif
port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
......
......@@ -55,15 +55,24 @@
*/
#define RS_TABLE_SIZE 2
/* OpenBIOS defined UART mappings, used before early_serial_setup */
#if defined(__BOOTER__)
/* OpenBIOS defined UART mappings, used by bootloader shim */
#define UART0_IO_BASE 0xE0000200
#define UART1_IO_BASE 0xE0000300
#else
/* head_44x.S created UART mapping, used before early_serial_setup.
* We cannot use default OpenBIOS UART mappings because they
* don't work for configurations with more than 512M RAM. --ebs
*/
#define UART0_IO_BASE 0xF0000200
#define UART1_IO_BASE 0xF0000300
#endif
#define BASE_BAUD 11059200/16
#define STD_UART_OP(num) \
{ 0, BASE_BAUD, 0, UART##num##_INT, \
(ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
iomem_base: UART##num##_IO_BASE, \
iomem_base: (void*)UART##num##_IO_BASE, \
io_type: SERIAL_IO_MEM},
#define SERIAL_PORT_DFNS \
......
......@@ -1129,6 +1129,9 @@ _GLOBAL(sys_call_table32)
.llong .compat_sys_waitid
.llong .sys32_ioprio_set
.llong .sys32_ioprio_get
.llong .sys_inotify_init /* 275 */
.llong .sys_inotify_add_watch
.llong .sys_inotify_rm_watch
.balign 8
_GLOBAL(sys_call_table)
......@@ -1407,3 +1410,6 @@ _GLOBAL(sys_call_table)
.llong .sys_waitid
.llong .sys_ioprio_set
.llong .sys_ioprio_get
.llong .sys_inotify_init /* 275 */
.llong .sys_inotify_add_watch
.llong .sys_inotify_rm_watch
......@@ -970,8 +970,21 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
* due to unused I/O APIC pins.
*/
int irq = gsi;
gsi = pci_irq++;
gsi_to_irq[irq] = gsi;
if (gsi < MAX_GSI_NUM) {
if (gsi > 15)
gsi = pci_irq++;
#ifdef CONFIG_ACPI_BUS
/*
* Don't assign IRQ used by ACPI SCI
*/
if (gsi == acpi_fadt.sci_int)
gsi = pci_irq++;
#endif
gsi_to_irq[irq] = gsi;
} else {
printk(KERN_ERR "GSI %u is too high\n", gsi);
return gsi;
}
}
io_apic_set_pci_routing(ioapic, ioapic_pin, gsi,
......
......@@ -188,8 +188,8 @@ csum_partial_copy_generic:
source
movw (%rdi),%bx
adcl %ebx,%eax
dest
decl %ecx
dest
movw %bx,(%rsi)
leaq 2(%rdi),%rdi
leaq 2(%rsi),%rsi
......
This diff is collapsed.
......@@ -269,7 +269,51 @@ acpi_pci_irq_del_prt (int segment, int bus)
/* --------------------------------------------------------------------------
PCI Interrupt Routing Support
-------------------------------------------------------------------------- */
typedef int (*irq_lookup_func)(struct acpi_prt_entry *, int *, int *, char **);
static int
acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
int *edge_level,
int *active_high_low,
char **link)
{
int irq;
ACPI_FUNCTION_TRACE("acpi_pci_allocate_irq");
if (entry->link.handle) {
irq = acpi_pci_link_allocate_irq(entry->link.handle,
entry->link.index, edge_level, active_high_low, link);
if (irq < 0) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n"));
return_VALUE(-1);
}
} else {
irq = entry->link.index;
*edge_level = ACPI_LEVEL_SENSITIVE;
*active_high_low = ACPI_ACTIVE_LOW;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
return_VALUE(irq);
}
static int
acpi_pci_free_irq(struct acpi_prt_entry *entry,
int *edge_level,
int *active_high_low,
char **link)
{
int irq;
ACPI_FUNCTION_TRACE("acpi_pci_free_irq");
if (entry->link.handle) {
irq = acpi_pci_link_free_irq(entry->link.handle);
} else {
irq = entry->link.index;
}
return_VALUE(irq);
}
/*
* acpi_pci_irq_lookup
* success: return IRQ >= 0
......@@ -282,12 +326,13 @@ acpi_pci_irq_lookup (
int pin,
int *edge_level,
int *active_high_low,
char **link)
char **link,
irq_lookup_func func)
{
struct acpi_prt_entry *entry = NULL;
int segment = pci_domain_nr(bus);
int bus_nr = bus->number;
int irq;
int ret;
ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup");
......@@ -301,22 +346,8 @@ acpi_pci_irq_lookup (
return_VALUE(-1);
}
if (entry->link.handle) {
irq = acpi_pci_link_get_irq(entry->link.handle,
entry->link.index, edge_level, active_high_low, link);
if (irq < 0) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n"));
return_VALUE(-1);
}
} else {
irq = entry->link.index;
*edge_level = ACPI_LEVEL_SENSITIVE;
*active_high_low = ACPI_ACTIVE_LOW;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
return_VALUE(irq);
ret = func(entry, edge_level, active_high_low, link);
return_VALUE(ret);
}
/*
......@@ -330,7 +361,8 @@ acpi_pci_irq_derive (
int pin,
int *edge_level,
int *active_high_low,
char **link)
char **link,
irq_lookup_func func)
{
struct pci_dev *bridge = dev;
int irq = -1;
......@@ -363,7 +395,7 @@ acpi_pci_irq_derive (
}
irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn),
pin, edge_level, active_high_low, link);
pin, edge_level, active_high_low, link, func);
}
if (irq < 0) {
......@@ -415,7 +447,7 @@ acpi_pci_irq_enable (
* values override any BIOS-assigned IRQs set during boot.
*/
irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
&edge_level, &active_high_low, &link);
&edge_level, &active_high_low, &link, acpi_pci_allocate_irq);
/*
* If no PRT entry was found, we'll try to derive an IRQ from the
......@@ -423,7 +455,7 @@ acpi_pci_irq_enable (
*/
if (irq < 0)
irq = acpi_pci_irq_derive(dev, pin, &edge_level,
&active_high_low, &link);
&active_high_low, &link, acpi_pci_allocate_irq);
/*
* No IRQ known to the ACPI subsystem - maybe the BIOS /
......@@ -462,7 +494,9 @@ acpi_pci_irq_enable (
EXPORT_SYMBOL(acpi_pci_irq_enable);
#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
/* FIXME: implement x86/x86_64 version */
void __attribute__((weak)) acpi_unregister_gsi(u32 i) {}
void
acpi_pci_irq_disable (
struct pci_dev *dev)
......@@ -489,14 +523,14 @@ acpi_pci_irq_disable (
* First we check the PCI IRQ routing table (PRT) for an IRQ.
*/
gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
&edge_level, &active_high_low, NULL);
&edge_level, &active_high_low, NULL, acpi_pci_free_irq);
/*
* If no PRT entry was found, we'll try to derive an IRQ from the
* device's parent bridge.
*/
if (gsi < 0)
gsi = acpi_pci_irq_derive(dev, pin,
&edge_level, &active_high_low, NULL);
&edge_level, &active_high_low, NULL, acpi_pci_free_irq);
if (gsi < 0)
return_VOID;
......@@ -512,4 +546,3 @@ acpi_pci_irq_disable (
return_VOID;
}
#endif /* CONFIG_ACPI_DEALLOCATE_IRQ */
......@@ -68,6 +68,10 @@ static struct acpi_driver acpi_pci_link_driver = {
},
};
/*
* If a link is initialized, we never change its active and initialized
* later even the link is disable. Instead, we just repick the active irq
*/
struct acpi_pci_link_irq {
u8 active; /* Current IRQ */
u8 edge_level; /* All IRQs */
......@@ -76,8 +80,7 @@ struct acpi_pci_link_irq {
u8 possible_count;
u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE];
u8 initialized:1;
u8 suspend_resume:1;
u8 reserved:6;
u8 reserved:7;
};
struct acpi_pci_link {
......@@ -85,12 +88,14 @@ struct acpi_pci_link {
struct acpi_device *device;
acpi_handle handle;
struct acpi_pci_link_irq irq;
int refcnt;
};
static struct {
int count;
struct list_head entries;
} acpi_link;
DECLARE_MUTEX(acpi_link_lock);
/* --------------------------------------------------------------------------
......@@ -532,12 +537,12 @@ static int acpi_pci_link_allocate(
ACPI_FUNCTION_TRACE("acpi_pci_link_allocate");
if (link->irq.suspend_resume) {
acpi_pci_link_set(link, link->irq.active);
link->irq.suspend_resume = 0;
}
if (link->irq.initialized)
if (link->irq.initialized) {
if (link->refcnt == 0)
/* This means the link is disabled but initialized */
acpi_pci_link_set(link, link->irq.active);
return_VALUE(0);
}
/*
* search for active IRQ in list of possible IRQs.
......@@ -596,13 +601,13 @@ static int acpi_pci_link_allocate(
}
/*
* acpi_pci_link_get_irq
* acpi_pci_link_allocate_irq
* success: return IRQ >= 0
* failure: return -1
*/
int
acpi_pci_link_get_irq (
acpi_pci_link_allocate_irq (
acpi_handle handle,
int index,
int *edge_level,
......@@ -613,7 +618,7 @@ acpi_pci_link_get_irq (
struct acpi_device *device = NULL;
struct acpi_pci_link *link = NULL;
ACPI_FUNCTION_TRACE("acpi_pci_link_get_irq");
ACPI_FUNCTION_TRACE("acpi_pci_link_allocate_irq");
result = acpi_bus_get_device(handle, &device);
if (result) {
......@@ -633,21 +638,70 @@ acpi_pci_link_get_irq (
return_VALUE(-1);
}
if (acpi_pci_link_allocate(link))
down(&acpi_link_lock);
if (acpi_pci_link_allocate(link)) {
up(&acpi_link_lock);
return_VALUE(-1);
}
if (!link->irq.active) {
up(&acpi_link_lock);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n"));
return_VALUE(-1);
}
link->refcnt ++;
up(&acpi_link_lock);
if (edge_level) *edge_level = link->irq.edge_level;
if (active_high_low) *active_high_low = link->irq.active_high_low;
if (name) *name = acpi_device_bid(link->device);
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Link %s is referenced\n", acpi_device_bid(link->device)));
return_VALUE(link->irq.active);
}
/*
* We don't change link's irq information here. After it is reenabled, we
* continue use the info
*/
int
acpi_pci_link_free_irq(acpi_handle handle)
{
struct acpi_device *device = NULL;
struct acpi_pci_link *link = NULL;
acpi_status result;
ACPI_FUNCTION_TRACE("acpi_pci_link_free_irq");
result = acpi_bus_get_device(handle, &device);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n"));
return_VALUE(-1);
}
link = (struct acpi_pci_link *) acpi_driver_data(device);
if (!link) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
return_VALUE(-1);
}
down(&acpi_link_lock);
if (!link->irq.initialized) {
up(&acpi_link_lock);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link isn't initialized\n"));
return_VALUE(-1);
}
link->refcnt --;
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Link %s is dereferenced\n", acpi_device_bid(link->device)));
if (link->refcnt == 0) {
acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
}
up(&acpi_link_lock);
return_VALUE(link->irq.active);
}
/* --------------------------------------------------------------------------
Driver Interface
-------------------------------------------------------------------------- */
......@@ -677,6 +731,7 @@ acpi_pci_link_add (
strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS);
acpi_driver_data(device) = link;
down(&acpi_link_lock);
result = acpi_pci_link_get_possible(link);
if (result)
goto end;
......@@ -712,6 +767,7 @@ acpi_pci_link_add (
end:
/* disable all links -- to be activated on use */
acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
up(&acpi_link_lock);
if (result)
kfree(link);
......@@ -726,19 +782,32 @@ irqrouter_suspend(
{
struct list_head *node = NULL;
struct acpi_pci_link *link = NULL;
int ret = 0;
ACPI_FUNCTION_TRACE("irqrouter_suspend");
list_for_each(node, &acpi_link.entries) {
link = list_entry(node, struct acpi_pci_link, node);
if (!link) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Invalid link context\n"));
continue;
}
if (link->irq.active && link->irq.initialized)
link->irq.suspend_resume = 1;
if (link->irq.initialized && link->refcnt != 0
/* We ignore legacy IDE device irq */
&& link->irq.active != 14 && link->irq.active !=15) {
printk(KERN_WARNING PREFIX
"%d drivers with interrupt %d neglected to call"
" pci_disable_device at .suspend\n",
link->refcnt,
link->irq.active);
printk(KERN_WARNING PREFIX
"Fix the driver, or rmmod before suspend\n");
link->refcnt = 0;
ret = -EINVAL;
}
}
return_VALUE(0);
return_VALUE(ret);
}
......@@ -756,8 +825,9 @@ acpi_pci_link_remove (
link = (struct acpi_pci_link *) acpi_driver_data(device);
/* TBD: Acquire/release lock */
down(&acpi_link_lock);
list_del(&link->node);
up(&acpi_link_lock);
kfree(link);
......@@ -849,6 +919,7 @@ int __init acpi_irq_balance_set(char *str)
__setup("acpi_irq_balance", acpi_irq_balance_set);
/* FIXME: we will remove this interface after all drivers call pci_disable_device */
static struct sysdev_class irqrouter_sysdev_class = {
set_kset_name("irqrouter"),
.suspend = irqrouter_suspend,
......
......@@ -81,30 +81,33 @@ module_param(bm_history, uint, 0644);
*
* To skip this limit, boot/load with a large max_cstate limit.
*/
static int no_c2c3(struct dmi_system_id *id)
static int set_max_cstate(struct dmi_system_id *id)
{
if (max_cstate > ACPI_PROCESSOR_MAX_POWER)
return 0;
printk(KERN_NOTICE PREFIX "%s detected - C2,C3 disabled."
printk(KERN_NOTICE PREFIX "%s detected - %s disabled."
" Override with \"processor.max_cstate=%d\"\n", id->ident,
((int)id->driver_data == 1)? "C2,C3":"C3",
ACPI_PROCESSOR_MAX_POWER + 1);
max_cstate = 1;
max_cstate = (int)id->driver_data;
return 0;
}
static struct dmi_system_id __initdata processor_power_dmi_table[] = {
{ no_c2c3, "IBM ThinkPad R40e", {
{ set_max_cstate, "IBM ThinkPad R40e", {
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW") }},
{ no_c2c3, "Medion 41700", {
DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW") }, (void*)1},
{ set_max_cstate, "Medion 41700", {
DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
DMI_MATCH(DMI_BIOS_VERSION,"R01-A1J") }, (void*)1},
{ set_max_cstate, "Clevo 5600D", {
DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
DMI_MATCH(DMI_BIOS_VERSION,"R01-A1J") }},
DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307") },
(void*)2},
{},
};
......@@ -549,7 +552,8 @@ static int acpi_processor_get_power_info_default_c1 (struct acpi_processor *pr)
ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1");
for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++)
memset(pr->power.states, 0, sizeof(struct acpi_processor_cx));
memset(&(pr->power.states[i]), 0,
sizeof(struct acpi_processor_cx));
/* if info is obtained from pblk/fadt, type equals state */
pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
......@@ -580,7 +584,8 @@ static int acpi_processor_get_power_info_cst (struct acpi_processor *pr)
pr->power.count = 0;
for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++)
memset(pr->power.states, 0, sizeof(struct acpi_processor_cx));
memset(&(pr->power.states[i]), 0,
sizeof(struct acpi_processor_cx));
status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer);
if (ACPI_FAILURE(status)) {
......@@ -763,7 +768,6 @@ static void acpi_processor_power_verify_c3(
}
if (pr->flags.bm_check) {
printk("Disabling BM access before entering C3\n");
/* bus mastering control is necessary */
if (!pr->flags.bm_control) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
......@@ -771,7 +775,6 @@ static void acpi_processor_power_verify_c3(
return_VOID;
}
} else {
printk("Invalidating cache before entering C3\n");
/*
* WBINVD should be set in fadt, for C3 state to be
* supported on when bm_check is not required.
......@@ -842,7 +845,7 @@ static int acpi_processor_get_power_info (
result = acpi_processor_get_power_info_cst(pr);
if ((result) || (acpi_processor_power_verify(pr) < 2)) {
result = acpi_processor_get_power_info_fadt(pr);
if (result)
if ((result) || (acpi_processor_power_verify(pr) < 2))
result = acpi_processor_get_power_info_default_c1(pr);
}
......
......@@ -5133,6 +5133,81 @@ static void __devexit skge_remove_one(struct pci_dev *pdev)
kfree(pAC);
}
#ifdef CONFIG_PM
static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
DEV_NET *pNet = netdev_priv(dev);
SK_AC *pAC = pNet->pAC;
struct net_device *otherdev = pAC->dev[1];
if (netif_running(dev)) {
netif_carrier_off(dev);
DoPrintInterfaceChange = SK_FALSE;
SkDrvDeInitAdapter(pAC, 0); /* performs SkGeClose */
netif_device_detach(dev);
}
if (otherdev != dev) {
if (netif_running(otherdev)) {
netif_carrier_off(otherdev);
DoPrintInterfaceChange = SK_FALSE;
SkDrvDeInitAdapter(pAC, 1); /* performs SkGeClose */
netif_device_detach(otherdev);
}
}
pci_save_state(pdev);
pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
if (pAC->AllocFlag & SK_ALLOC_IRQ) {
free_irq(dev->irq, dev);
}
pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0;
}
static int skge_resume(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
DEV_NET *pNet = netdev_priv(dev);
SK_AC *pAC = pNet->pAC;
struct net_device *otherdev = pAC->dev[1];
int ret;
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
pci_enable_device(pdev);
pci_set_master(pdev);
if (pAC->GIni.GIMacsFound == 2)
ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev);
else
ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, pAC->Name, dev);
if (ret) {
printk(KERN_WARNING "sk98lin: unable to acquire IRQ %d\n", dev->irq);
pAC->AllocFlag &= ~SK_ALLOC_IRQ;
dev->irq = 0;
pci_disable_device(pdev);
return -EBUSY;
}
netif_device_attach(dev);
if (netif_running(dev)) {
DoPrintInterfaceChange = SK_FALSE;
SkDrvInitAdapter(pAC, 0); /* first device */
}
if (otherdev != dev) {
netif_device_attach(otherdev);
if (netif_running(otherdev)) {
DoPrintInterfaceChange = SK_FALSE;
SkDrvInitAdapter(pAC, 1); /* second device */
}
}
return 0;
}
#endif
static struct pci_device_id skge_pci_tbl[] = {
{ PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
......@@ -5158,6 +5233,8 @@ static struct pci_driver skge_driver = {
.id_table = skge_pci_tbl,
.probe = skge_probe_one,
.remove = __devexit_p(skge_remove_one),
.suspend = skge_suspend,
.resume = skge_resume,
};
static int __init skge_init(void)
......
......@@ -1107,8 +1107,6 @@ static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state)
pci_read_config_dword(dev, 17*4, &socket->saved_state[1]);
pci_disable_device(dev);
free_irq(dev->irq, socket);
/*
* Some laptops (IBM T22) do not like us putting the Cardbus
* bridge into D3. At a guess, some other laptop will
......@@ -1134,13 +1132,6 @@ static int yenta_dev_resume (struct pci_dev *dev)
pci_enable_device(dev);
pci_set_master(dev);
if (socket->cb_irq)
if (request_irq(socket->cb_irq, yenta_interrupt,
SA_SHIRQ, "yenta", socket)) {
printk(KERN_WARNING "Yenta: request_irq() failed on resume!\n");
socket->cb_irq = 0;
}
if (socket->type && socket->type->restore_state)
socket->type->restore_state(socket);
}
......
......@@ -56,8 +56,9 @@
/* ACPI PCI Interrupt Link (pci_link.c) */
int acpi_irq_penalty_init (void);
int acpi_pci_link_get_irq (acpi_handle handle, int index, int *edge_level,
int acpi_pci_link_allocate_irq (acpi_handle handle, int index, int *edge_level,
int *active_high_low, char **name);
int acpi_pci_link_free_irq(acpi_handle handle);
/* ACPI PCI Interrupt Routing (pci_irq.c) */
......
......@@ -279,8 +279,11 @@
#define __NR_waitid 272
#define __NR_ioprio_set 273
#define __NR_ioprio_get 274
#define __NR_inotify_init 275
#define __NR_inotify_add_watch 276
#define __NR_inotify_rm_watch 277
#define __NR_syscalls 275
#define __NR_syscalls 278
#define __NR(n) #n
......
......@@ -285,8 +285,11 @@
#define __NR_waitid 272
#define __NR_ioprio_set 273
#define __NR_ioprio_get 274
#define __NR_inotify_init 275
#define __NR_inotify_add_watch 276
#define __NR_inotify_rm_watch 277
#define __NR_syscalls 275
#define __NR_syscalls 278
#ifdef __KERNEL__
#define NR_syscalls __NR_syscalls
#endif
......
......@@ -453,9 +453,7 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
* If this matches the last registration, any IRQ resources for gsi
* are freed.
*/
#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
void acpi_unregister_gsi (u32 gsi);
#endif
#ifdef CONFIG_ACPI_PCI
......@@ -480,9 +478,7 @@ struct pci_dev;
int acpi_pci_irq_enable (struct pci_dev *dev);
void acpi_penalize_isa_irq(int irq, int active);
#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
void acpi_pci_irq_disable (struct pci_dev *dev);
#endif
struct acpi_pci_driver {
struct acpi_pci_driver *next;
......
......@@ -86,7 +86,7 @@ asmlinkage void __do_softirq(void)
/* Reset the pending bitmask before enabling irqs */
local_softirq_pending() = 0;
//local_irq_enable();
local_irq_enable();
h = softirq_vec;
......@@ -99,7 +99,7 @@ asmlinkage void __do_softirq(void)
pending >>= 1;
} while (pending);
//local_irq_disable();
local_irq_disable();
pending = local_softirq_pending();
if (pending && --max_restart)
......
......@@ -1061,20 +1061,19 @@ unsigned int nr_free_pages_pgdat(pg_data_t *pgdat)
static unsigned int nr_free_zone_pages(int offset)
{
pg_data_t *pgdat;
/* Just pick one node, since fallback list is circular */
pg_data_t *pgdat = NODE_DATA(numa_node_id());
unsigned int sum = 0;
for_each_pgdat(pgdat) {
struct zonelist *zonelist = pgdat->node_zonelists + offset;
struct zone **zonep = zonelist->zones;
struct zone *zone;
struct zonelist *zonelist = pgdat->node_zonelists + offset;
struct zone **zonep = zonelist->zones;
struct zone *zone;
for (zone = *zonep++; zone; zone = *zonep++) {
unsigned long size = zone->present_pages;
unsigned long high = zone->pages_high;
if (size > high)
sum += size - high;
}
for (zone = *zonep++; zone; zone = *zonep++) {
unsigned long size = zone->present_pages;
unsigned long high = zone->pages_high;
if (size > high)
sum += size - high;
}
return sum;
......
......@@ -2376,6 +2376,9 @@ static int intel8x0_suspend(snd_card_t *card, pm_message_t state)
snd_ac97_suspend(chip->ac97[i]);
if (chip->device_type == DEVICE_INTEL_ICH4)
chip->sdm_saved = igetbyte(chip, ICHREG(SDM));
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
pci_disable_device(chip->pci);
return 0;
}
......@@ -2387,7 +2390,9 @@ static int intel8x0_resume(snd_card_t *card)
pci_enable_device(chip->pci);
pci_set_master(chip->pci);
snd_intel8x0_chip_init(chip, 0);
request_irq(chip->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip);
synchronize_irq(chip->irq);
snd_intel8x0_chip_init(chip, 1);
/* re-initialize mixer stuff */
if (chip->device_type == DEVICE_INTEL_ICH4) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment