Skip to content

Commit

Permalink
Merge branch 'upstream-3.0' into tuxonice-3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelCunningham committed Mar 16, 2013
2 parents 8b9a552 + b86163d commit cfbe8b0
Show file tree
Hide file tree
Showing 23 changed files with 112 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 68
SUBLEVEL = 69
EXTRAVERSION =
NAME = Sneaky Weasel

Expand Down
11 changes: 4 additions & 7 deletions arch/arm/mm/alignment.c
Expand Up @@ -721,24 +721,22 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
unsigned long instr = 0, instrptr;
int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs);
unsigned int type;
mm_segment_t fs;
unsigned int fault;
u16 tinstr = 0;
int isize = 4;
int thumb2_32b = 0;

instrptr = instruction_pointer(regs);

fs = get_fs();
set_fs(KERNEL_DS);
if (thumb_mode(regs)) {
fault = __get_user(tinstr, (u16 *)(instrptr & ~1));
u16 *ptr = (u16 *)(instrptr & ~1);
fault = probe_kernel_address(ptr, tinstr);
if (!fault) {
if (cpu_architecture() >= CPU_ARCH_ARMv7 &&
IS_T32(tinstr)) {
/* Thumb-2 32-bit */
u16 tinst2 = 0;
fault = __get_user(tinst2, (u16 *)(instrptr+2));
fault = probe_kernel_address(ptr + 1, tinst2);
instr = (tinstr << 16) | tinst2;
thumb2_32b = 1;
} else {
Expand All @@ -747,8 +745,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
}
}
} else
fault = __get_user(instr, (u32 *)instrptr);
set_fs(fs);
fault = probe_kernel_address(instrptr, instr);

if (fault) {
type = TYPE_FAULT;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/vfp/vfpmodule.c
Expand Up @@ -369,7 +369,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
* If there isn't a second FP instruction, exit now. Note that
* the FPEXC.FP2V bit is valid only if FPEXC.EX is 1.
*/
if (fpexc ^ (FPEXC_EX | FPEXC_FP2V))
if ((fpexc & (FPEXC_EX | FPEXC_FP2V)) != (FPEXC_EX | FPEXC_FP2V))
goto exit;

/*
Expand Down
19 changes: 16 additions & 3 deletions drivers/char/hw_random/core.c
Expand Up @@ -40,6 +40,7 @@
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <asm/uaccess.h>


Expand All @@ -52,8 +53,12 @@ static struct hwrng *current_rng;
static LIST_HEAD(rng_list);
static DEFINE_MUTEX(rng_mutex);
static int data_avail;
static u8 rng_buffer[SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES]
__cacheline_aligned;
static u8 *rng_buffer;

static size_t rng_buffer_size(void)
{
return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES;
}

static inline int hwrng_init(struct hwrng *rng)
{
Expand Down Expand Up @@ -116,7 +121,7 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf,

if (!data_avail) {
bytes_read = rng_get_data(current_rng, rng_buffer,
sizeof(rng_buffer),
rng_buffer_size(),
!(filp->f_flags & O_NONBLOCK));
if (bytes_read < 0) {
err = bytes_read;
Expand Down Expand Up @@ -307,6 +312,14 @@ int hwrng_register(struct hwrng *rng)

mutex_lock(&rng_mutex);

/* kmalloc makes this safe for virt_to_page() in virtio_rng.c */
err = -ENOMEM;
if (!rng_buffer) {
rng_buffer = kmalloc(rng_buffer_size(), GFP_KERNEL);
if (!rng_buffer)
goto out_unlock;
}

/* Must not register two RNGs with the same name. */
err = -EEXIST;
list_for_each_entry(tmp, &rng_list, list) {
Expand Down
1 change: 1 addition & 0 deletions drivers/cpufreq/cpufreq_stats.c
Expand Up @@ -329,6 +329,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
cpufreq_update_policy(cpu);
break;
case CPU_DOWN_PREPARE:
case CPU_DOWN_PREPARE_FROZEN:
cpufreq_stats_free_sysfs(cpu);
break;
case CPU_DEAD:
Expand Down
5 changes: 2 additions & 3 deletions drivers/firmware/dmi_scan.c
Expand Up @@ -442,7 +442,6 @@ static int __init dmi_present(const char __iomem *p)
static int __init smbios_present(const char __iomem *p)
{
u8 buf[32];
int offset = 0;

memcpy_fromio(buf, p, 32);
if ((buf[5] < 32) && dmi_checksum(buf, buf[5])) {
Expand All @@ -461,9 +460,9 @@ static int __init smbios_present(const char __iomem *p)
dmi_ver = 0x0206;
break;
}
offset = 16;
return memcmp(p + 16, "_DMI_", 5) || dmi_present(p + 16);
}
return dmi_present(buf + offset);
return 1;
}

void __init dmi_scan_machine(void)
Expand Down
9 changes: 9 additions & 0 deletions drivers/gpu/drm/radeon/radeon_combios.c
Expand Up @@ -958,6 +958,15 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct
found = 1;
}

