Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87857
b: refs/heads/master
c: 33fd7af
h: refs/heads/master
i:
  87855: 6337af3
v: v3
  • Loading branch information
Len Brown committed Mar 26, 2008
1 parent bbd7bca commit 7e3d6e2
Show file tree
Hide file tree
Showing 24 changed files with 365 additions and 413 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8e92b6605da989c0aa8ff7e33306f36f0efd957c
refs/heads/master: 33fd7afd66ffdc6addf1b085fe6403b6af532f8e
2 changes: 1 addition & 1 deletion trunk/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 25
EXTRAVERSION = -rc6
EXTRAVERSION = -rc7
NAME = Funky Weasel is Jiggy wit it

# *DOCUMENTATION*
Expand Down
18 changes: 14 additions & 4 deletions trunk/arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ static int is_io_pte(unsigned long pte)

static int is_rmap_pte(u64 pte)
{
return pte != shadow_trap_nonpresent_pte
&& pte != shadow_notrap_nonpresent_pte;
return is_shadow_present_pte(pte);
}

static gfn_t pse36_gfn_delta(u32 gpte)
Expand Down Expand Up @@ -893,14 +892,25 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
int *ptwrite, gfn_t gfn, struct page *page)
{
u64 spte;
int was_rmapped = is_rmap_pte(*shadow_pte);
int was_rmapped = 0;
int was_writeble = is_writeble_pte(*shadow_pte);
hfn_t host_pfn = (*shadow_pte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT;

pgprintk("%s: spte %llx access %x write_fault %d"
" user_fault %d gfn %lx\n",
__FUNCTION__, *shadow_pte, pt_access,
write_fault, user_fault, gfn);

if (is_rmap_pte(*shadow_pte)) {
if (host_pfn != page_to_pfn(page)) {
pgprintk("hfn old %lx new %lx\n",
host_pfn, page_to_pfn(page));
rmap_remove(vcpu->kvm, shadow_pte);
}
else
was_rmapped = 1;
}

/*
* We don't set the accessed bit, since we sometimes want to see
* whether the guest actually used the pte (in order to detect
Expand Down Expand Up @@ -1402,7 +1412,7 @@ static void mmu_guess_page_from_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
up_read(&current->mm->mmap_sem);

vcpu->arch.update_pte.gfn = gfn;
vcpu->arch.update_pte.page = gfn_to_page(vcpu->kvm, gfn);
vcpu->arch.update_pte.page = page;
}

void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
Expand Down
7 changes: 2 additions & 5 deletions trunk/arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,6 @@ static void update_exception_bitmap(struct kvm_vcpu *vcpu)

static void reload_tss(void)
{
#ifndef CONFIG_X86_64

/*
* VT restores TR but not its size. Useless.
*/
Expand All @@ -361,7 +359,6 @@ static void reload_tss(void)
descs = (void *)gdt.base;
descs[GDT_ENTRY_TSS].type = 9; /* available TSS */
load_TR_desc();
#endif
}

static void load_transition_efer(struct vcpu_vmx *vmx)
Expand Down Expand Up @@ -1436,7 +1433,7 @@ static int init_rmode_tss(struct kvm *kvm)
int ret = 0;
int r;

down_read(&current->mm->mmap_sem);
down_read(&kvm->slots_lock);
r = kvm_clear_guest_page(kvm, fn, 0, PAGE_SIZE);
if (r < 0)
goto out;
Expand All @@ -1459,7 +1456,7 @@ static int init_rmode_tss(struct kvm *kvm)

ret = 1;
out:
up_read(&current->mm->mmap_sem);
up_read(&kvm->slots_lock);
return ret;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/acpi/pci_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ struct prt_quirk {
*/
static struct prt_quirk prt_quirks[] = {
{ medion_md9580, 0, 0, 9, 'A',
"\\_SB_.PCI0.ISA.LNKA",
"\\_SB_.PCI0.ISA.LNKB"},
"\\_SB_.PCI0.ISA_.LNKA",
"\\_SB_.PCI0.ISA_.LNKB"},
{ dell_optiplex, 0, 0, 0xd, 'A',
"\\_SB_.LNKB",
"\\_SB_.LNKA"},
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
return 0;
}

acpi_unlazy_tlb(smp_processor_id());
/*
* Must be done before busmaster disable as we might need to
* access HPET !
Expand Down Expand Up @@ -1576,8 +1577,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
return 0;
}

acpi_unlazy_tlb(smp_processor_id());

/* Tell the scheduler that we are going deep-idle: */
sched_clock_idle_sleep_event();
/*
Expand Down Expand Up @@ -1693,9 +1692,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
switch (cx->type) {
case ACPI_STATE_C1:
state->flags |= CPUIDLE_FLAG_SHALLOW;
if (cx->entry_method == ACPI_CSTATE_FFH)
state->flags |= CPUIDLE_FLAG_TIME_VALID;

state->flags |= CPUIDLE_FLAG_TIME_VALID;
state->enter = acpi_idle_enter_c1;
dev->safe_state = state;
break;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/cpuidle/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void cpuidle_idle_call(void)
/* enter the state and update stats */
dev->last_residency = target_state->enter(dev, target_state);
dev->last_state = target_state;
target_state->time += (unsigned long long)dev->last_residency;
target_state->time += dev->last_residency;
target_state->usage++;

/* give the governor an opportunity to reflect on the outcome */
Expand Down Expand Up @@ -224,7 +224,7 @@ static void poll_idle_init(struct cpuidle_device *dev)
state->exit_latency = 0;
state->target_residency = 0;
state->power_usage = -1;
state->flags = CPUIDLE_FLAG_POLL;
state->flags = CPUIDLE_FLAG_POLL | CPUIDLE_FLAG_TIME_VALID;
state->enter = poll_idle;
}
#else
Expand Down
10 changes: 2 additions & 8 deletions trunk/drivers/cpuidle/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,6 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
return sprintf(buf, "%u\n", state->_name);\
}

