Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300330
b: refs/heads/master
c: c0a5f4a
h: refs/heads/master
v: v3
  • Loading branch information
Rajkumar Kasirajan authored and Linus Torvalds committed May 18, 2012
1 parent a5e7040 commit 0445fc6
Show file tree
Hide file tree
Showing 15 changed files with 82 additions and 79 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: 30a08bf2d31d275c6fc71dd1811342777e95c831
refs/heads/master: c0a5f4a05af588a0f9951f8d24e2564b09501918
4 changes: 1 addition & 3 deletions trunk/arch/arm/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags);

check_stack:
/* Don't allow expansion below FIRST_USER_ADDRESS */
if (vma->vm_flags & VM_GROWSDOWN &&
addr >= FIRST_USER_ADDRESS && !expand_stack(vma, addr))
if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr))
goto good_area;
out:
return fault;
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,7 @@ static void __init build_mem_type_table(void)
*/
for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
mem_types[i].prot_pte |= PTE_EXT_AF;
if (mem_types[i].prot_sect)
mem_types[i].prot_sect |= PMD_SECT_AF;
mem_types[i].prot_sect |= PMD_SECT_AF;
}
kern_pgprot |= PTE_EXT_AF;
vecs_pgprot |= PTE_EXT_AF;
Expand Down
24 changes: 16 additions & 8 deletions trunk/arch/arm/vfp/vfpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <linux/types.h>
#include <linux/cpu.h>
#include <linux/cpu_pm.h>
#include <linux/hardirq.h>
#include <linux/kernel.h>
#include <linux/notifier.h>
#include <linux/signal.h>
Expand Down Expand Up @@ -433,10 +432,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)

static void vfp_enable(void *unused)
{
u32 access;

BUG_ON(preemptible());
access = get_copro_access();
u32 access = get_copro_access();

/*
* Enable full access to VFP (cp10 and cp11)
Expand Down Expand Up @@ -577,6 +573,12 @@ int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp,
* entry.
*/
hwstate->fpscr &= ~(FPSCR_LENGTH_MASK | FPSCR_STRIDE_MASK);

/*
* Disable VFP in the hwstate so that we can detect if it gets
* used.
*/
hwstate->fpexc &= ~FPEXC_EN;
return 0;
}