/* quirks */
/* Radeon 9100 (R200) */
if ((dev->pdev->device == 0x514D) &&
(dev->pdev->subsystem_vendor == 0x174B) &&
(dev->pdev->subsystem_device == 0x7149)) {
/* vbios value is bad, use the default */
found = 0;
}

if (!found) /* fallback to defaults */
radeon_legacy_get_primary_dac_info_from_table(rdev, p_dac);

Expand Down
8 changes: 7 additions & 1 deletion drivers/hwmon/sht15.c
Expand Up @@ -926,7 +926,13 @@ static int __devinit sht15_probe(struct platform_device *pdev)
if (voltage)
data->supply_uV = voltage;

regulator_enable(data->reg);
ret = regulator_enable(data->reg);
if (ret != 0) {
dev_err(&pdev->dev,
"failed to enable regulator: %d\n", ret);
return ret;
}

/*
* Setup a notifier block to update this if another device
* causes the voltage to change
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/raid0.c
Expand Up @@ -283,7 +283,7 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
kfree(conf->strip_zone);
kfree(conf->devlist);
kfree(conf);
*private_conf = NULL;
*private_conf = ERR_PTR(err);
return err;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/e1000e/netdev.c
Expand Up @@ -5330,7 +5330,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake,
*/
e1000e_release_hw_control(adapter);

pci_disable_device(pdev);
pci_clear_master(pdev);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/common.h
Expand Up @@ -35,7 +35,7 @@
#define WME_AC_BK 3
#define WME_NUM_AC 4

#define ATH_RSSI_DUMMY_MARKER 0x127
#define ATH_RSSI_DUMMY_MARKER 127
#define ATH_RSSI_LPF_LEN 10
#define RSSI_LPF_THRESHOLD -20
#define ATH_RSSI_EP_MULTIPLIER (1<<7)
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/dc395x.c
Expand Up @@ -3747,13 +3747,13 @@ static struct DeviceCtlBlk *device_alloc(struct AdapterCtlBlk *acb,
dcb->max_command = 1;
dcb->target_id = target;
dcb->target_lun = lun;
dcb->dev_mode = eeprom->target[target].cfg0;
#ifndef DC395x_NO_DISCONNECT
dcb->identify_msg =
IDENTIFY(dcb->dev_mode & NTC_DO_DISCONNECT, lun);
#else
dcb->identify_msg = IDENTIFY(0, lun);
#endif
dcb->dev_mode = eeprom->target[target].cfg0;
dcb->inquiry7 = 0;
dcb->sync_mode = 0;
dcb->min_nego_period = clock_period[period_index];
Expand Down
1 change: 0 additions & 1 deletion drivers/target/target_core_pscsi.c
Expand Up @@ -1210,7 +1210,6 @@ static int __pscsi_map_task_SG(
bio = NULL;
}

page++;
len -= bytes;
data_len -= bytes;
off = 0;
Expand Down
1 change: 1 addition & 0 deletions fs/btrfs/volumes.c
Expand Up @@ -512,6 +512,7 @@ static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
new_device->writeable = 0;
new_device->in_fs_metadata = 0;
new_device->can_discard = 0;
spin_lock_init(&new_device->io_lock);
list_replace_rcu(&device->dev_list, &new_device->dev_list);

call_rcu(&device->rcu, free_device);
Expand Down
5 changes: 5 additions & 0 deletions fs/cifs/cifsfs.c
Expand Up @@ -571,6 +571,11 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
dentry = ERR_PTR(-ENOENT);
break;
}
if (!S_ISDIR(dir->i_mode)) {
dput(dentry);
dentry = ERR_PTR(-ENOTDIR);
break;
}

