Commit cb48dc6c authored by Dennis Rassmann's avatar Dennis Rassmann

Merge branch 'exp'

parents 96b53c8d 19981f8f
......@@ -49,12 +49,14 @@
#define DEVICE_NAME "smdpkt"
#define WAKELOCK_TIMEOUT (2*HZ)
#define SMD_PKT_MAGIC (0xDEADBAAD)
struct smd_pkt_dev {
struct cdev cdev;
struct device *devicep;
void *pil;
char pdriver_name[PDRIVER_NAME_MAX_SIZE];
int magic;
struct platform_driver driver;
struct smd_channel *ch;
......@@ -826,8 +828,6 @@ int smd_pkt_open(struct inode *inode, struct file *file)
}
D_STATUS("Begin %s on smd_pkt_dev id:%d\n", __func__, smd_pkt_devp->i);
file->private_data = smd_pkt_devp;
mutex_lock(&smd_pkt_devp->ch_lock);
if (smd_pkt_devp->ch == 0) {
wake_lock_init(&smd_pkt_devp->pa_wake_lock, WAKE_LOCK_SUSPEND,
......@@ -942,6 +942,8 @@ release_pd:
platform_driver_unregister(&smd_pkt_devp->driver);
smd_pkt_devp->driver.probe = NULL;
}
else if (r == 0)
file->private_data = smd_pkt_devp;
out:
if (!smd_pkt_devp->ch)
wake_lock_destroy(&smd_pkt_devp->pa_wake_lock);
......@@ -976,8 +978,14 @@ int smd_pkt_release(struct inode *inode, struct file *file)
smd_pkt_devp->ch = 0;
smd_pkt_devp->blocking_write = 0;
smd_pkt_devp->poll_mode = 0;
platform_driver_unregister(&smd_pkt_devp->driver);
smd_pkt_devp->driver.probe = NULL;
if (smd_pkt_devp->driver.probe) {
platform_driver_unregister(&smd_pkt_devp->driver);
smd_pkt_devp->driver.probe = NULL;
} else {
pr_err("%s: invalid unregister dev id:%d magic %x\n",
__func__, smd_pkt_devp->i,
smd_pkt_devp->magic);
}
if (smd_pkt_devp->pil)
pil_put(smd_pkt_devp->pil);
smd_pkt_devp->has_reset = 0;
......@@ -1044,6 +1052,7 @@ static int __init smd_pkt_init(void)
smd_pkt_devp[i]->is_open = 0;
smd_pkt_devp[i]->poll_mode = 0;
smd_pkt_devp[i]->wakelock_locked = 0;
smd_pkt_devp[i]->magic = SMD_PKT_MAGIC;
init_waitqueue_head(&smd_pkt_devp[i]->ch_opened_wait_queue);
spin_lock_init(&smd_pkt_devp[i]->pa_spinlock);
......@@ -1117,6 +1126,7 @@ static void __exit smd_pkt_cleanup(void)
for (i = 0; i < NUM_SMD_PKT_PORTS; ++i) {
cdev_del(&smd_pkt_devp[i]->cdev);
smd_pkt_devp[i]->magic = 0;
kfree(smd_pkt_devp[i]);
device_destroy(smd_pkt_classp,
MKDEV(MAJOR(smd_pkt_number), i));
......
ARCH=arm
BRANCH=android-msm-mako-3.4-clean-wip
CROSS_COMPILE=arm-eabi-
DEFCONFIG=mako_defconfig
EXTRA_CMDS=''
KERNEL_DIR=private/msm-lge
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin
FILES="
arch/arm/boot/zImage
vmlinux
System.map
"
......@@ -137,12 +137,6 @@ struct pid_entry {
static int proc_fd_permission(struct inode *inode, int mask);
/* ANDROID is for special files in /proc. */
#define ANDROID(NAME, MODE, OTYPE) \
NOD(NAME, (S_IFREG|(MODE)), \
&proc_##OTYPE##_inode_operations, \
&proc_##OTYPE##_operations, {})
/*
* Count the number of hardlinks for the pid_entry table, excluding the .
* and .. links.
......@@ -975,35 +969,6 @@ out:
return err < 0 ? err : count;
}
static int oom_adjust_permission(struct inode *inode, int mask)
{
uid_t uid;
struct task_struct *p;
p = get_proc_task(inode);
if(p) {
uid = task_uid(p);
put_task_struct(p);
}
/*
* System Server (uid == 1000) is granted access to oom_adj of all
* android applications (uid > 10000) as and services (uid >= 1000)
*/
if (p && (current_fsuid() == 1000) && (uid >= 1000)) {
if (inode->i_mode >> 6 & mask) {
return 0;
}
}
/* Fall back to default. */
return generic_permission(inode, mask);
}
static const struct inode_operations proc_oom_adjust_inode_operations = {
.permission = oom_adjust_permission,
};
static const struct file_operations proc_oom_adjust_operations = {
.read = oom_adjust_read,
.write = oom_adjust_write,
......@@ -3043,8 +3008,8 @@ static const struct pid_entry tgid_base_stuff[] = {
REG("cgroup", S_IRUGO, proc_cgroup_operations),
#endif
INF("oom_score", S_IRUGO, proc_oom_score),
ANDROID("oom_adj",S_IRUGO|S_IWUSR, oom_adjust),
REG("oom_score_adj", S_IRUGO|S_IWUSR, proc_oom_score_adj_operations),
REG("oom_adj", S_IRUSR, proc_oom_adjust_operations),
REG("oom_score_adj", S_IRUSR, proc_oom_score_adj_operations),
#ifdef CONFIG_AUDITSYSCALL
REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations),
REG("sessionid", S_IRUGO, proc_sessionid_operations),
......@@ -3401,8 +3366,8 @@ static const struct pid_entry tid_base_stuff[] = {
REG("cgroup", S_IRUGO, proc_cgroup_operations),
#endif
INF("oom_score", S_IRUGO, proc_oom_score),
REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adjust_operations),
REG("oom_score_adj", S_IRUGO|S_IWUSR, proc_oom_score_adj_operations),
REG("oom_adj", S_IRUSR, proc_oom_adjust_operations),
REG("oom_score_adj", S_IRUSR, proc_oom_score_adj_operations),
#ifdef CONFIG_AUDITSYSCALL
REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations),
REG("sessionid", S_IRUGO, proc_sessionid_operations),
......
......@@ -625,7 +625,14 @@ void *idr_get_next(struct idr *idp, int *nextidp)
return p;
}
id += 1 << n;
/*
* Proceed to the next layer at the current level. Unlike
* idr_for_each(), @id isn't guaranteed to be aligned to
* layer boundary at this point and adding 1 << n may
* incorrectly skip IDs. Make sure we jump to the
* beginning of the next layer using round_up().
*/
id = round_up(id + 1, 1 << n);
while (n < fls(id)) {
n += IDR_BITS;
p = *--paa;
......
......@@ -153,6 +153,7 @@ void ping_unhash(struct sock *sk)
if (sk_hashed(sk)) {
write_lock_bh(&ping_table.lock);
hlist_nulls_del(&sk->sk_nulls_node);
sk_nulls_node_init(&sk->sk_nulls_node);
sock_put(sk);
isk->inet_num = 0;
isk->inet_sport = 0;
......
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