Expand All @@ -589,8 +591,12 @@ int vfp_restore_user_hwstate(struct user_vfp __user *ufp,
unsigned long fpexc;
int err = 0;

/* Disable VFP to avoid corrupting the new thread state. */
vfp_flush_hwstate(thread);
/*
* If VFP has been used, then disable it to avoid corrupting
* the new thread state.
*/
if (hwstate->fpexc & FPEXC_EN)
vfp_flush_hwstate(thread);

/*
* Copy the floating point registers. There can be unused
Expand Down Expand Up @@ -651,7 +657,7 @@ static int __init vfp_init(void)
unsigned int cpu_arch = cpu_architecture();

if (cpu_arch >= CPU_ARCH_ARMv6)
on_each_cpu(vfp_enable, NULL, 1);
vfp_enable(NULL);

/*
* First check that there is a VFP that we can use.
Expand All @@ -672,6 +678,8 @@ static int __init vfp_init(void)
} else {
hotcpu_notifier(vfp_hotplug, 0);

smp_call_function(vfp_enable, NULL, 1);

VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */
printk("implementor %02x architecture %d part %02x variant %x rev %x\n",
(vfpsid & FPSID_IMPLEMENTER_MASK) >> FPSID_IMPLEMENTER_BIT,
Expand Down
14 changes: 3 additions & 11 deletions trunk/arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,18 +945,16 @@ struct mce_info {
atomic_t inuse;
struct task_struct *t;
__u64 paddr;
int restartable;
} mce_info[MCE_INFO_MAX];

static void mce_save_info(__u64 addr, int c)
static void mce_save_info(__u64 addr)
{
struct mce_info *mi;

for (mi = mce_info; mi < &mce_info[MCE_INFO_MAX]; mi++) {
if (atomic_cmpxchg(&mi->inuse, 0, 1) == 0) {
mi->t = current;
mi->paddr = addr;
mi->restartable = c;
return;
}
}
Expand Down Expand Up @@ -1132,7 +1130,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
mce_panic("Fatal machine check on current CPU", &m, msg);
if (worst == MCE_AR_SEVERITY) {
/* schedule action before return to userland */
mce_save_info(m.addr, m.mcgstatus & MCG_STATUS_RIPV);
mce_save_info(m.addr);
set_thread_flag(TIF_MCE_NOTIFY);
} else if (kill_it) {
force_sig(SIGBUS, current);
Expand Down Expand Up @@ -1181,13 +1179,7 @@ void mce_notify_process(void)

pr_err("Uncorrected hardware memory error in user-access at %llx",
mi->paddr);
/*
* We must call memory_failure() here even if the current process is
* doomed. We still need to mark the page as poisoned and alert any
* other users of the page.
*/
if (memory_failure(pfn, MCE_VECTOR, MF_ACTION_REQUIRED) < 0 ||
mi->restartable == 0) {
if (memory_failure(pfn, MCE_VECTOR, MF_ACTION_REQUIRED) < 0) {
pr_err("Memory error not recovered");
force_sig(SIGBUS, current);
}
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,6 @@ static int __acpi_bus_set_power(struct acpi_device *device, int state)
return -ENODEV;
}

/* For D3cold we should execute _PS3, not _PS4. */
if (state == ACPI_STATE_D3_COLD)
object_name[3] = '3';

/*
* Transition Power
* ----------------
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ int acpi_power_on_resources(struct acpi_device *device, int state)

int acpi_power_transition(struct acpi_device *device, int state)
{
int result = 0;
int result;

if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD))
return -EINVAL;
Expand All @@ -679,11 +679,8 @@ int acpi_power_transition(struct acpi_device *device, int state)
* (e.g. so the device doesn't lose power while transitioning). Then,
* we dereference all power resources used in the current list.
*/
if (state < ACPI_STATE_D3_COLD)
result = acpi_power_on_list(
&device->power.states[state].resources);

if (!result && device->power.state < ACPI_STATE_D3_COLD)
result = acpi_power_on_list(&device->power.states[state].resources);
if (!result)
acpi_power_off_list(
&device->power.states[device->power.state].resources);

Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,10 +908,6 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
device->power.states[ACPI_STATE_D3].flags.valid = 1;
device->power.states[ACPI_STATE_D3].power = 0;

/* Set D3cold's explicit_set flag if _PS3 exists. */
if (device->power.states[ACPI_STATE_D3_HOT].flags.explicit_set)
device->power.states[ACPI_STATE_D3_COLD].flags.explicit_set = 1;

acpi_bus_init_power(device);

return 0;
Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/net/ethernet/intel/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,7 @@ static void e1000_power_down_phy(struct e1000_adapter *adapter)
static void e1000_down_and_stop(struct e1000_adapter *adapter)
{
set_bit(__E1000_DOWN, &adapter->flags);

/* Only kill reset task if adapter is not resetting */
if (!test_bit(__E1000_RESETTING, &adapter->flags))
cancel_work_sync(&adapter->reset_task);

cancel_work_sync(&adapter->reset_task);
cancel_delayed_work_sync(&adapter->watchdog_task);
cancel_delayed_work_sync(&adapter->phy_info_task);
cancel_delayed_work_sync(&adapter->fifo_stall_task);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pci/pci-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
[PCI_D0] = ACPI_STATE_D0,
[PCI_D1] = ACPI_STATE_D1,
[PCI_D2] = ACPI_STATE_D2,
[PCI_D3hot] = ACPI_STATE_D3,
[PCI_D3hot] = ACPI_STATE_D3_HOT,
[PCI_D3cold] = ACPI_STATE_D3
};
int error = -EINVAL;
Expand Down
18 changes: 18 additions & 0 deletions trunk/drivers/rtc/rtc-pl031.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
int ret;
struct pl031_local *ldata;
struct rtc_class_ops *ops = id->data;
unsigned long time;

ret = amba_request_regions(adev, NULL);
if (ret)
Expand Down Expand Up @@ -343,6 +344,23 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN,
ldata->base + RTC_CR);

/*
* On ST PL031 variants, the RTC reset value does not provide correct
* weekday for 2000-01-01. Correct the erroneous sunday to saturday.
*/
if (ldata->hw_designer == AMBA_VENDOR_ST) {
if (readl(ldata->base + RTC_YDR) == 0x2000) {
time = readl(ldata->base + RTC_DR);
if ((time &
(RTC_MON_MASK | RTC_MDAY_MASK | RTC_WDAY_MASK))
== 0x02120000) {
time = time | (0x7 << RTC_WDAY_SHIFT);
writel(0x2000, ldata->base + RTC_YLR);
writel(time, ldata->base + RTC_LR);
}
}
}

ldata->rtc = rtc_device_register("pl031", &adev->dev, ops,
THIS_MODULE);
if (IS_ERR(ldata->rtc)) {
Expand Down
22 changes: 6 additions & 16 deletions trunk/drivers/target/target_core_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ static struct se_device *fd_create_virtdevice(
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
struct request_queue *q;
unsigned long long dev_size;
/*
* Setup the local scope queue_limits from struct request_queue->limits
* to pass into transport_add_device_to_core_hba() as struct se_dev_limits.
Expand All @@ -184,12 +183,13 @@ static struct se_device *fd_create_virtdevice(
* one (1) logical sector from underlying struct block_device
*/
fd_dev->fd_block_size = bdev_logical_block_size(inode->i_bdev);
dev_size = (i_size_read(file->f_mapping->host) -
fd_dev->fd_dev_size = (i_size_read(file->f_mapping->host) -
fd_dev->fd_block_size);

pr_debug("FILEIO: Using size: %llu bytes from struct"
" block_device blocks: %llu logical_block_size: %d\n",
dev_size, div_u64(dev_size, fd_dev->fd_block_size),
fd_dev->fd_dev_size,
div_u64(fd_dev->fd_dev_size, fd_dev->fd_block_size),
fd_dev->fd_block_size);
} else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
Expand Down Expand Up @@ -605,20 +605,10 @@ static u32 fd_get_device_type(struct se_device *dev)
static sector_t fd_get_blocks(struct se_device *dev)
{
struct fd_dev *fd_dev = dev->dev_ptr;
struct file *f = fd_dev->fd_file;
struct inode *i = f->f_mapping->host;
unsigned long long dev_size;
/*
* When using a file that references an underlying struct block_device,
* ensure dev_size is always based on the current inode size in order
* to handle underlying block_device resize operations.
*/
if (S_ISBLK(i->i_mode))
dev_size = (i_size_read(i) - fd_dev->fd_block_size);
else
dev_size = fd_dev->fd_dev_size;
unsigned long long blocks_long = div_u64(fd_dev->fd_dev_size,
dev->se_sub_dev->se_dev_attrib.block_size);

return div_u64(dev_size, dev->se_sub_dev->se_dev_attrib.block_size);
return blocks_long;
}

static struct se_subsystem_api fileio_template = {
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/target/target_core_pr.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ int target_scsi2_reservation_release(struct se_task *task)
if (dev->dev_reserved_node_acl != sess->se_node_acl)
goto out_unlock;

if (dev->dev_res_bin_isid != sess->sess_bin_isid)
goto out_unlock;

dev->dev_reserved_node_acl = NULL;
dev->dev_flags &= ~DF_SPC2_RESERVATIONS;
if (dev->dev_flags & DF_SPC2_RESERVATIONS_WITH_ISID) {
Expand Down
43 changes: 29 additions & 14 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1799,15 +1799,10 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
if (task) {
files = get_files_struct(task);
if (files) {
struct file *file;
rcu_read_lock();
file = fcheck_files(files, fd);
if (file) {
unsigned i_mode, f_mode = file->f_mode;

if (fcheck_files(files, fd)) {
rcu_read_unlock();
put_files_struct(files);

if (task_dumpable(task)) {
rcu_read_lock();
cred = __task_cred(task);
Expand All @@ -1818,14 +1813,7 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
inode->i_uid = 0;
inode->i_gid = 0;
}

i_mode = S_IFLNK;
if (f_mode & FMODE_READ)
i_mode |= S_IRUSR | S_IXUSR;
if (f_mode & FMODE_WRITE)
i_mode |= S_IWUSR | S_IXUSR;
inode->i_mode = i_mode;

inode->i_mode &= ~(S_ISUID | S_ISGID);
security_task_to_inode(task, inode);
put_task_struct(task);
return 1;
Expand All @@ -1849,6 +1837,8 @@ static struct dentry *proc_fd_instantiate(struct inode *dir,
struct dentry *dentry, struct task_struct *task, const void *ptr)
{
unsigned fd = *(const unsigned *)ptr;
struct file *file;
struct files_struct *files;
struct inode *inode;
struct proc_inode *ei;
struct dentry *error = ERR_PTR(-ENOENT);
Expand All @@ -1858,6 +1848,25 @@ static struct dentry *proc_fd_instantiate(struct inode *dir,
goto out;
ei = PROC_I(inode);
ei->fd = fd;
files = get_files_struct(task);
if (!files)
goto out_iput;
inode->i_mode = S_IFLNK;

/*
* We are not taking a ref to the file structure, so we must
* hold ->file_lock.
*/
spin_lock(&files->file_lock);
file = fcheck_files(files, fd);
if (!file)
goto out_unlock;
if (file->f_mode & FMODE_READ)
inode->i_mode |= S_IRUSR | S_IXUSR;
if (file->f_mode & FMODE_WRITE)
inode->i_mode |= S_IWUSR | S_IXUSR;
spin_unlock(&files->file_lock);
put_files_struct(files);

inode->i_op = &proc_pid_link_inode_operations;
inode->i_size = 64;
Expand All @@ -1870,6 +1879,12 @@ static struct dentry *proc_fd_instantiate(struct inode *dir,

out:
return error;
out_unlock:
spin_unlock(&files->file_lock);
put_files_struct(files);
out_iput:
iput(inode);
goto out;
}

static struct dentry *proc_lookupfd_common(struct inode *dir,
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,8 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse
wait_for_sndbuf:
set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
wait_for_memory:
tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);
if (copied)
tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);

if ((err = sk_stream_wait_memory(sk, &timeo)) != 0)
goto do_error;
Expand Down

0 comments on commit 0445fc6

Please sign in to comment.