/* skip separators */
while (*s == sep)
Expand Down
3 changes: 3 additions & 0 deletions fs/pipe.c
Expand Up @@ -859,6 +859,9 @@ pipe_rdwr_open(struct inode *inode, struct file *filp)
{
int ret = -ENOENT;

if (!(filp->f_mode & (FMODE_READ|FMODE_WRITE)))
return -EINVAL;

mutex_lock(&inode->i_mutex);

if (inode->i_pipe) {
Expand Down
24 changes: 14 additions & 10 deletions kernel/trace/Kconfig
Expand Up @@ -386,24 +386,28 @@ config KPROBE_EVENT
If you want to use perf tools, this option is strongly recommended.

config DYNAMIC_FTRACE
bool "enable/disable ftrace tracepoints dynamically"
bool "enable/disable function tracing dynamically"
depends on FUNCTION_TRACER
depends on HAVE_DYNAMIC_FTRACE
default y
help
This option will modify all the calls to ftrace dynamically
(will patch them out of the binary image and replace them
with a No-Op instruction) as they are called. A table is
created to dynamically enable them again.
This option will modify all the calls to function tracing
dynamically (will patch them out of the binary image and
replace them with a No-Op instruction) on boot up. During
compile time, a table is made of all the locations that ftrace
can function trace, and this table is linked into the kernel
image. When this is enabled, functions can be individually
enabled, and the functions not enabled will not affect
performance of the system.

See the files in /sys/kernel/debug/tracing:
available_filter_functions
set_ftrace_filter
set_ftrace_notrace

This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
otherwise has native performance as long as no tracing is active.

The changes to the code are done by a kernel thread that
wakes up once a second and checks to see if any ftrace calls
were made. If so, it runs stop_machine (stops all CPUS)
and modifies the code to jump over the call to ftrace.

config FUNCTION_PROFILER
bool "Kernel function profiler"
depends on FUNCTION_TRACER
Expand Down
4 changes: 4 additions & 0 deletions net/decnet/af_decnet.c
Expand Up @@ -2355,6 +2355,8 @@ static const struct proto_ops dn_proto_ops = {
.sendpage = sock_no_sendpage,
};

void dn_register_sysctl_skeleton(void);
void dn_unregister_sysctl_skeleton(void);
void dn_register_sysctl(void);
void dn_unregister_sysctl(void);

Expand All @@ -2375,6 +2377,7 @@ static int __init decnet_init(void)
if (rc != 0)
goto out;

dn_register_sysctl_skeleton();
dn_neigh_init();
dn_dev_init();
dn_route_init();
Expand Down Expand Up @@ -2414,6 +2417,7 @@ static void __exit decnet_exit(void)
dn_fib_cleanup();

proc_net_remove(&init_net, "decnet");
dn_unregister_sysctl_skeleton();

proto_unregister(&dn_proto);

Expand Down
28 changes: 28 additions & 0 deletions net/decnet/sysctl_net_decnet.c
Expand Up @@ -55,6 +55,7 @@ static int max_decnet_no_fc_max_cwnd[] = { NSP_MAX_WINDOW };
static char node_name[7] = "???";

static struct ctl_table_header *dn_table_header = NULL;
static struct ctl_table_header *dn_skeleton_table_header = NULL;

/*
* ctype.h :-)
Expand Down Expand Up @@ -356,6 +357,27 @@ static struct ctl_path dn_path[] = {
{ }
};

static struct ctl_table empty[1];

static struct ctl_table dn_skeleton[] = {
{
.procname = "conf",
.mode = 0555,
.child = empty,
},
{ }
};

void dn_register_sysctl_skeleton(void)
{
dn_skeleton_table_header = register_sysctl_paths(dn_path, dn_skeleton);
}

void dn_unregister_sysctl_skeleton(void)
{
unregister_sysctl_table(dn_skeleton_table_header);
}

void dn_register_sysctl(void)
{
dn_table_header = register_sysctl_paths(dn_path, dn_table);
Expand All @@ -367,6 +389,12 @@ void dn_unregister_sysctl(void)
}

#else /* CONFIG_SYSCTL */
void dn_register_sysctl_skeleton(void)
{
}
void dn_unregister_sysctl_skeleton(void)
{
}
void dn_unregister_sysctl(void)
{
}
Expand Down
6 changes: 5 additions & 1 deletion net/sunrpc/xprt.c
Expand Up @@ -471,13 +471,17 @@ EXPORT_SYMBOL_GPL(xprt_wake_pending_tasks);
* xprt_wait_for_buffer_space - wait for transport output buffer to clear
* @task: task to be put to sleep
* @action: function pointer to be executed after wait
*
* Note that we only set the timer for the case of RPC_IS_SOFT(), since
* we don't in general want to force a socket disconnection due to
* an incomplete RPC call transmission.
*/
void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action)
{
struct rpc_rqst *req = task->tk_rqstp;
struct rpc_xprt *xprt = req->rq_xprt;

task->tk_timeout = req->rq_timeout;
task->tk_timeout = RPC_IS_SOFT(task) ? req->rq_timeout : 0;
rpc_sleep_on(&xprt->pending, task, action);
}
EXPORT_SYMBOL_GPL(xprt_wait_for_buffer_space);
Expand Down
2 changes: 1 addition & 1 deletion security/keys/process_keys.c
Expand Up @@ -54,7 +54,7 @@ int install_user_keyrings(void)

kenter("%p{%u}", user, user->uid);

if (user->uid_keyring) {
if (user->uid_keyring && user->session_keyring) {
kleave(" = 0 [exist]");
return 0;
}
Expand Down
5 changes: 4 additions & 1 deletion sound/core/vmaster.c
Expand Up @@ -207,7 +207,10 @@ static int slave_put(struct snd_kcontrol *kcontrol,
}
if (!changed)
return 0;
return slave_put_val(slave, ucontrol);
err = slave_put_val(slave, ucontrol);
if (err < 0)
return err;
return 1;
}

static int slave_tlv_cmd(struct snd_kcontrol *kcontrol,
Expand Down

0 comments on commit cfbe8b0

Please sign in to comment.