#define define_show_state_ull_function(_name) \
static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
{ \
return sprintf(buf, "%llu\n", state->_name);\
}

#define define_show_state_str_function(_name) \
static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
{ \
Expand All @@ -234,8 +228,8 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \

define_show_state_function(exit_latency)
define_show_state_function(power_usage)
define_show_state_ull_function(usage)
define_show_state_ull_function(time)
define_show_state_function(usage)
define_show_state_function(time)
define_show_state_str_function(name)
define_show_state_str_function(desc)

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ config I2C_AU1550

config I2C_BLACKFIN_TWI
tristate "Blackfin TWI I2C support"
depends on BF534 || BF536 || BF537 || BF54x
depends on BF534 || BF536 || BF537
help
This is the TWI I2C device driver for Blackfin 534/536/537/54x.
This driver can also be built as a module. If so, the module
Expand Down
36 changes: 28 additions & 8 deletions trunk/drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ struct omap_i2c_dev {
size_t buf_len;
struct i2c_adapter adapter;
unsigned rev1:1;
unsigned idle:1;
u16 iestate; /* Saved interrupt register */
};

static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev,
Expand Down Expand Up @@ -174,18 +176,30 @@ static void omap_i2c_put_clocks(struct omap_i2c_dev *dev)
}
}

static void omap_i2c_enable_clocks(struct omap_i2c_dev *dev)
static void omap_i2c_unidle(struct omap_i2c_dev *dev)
{
if (dev->iclk != NULL)
clk_enable(dev->iclk);
clk_enable(dev->fclk);
if (dev->iestate)
omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
dev->idle = 0;
}

static void omap_i2c_disable_clocks(struct omap_i2c_dev *dev)
static void omap_i2c_idle(struct omap_i2c_dev *dev)
{
u16 iv;

dev->idle = 1;
dev->iestate = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, 0);
if (dev->rev1)
iv = omap_i2c_read_reg(dev, OMAP_I2C_IV_REG); /* Read clears */
else
omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, dev->iestate);
clk_disable(dev->fclk);
if (dev->iclk != NULL)
clk_disable(dev->iclk);
clk_disable(dev->fclk);
}

static int omap_i2c_init(struct omap_i2c_dev *dev)
Expand Down Expand Up @@ -360,7 +374,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
int i;
int r;

omap_i2c_enable_clocks(dev);
omap_i2c_unidle(dev);

if ((r = omap_i2c_wait_for_bb(dev)) < 0)
goto out;
Expand All @@ -374,7 +388,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
if (r == 0)
r = num;
out:
omap_i2c_disable_clocks(dev);
omap_i2c_idle(dev);
return r;
}

Expand Down Expand Up @@ -403,6 +417,9 @@ omap_i2c_rev1_isr(int this_irq, void *dev_id)
struct omap_i2c_dev *dev = dev_id;
u16 iv, w;

if (dev->idle)
return IRQ_NONE;

iv = omap_i2c_read_reg(dev, OMAP_I2C_IV_REG);
switch (iv) {
case 0x00: /* None */
Expand Down Expand Up @@ -457,6 +474,9 @@ omap_i2c_isr(int this_irq, void *dev_id)
u16 stat, w;
int count = 0;

if (dev->idle)
return IRQ_NONE;

bits = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
while ((stat = (omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG))) & bits) {
dev_dbg(dev->dev, "IRQ (ISR = 0x%04x)\n", stat);
Expand Down Expand Up @@ -575,7 +595,7 @@ omap_i2c_probe(struct platform_device *pdev)
if ((r = omap_i2c_get_clocks(dev)) != 0)
goto err_free_mem;

omap_i2c_enable_clocks(dev);
omap_i2c_unidle(dev);

if (cpu_is_omap15xx())
dev->rev1 = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG) < 0x20;
Expand Down Expand Up @@ -610,15 +630,15 @@ omap_i2c_probe(struct platform_device *pdev)
goto err_free_irq;
}

omap_i2c_disable_clocks(dev);
omap_i2c_idle(dev);

return 0;

err_free_irq:
free_irq(dev->irq, dev);
err_unuse_clocks:
omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
omap_i2c_disable_clocks(dev);
omap_i2c_idle(dev);
omap_i2c_put_clocks(dev);
err_free_mem:
platform_set_drvdata(pdev, NULL);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ EXPORT_SYMBOL(i2c_add_adapter);
* Context: can sleep
*
* This routine is used to declare an I2C adapter when its bus number
* matters. Example: for I2C adapters from system-on-chip CPUs, or
* otherwise built in to the system's mainboard, and where i2c_board_info
* matters. For example, use it for I2C adapters from system-on-chip CPUs,
* or otherwise built in to the system's mainboard, and where i2c_board_info
* is used to properly configure I2C devices.
*
* If no devices have pre-been declared for this bus, then be sure to
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/pnp/pnpacpi/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
i < PNP_MAX_IRQ)
i++;
if (i >= PNP_MAX_IRQ && !warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ "
printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ "
"resources: %d \n", PNP_MAX_IRQ);
warned = 1;
return;
Expand Down Expand Up @@ -187,7 +187,7 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
res->dma_resource[i].start = dma;
res->dma_resource[i].end = dma;
} else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of DMA "
printk(KERN_WARNING "pnpacpi: exceeded the max number of DMA "
"resources: %d \n", PNP_MAX_DMA);
warned = 1;
}
Expand All @@ -213,7 +213,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
res->port_resource[i].start = io;
res->port_resource[i].end = io + len - 1;
} else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
printk(KERN_WARNING "pnpacpi: exceeded the max number of IO "
"resources: %d \n", PNP_MAX_PORT);
warned = 1;
}
Expand Down Expand Up @@ -241,7 +241,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
res->mem_resource[i].start = mem;
res->mem_resource[i].end = mem + len - 1;
} else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
printk(KERN_WARNING "pnpacpi: exceeded the max number of mem "
"resources: %d\n", PNP_MAX_MEM);
warned = 1;
}
Expand Down
18 changes: 8 additions & 10 deletions trunk/fs/anon_inodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,10 @@ int anon_inode_getfd(int *pfd, struct inode **pinode, struct file **pfile,

if (IS_ERR(anon_inode_inode))
return -ENODEV;
file = get_empty_filp();
if (!file)
return -ENFILE;

error = get_unused_fd();
if (error < 0)
goto err_put_filp;
return error;
fd = error;

/*
Expand All @@ -114,14 +111,15 @@ int anon_inode_getfd(int *pfd, struct inode **pinode, struct file **pfile,
dentry->d_flags &= ~DCACHE_UNHASHED;
d_instantiate(dentry, anon_inode_inode);

file->f_path.mnt = mntget(anon_inode_mnt);
file->f_path.dentry = dentry;
error = -ENFILE;
file = alloc_file(anon_inode_mnt, dentry,
FMODE_READ | FMODE_WRITE, fops);
if (!file)
goto err_dput;
file->f_mapping = anon_inode_inode->i_mapping;

file->f_pos = 0;
file->f_flags = O_RDWR;
file->f_op = fops;
file->f_mode = FMODE_READ | FMODE_WRITE;
file->f_version = 0;
file->private_data = priv;

Expand All @@ -132,10 +130,10 @@ int anon_inode_getfd(int *pfd, struct inode **pinode, struct file **pfile,
*pfile = file;
return 0;

err_dput:
dput(dentry);
err_put_unused_fd:
put_unused_fd(fd);
err_put_filp:
put_filp(file);
return error;
}
EXPORT_SYMBOL_GPL(anon_inode_getfd);
Expand Down
6 changes: 6 additions & 0 deletions trunk/fs/file_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ int proc_nr_files(ctl_table *table, int write, struct file *filp,
/* Find an unused file structure and return a pointer to it.
* Returns NULL, if there are no more free file structures or
* we run out of memory.
*
* Be very careful using this. You are responsible for
* getting write access to any mount that you might assign
* to this filp, if it is opened for write. If this is not
* done, you will imbalance int the mount's writer count
* and a warning at __fput() time.
*/
struct file *get_empty_filp(void)
{
Expand Down
Loading

0 comments on commit 7e3d6e2

Please sign in to comment.