diff options
-rw-r--r-- | drivers/regulator/da9063-regulator.c | 2 | ||||
-rw-r--r-- | drivers/regulator/palmas-regulator.c | 14 | ||||
-rw-r--r-- | drivers/regulator/ti-abb-regulator.c | 16 | ||||
-rw-r--r-- | drivers/regulator/wm831x-ldo.c | 4 | ||||
-rw-r--r-- | drivers/regulator/wm8350-regulator.c | 2 | ||||
-rw-r--r-- | fs/afs/dir.c | 3 | ||||
-rw-r--r-- | fs/ocfs2/dcache.c | 7 | ||||
-rw-r--r-- | fs/sysv/super.c | 1 | ||||
-rw-r--r-- | include/linux/regulator/driver.h | 2 | ||||
-rw-r--r-- | security/apparmor/crypto.c | 34 | ||||
-rw-r--r-- | security/apparmor/include/policy.h | 4 | ||||
-rw-r--r-- | security/apparmor/policy.c | 3 |
12 files changed, 53 insertions, 39 deletions
diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c index 1a7816390773..b9f2653e4ef9 100644 --- a/drivers/regulator/da9063-regulator.c +++ b/drivers/regulator/da9063-regulator.c | |||
@@ -709,7 +709,7 @@ static struct da9063_regulators_pdata *da9063_parse_regulators_dt( | |||
709 | struct of_regulator_match **da9063_reg_matches) | 709 | struct of_regulator_match **da9063_reg_matches) |
710 | { | 710 | { |
711 | da9063_reg_matches = NULL; | 711 | da9063_reg_matches = NULL; |
712 | return PTR_ERR(-ENODEV); | 712 | return ERR_PTR(-ENODEV); |
713 | } | 713 | } |
714 | #endif | 714 | #endif |
715 | 715 | ||
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 488dfe7ce9a6..7e2b165972e6 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c | |||
@@ -201,13 +201,7 @@ static unsigned int palmas_smps_ramp_delay[4] = {0, 10000, 5000, 2500}; | |||
201 | #define SMPS_CTRL_MODE_ECO 0x02 | 201 | #define SMPS_CTRL_MODE_ECO 0x02 |
202 | #define SMPS_CTRL_MODE_PWM 0x03 | 202 | #define SMPS_CTRL_MODE_PWM 0x03 |
203 | 203 | ||
204 | /* These values are derived from the data sheet. And are the number of steps | 204 | #define PALMAS_SMPS_NUM_VOLTAGES 122 |
205 | * where there is a voltage change, the ranges at beginning and end of register | ||
206 | * max/min values where there are no change are ommitted. | ||
207 | * | ||
208 | * So they are basically (maxV-minV)/stepV | ||
209 | */ | ||
210 | #define PALMAS_SMPS_NUM_VOLTAGES 117 | ||
211 | #define PALMAS_SMPS10_NUM_VOLTAGES 2 | 205 | #define PALMAS_SMPS10_NUM_VOLTAGES 2 |
212 | #define PALMAS_LDO_NUM_VOLTAGES 50 | 206 | #define PALMAS_LDO_NUM_VOLTAGES 50 |
213 | 207 | ||
@@ -979,6 +973,7 @@ static int palmas_regulators_probe(struct platform_device *pdev) | |||
979 | pmic->desc[id].min_uV = 900000; | 973 | pmic->desc[id].min_uV = 900000; |
980 | pmic->desc[id].uV_step = 50000; | 974 | pmic->desc[id].uV_step = 50000; |
981 | pmic->desc[id].linear_min_sel = 1; | 975 | pmic->desc[id].linear_min_sel = 1; |
976 | pmic->desc[id].enable_time = 500; | ||
982 | pmic->desc[id].vsel_reg = | 977 | pmic->desc[id].vsel_reg = |
983 | PALMAS_BASE_TO_REG(PALMAS_LDO_BASE, | 978 | PALMAS_BASE_TO_REG(PALMAS_LDO_BASE, |
984 | palmas_regs_info[id].vsel_addr); | 979 | palmas_regs_info[id].vsel_addr); |
@@ -997,6 +992,11 @@ static int palmas_regulators_probe(struct platform_device *pdev) | |||
997 | pmic->desc[id].min_uV = 450000; | 992 | pmic->desc[id].min_uV = 450000; |
998 | pmic->desc[id].uV_step = 25000; | 993 | pmic->desc[id].uV_step = 25000; |
999 | } | 994 | } |
995 | |||
996 | /* LOD6 in vibrator mode will have enable time 2000us */ | ||
997 | if (pdata && pdata->ldo6_vibrator && | ||
998 | (id == PALMAS_REG_LDO6)) | ||
999 | pmic->desc[id].enable_time = 2000; | ||
1000 | } else { | 1000 | } else { |
1001 | pmic->desc[id].n_voltages = 1; | 1001 | pmic->desc[id].n_voltages = 1; |
1002 | pmic->desc[id].ops = &palmas_ops_extreg; | 1002 | pmic->desc[id].ops = &palmas_ops_extreg; |
diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c index d8e3e1262bc2..20c271d49dcb 100644 --- a/drivers/regulator/ti-abb-regulator.c +++ b/drivers/regulator/ti-abb-regulator.c | |||
@@ -279,8 +279,12 @@ static int ti_abb_set_opp(struct regulator_dev *rdev, struct ti_abb *abb, | |||
279 | ti_abb_rmw(regs->opp_sel_mask, info->opp_sel, regs->control_reg, | 279 | ti_abb_rmw(regs->opp_sel_mask, info->opp_sel, regs->control_reg, |
280 | abb->base); | 280 | abb->base); |
281 | 281 | ||
282 | /* program LDO VBB vset override if needed */ | 282 | /* |
283 | if (abb->ldo_base) | 283 | * program LDO VBB vset override if needed for !bypass mode |
284 | * XXX: Do not switch sequence - for !bypass, LDO override reset *must* | ||
285 | * be performed *before* switch to bias mode else VBB glitches. | ||
286 | */ | ||
287 | if (abb->ldo_base && info->opp_sel != TI_ABB_NOMINAL_OPP) | ||
284 | ti_abb_program_ldovbb(dev, abb, info); | 288 | ti_abb_program_ldovbb(dev, abb, info); |
285 | 289 | ||
286 | /* Initiate ABB ldo change */ | 290 | /* Initiate ABB ldo change */ |
@@ -295,6 +299,14 @@ static int ti_abb_set_opp(struct regulator_dev *rdev, struct ti_abb *abb, | |||
295 | if (ret) | 299 | if (ret) |
296 | goto out; | 300 | goto out; |
297 | 301 | ||
302 | /* | ||
303 | * Reset LDO VBB vset override bypass mode | ||
304 | * XXX: Do not switch sequence - for bypass, LDO override reset *must* | ||
305 | * be performed *after* switch to bypass else VBB glitches. | ||
306 | */ | ||
307 | if (abb->ldo_base && info->opp_sel == TI_ABB_NOMINAL_OPP) | ||
308 | ti_abb_program_ldovbb(dev, abb, info); | ||
309 | |||
298 | out: | 310 | out: |
299 | return ret; | 311 | return ret; |
300 | } | 312 | } |
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c index 1432b26ef2e9..2205fbc2c37b 100644 --- a/drivers/regulator/wm831x-ldo.c +++ b/drivers/regulator/wm831x-ldo.c | |||
@@ -63,7 +63,7 @@ static irqreturn_t wm831x_ldo_uv_irq(int irq, void *data) | |||
63 | */ | 63 | */ |
64 | 64 | ||
65 | static const struct regulator_linear_range wm831x_gp_ldo_ranges[] = { | 65 | static const struct regulator_linear_range wm831x_gp_ldo_ranges[] = { |
66 | { .min_uV = 900000, .max_uV = 1650000, .min_sel = 0, .max_sel = 14, | 66 | { .min_uV = 900000, .max_uV = 1600000, .min_sel = 0, .max_sel = 14, |
67 | .uV_step = 50000 }, | 67 | .uV_step = 50000 }, |
68 | { .min_uV = 1700000, .max_uV = 3300000, .min_sel = 15, .max_sel = 31, | 68 | { .min_uV = 1700000, .max_uV = 3300000, .min_sel = 15, .max_sel = 31, |
69 | .uV_step = 100000 }, | 69 | .uV_step = 100000 }, |
@@ -332,7 +332,7 @@ static struct platform_driver wm831x_gp_ldo_driver = { | |||
332 | */ | 332 | */ |
333 | 333 | ||
334 | static const struct regulator_linear_range wm831x_aldo_ranges[] = { | 334 | static const struct regulator_linear_range wm831x_aldo_ranges[] = { |
335 | { .min_uV = 1000000, .max_uV = 1650000, .min_sel = 0, .max_sel = 12, | 335 | { .min_uV = 1000000, .max_uV = 1600000, .min_sel = 0, .max_sel = 12, |
336 | .uV_step = 50000 }, | 336 | .uV_step = 50000 }, |
337 | { .min_uV = 1700000, .max_uV = 3500000, .min_sel = 13, .max_sel = 31, | 337 | { .min_uV = 1700000, .max_uV = 3500000, .min_sel = 13, .max_sel = 31, |
338 | .uV_step = 100000 }, | 338 | .uV_step = 100000 }, |
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 835b5f0f344e..61ca9292a429 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c | |||
@@ -543,7 +543,7 @@ static int wm8350_dcdc_set_suspend_mode(struct regulator_dev *rdev, | |||
543 | } | 543 | } |
544 | 544 | ||
545 | static const struct regulator_linear_range wm8350_ldo_ranges[] = { | 545 | static const struct regulator_linear_range wm8350_ldo_ranges[] = { |
546 | { .min_uV = 900000, .max_uV = 1750000, .min_sel = 0, .max_sel = 15, | 546 | { .min_uV = 900000, .max_uV = 1650000, .min_sel = 0, .max_sel = 15, |
547 | .uV_step = 50000 }, | 547 | .uV_step = 50000 }, |
548 | { .min_uV = 1800000, .max_uV = 3300000, .min_sel = 16, .max_sel = 31, | 548 | { .min_uV = 1800000, .max_uV = 3300000, .min_sel = 16, .max_sel = 31, |
549 | .uV_step = 100000 }, | 549 | .uV_step = 100000 }, |
diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 646337dc5201..529300327f45 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c | |||
@@ -600,9 +600,6 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) | |||
600 | 600 | ||
601 | /* lock down the parent dentry so we can peer at it */ | 601 | /* lock down the parent dentry so we can peer at it */ |
602 | parent = dget_parent(dentry); | 602 | parent = dget_parent(dentry); |
603 | if (!parent->d_inode) | ||
604 | goto out_bad; | ||
605 | |||
606 | dir = AFS_FS_I(parent->d_inode); | 603 | dir = AFS_FS_I(parent->d_inode); |
607 | 604 | ||
608 | /* validate the parent directory */ | 605 | /* validate the parent directory */ |
diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index ef999729e274..0d3a97d2d5f6 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c | |||
@@ -70,9 +70,10 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry, unsigned int flags) | |||
70 | */ | 70 | */ |
71 | if (inode == NULL) { | 71 | if (inode == NULL) { |
72 | unsigned long gen = (unsigned long) dentry->d_fsdata; | 72 | unsigned long gen = (unsigned long) dentry->d_fsdata; |
73 | unsigned long pgen = | 73 | unsigned long pgen; |
74 | OCFS2_I(dentry->d_parent->d_inode)->ip_dir_lock_gen; | 74 | spin_lock(&dentry->d_lock); |
75 | 75 | pgen = OCFS2_I(dentry->d_parent->d_inode)->ip_dir_lock_gen; | |
76 | spin_unlock(&dentry->d_lock); | ||
76 | trace_ocfs2_dentry_revalidate_negative(dentry->d_name.len, | 77 | trace_ocfs2_dentry_revalidate_negative(dentry->d_name.len, |
77 | dentry->d_name.name, | 78 | dentry->d_name.name, |
78 | pgen, gen); | 79 | pgen, gen); |
diff --git a/fs/sysv/super.c b/fs/sysv/super.c index d0c6a007ce83..eda10959714f 100644 --- a/fs/sysv/super.c +++ b/fs/sysv/super.c | |||
@@ -487,6 +487,7 @@ static int v7_fill_super(struct super_block *sb, void *data, int silent) | |||
487 | sbi->s_sb = sb; | 487 | sbi->s_sb = sb; |
488 | sbi->s_block_base = 0; | 488 | sbi->s_block_base = 0; |
489 | sbi->s_type = FSTYPE_V7; | 489 | sbi->s_type = FSTYPE_V7; |
490 | mutex_init(&sbi->s_lock); | ||
490 | sb->s_fs_info = sbi; | 491 | sb->s_fs_info = sbi; |
491 | 492 | ||
492 | sb_set_blocksize(sb, 512); | 493 | sb_set_blocksize(sb, 512); |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 67e13aa5a478..9bdad43ad228 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -40,6 +40,8 @@ enum regulator_status { | |||
40 | }; | 40 | }; |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * struct regulator_linear_range - specify linear voltage ranges | ||
44 | * | ||
43 | * Specify a range of voltages for regulator_map_linar_range() and | 45 | * Specify a range of voltages for regulator_map_linar_range() and |
44 | * regulator_list_linear_range(). | 46 | * regulator_list_linear_range(). |
45 | * | 47 | * |
diff --git a/security/apparmor/crypto.c b/security/apparmor/crypto.c index d6222ba4e919..532471d0b3a0 100644 --- a/security/apparmor/crypto.c +++ b/security/apparmor/crypto.c | |||
@@ -15,14 +15,14 @@ | |||
15 | * it should be. | 15 | * it should be. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <linux/crypto.h> | 18 | #include <crypto/hash.h> |
19 | 19 | ||
20 | #include "include/apparmor.h" | 20 | #include "include/apparmor.h" |
21 | #include "include/crypto.h" | 21 | #include "include/crypto.h" |
22 | 22 | ||
23 | static unsigned int apparmor_hash_size; | 23 | static unsigned int apparmor_hash_size; |
24 | 24 | ||
25 | static struct crypto_hash *apparmor_tfm; | 25 | static struct crypto_shash *apparmor_tfm; |
26 | 26 | ||
27 | unsigned int aa_hash_size(void) | 27 | unsigned int aa_hash_size(void) |
28 | { | 28 | { |
@@ -32,35 +32,33 @@ unsigned int aa_hash_size(void) | |||
32 | int aa_calc_profile_hash(struct aa_profile *profile, u32 version, void *start, | 32 | int aa_calc_profile_hash(struct aa_profile *profile, u32 version, void *start, |
33 | size_t len) | 33 | size_t len) |
34 | { | 34 | { |
35 | struct scatterlist sg[2]; | 35 | struct { |
36 | struct hash_desc desc = { | 36 | struct shash_desc shash; |
37 | .tfm = apparmor_tfm, | 37 | char ctx[crypto_shash_descsize(apparmor_tfm)]; |
38 | .flags = 0 | 38 | } desc; |
39 | }; | ||
40 | int error = -ENOMEM; | 39 | int error = -ENOMEM; |
41 | u32 le32_version = cpu_to_le32(version); | 40 | u32 le32_version = cpu_to_le32(version); |
42 | 41 | ||
43 | if (!apparmor_tfm) | 42 | if (!apparmor_tfm) |
44 | return 0; | 43 | return 0; |
45 | 44 | ||
46 | sg_init_table(sg, 2); | ||
47 | sg_set_buf(&sg[0], &le32_version, 4); | ||
48 | sg_set_buf(&sg[1], (u8 *) start, len); | ||
49 | |||
50 | profile->hash = kzalloc(apparmor_hash_size, GFP_KERNEL); | 45 | profile->hash = kzalloc(apparmor_hash_size, GFP_KERNEL); |
51 | if (!profile->hash) | 46 | if (!profile->hash) |
52 | goto fail; | 47 | goto fail; |
53 | 48 | ||
54 | error = crypto_hash_init(&desc); | 49 | desc.shash.tfm = apparmor_tfm; |
50 | desc.shash.flags = 0; | ||
51 | |||
52 | error = crypto_shash_init(&desc.shash); | ||
55 | if (error) | 53 | if (error) |
56 | goto fail; | 54 | goto fail; |
57 | error = crypto_hash_update(&desc, &sg[0], 4); | 55 | error = crypto_shash_update(&desc.shash, (u8 *) &le32_version, 4); |
58 | if (error) | 56 | if (error) |
59 | goto fail; | 57 | goto fail; |
60 | error = crypto_hash_update(&desc, &sg[1], len); | 58 | error = crypto_shash_update(&desc.shash, (u8 *) start, len); |
61 | if (error) | 59 | if (error) |
62 | goto fail; | 60 | goto fail; |
63 | error = crypto_hash_final(&desc, profile->hash); | 61 | error = crypto_shash_final(&desc.shash, profile->hash); |
64 | if (error) | 62 | if (error) |
65 | goto fail; | 63 | goto fail; |
66 | 64 | ||
@@ -75,19 +73,19 @@ fail: | |||
75 | 73 | ||
76 | static int __init init_profile_hash(void) | 74 | static int __init init_profile_hash(void) |
77 | { | 75 | { |
78 | struct crypto_hash *tfm; | 76 | struct crypto_shash *tfm; |
79 | 77 | ||
80 | if (!apparmor_initialized) | 78 | if (!apparmor_initialized) |
81 | return 0; | 79 | return 0; |
82 | 80 | ||
83 | tfm = crypto_alloc_hash("sha1", 0, CRYPTO_ALG_ASYNC); | 81 | tfm = crypto_alloc_shash("sha1", 0, CRYPTO_ALG_ASYNC); |
84 | if (IS_ERR(tfm)) { | 82 | if (IS_ERR(tfm)) { |
85 | int error = PTR_ERR(tfm); | 83 | int error = PTR_ERR(tfm); |
86 | AA_ERROR("failed to setup profile sha1 hashing: %d\n", error); | 84 | AA_ERROR("failed to setup profile sha1 hashing: %d\n", error); |
87 | return error; | 85 | return error; |
88 | } | 86 | } |
89 | apparmor_tfm = tfm; | 87 | apparmor_tfm = tfm; |
90 | apparmor_hash_size = crypto_hash_digestsize(apparmor_tfm); | 88 | apparmor_hash_size = crypto_shash_digestsize(apparmor_tfm); |
91 | 89 | ||
92 | aa_info_message("AppArmor sha1 policy hashing enabled"); | 90 | aa_info_message("AppArmor sha1 policy hashing enabled"); |
93 | 91 | ||
diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h index f2d4b6348cbc..c28b0f20ab53 100644 --- a/security/apparmor/include/policy.h +++ b/security/apparmor/include/policy.h | |||
@@ -360,7 +360,9 @@ static inline void aa_put_replacedby(struct aa_replacedby *p) | |||
360 | static inline void __aa_update_replacedby(struct aa_profile *orig, | 360 | static inline void __aa_update_replacedby(struct aa_profile *orig, |
361 | struct aa_profile *new) | 361 | struct aa_profile *new) |
362 | { | 362 | { |
363 | struct aa_profile *tmp = rcu_dereference(orig->replacedby->profile); | 363 | struct aa_profile *tmp; |
364 | tmp = rcu_dereference_protected(orig->replacedby->profile, | ||
365 | mutex_is_locked(&orig->ns->lock)); | ||
364 | rcu_assign_pointer(orig->replacedby->profile, aa_get_profile(new)); | 366 | rcu_assign_pointer(orig->replacedby->profile, aa_get_profile(new)); |
365 | orig->flags |= PFLAG_INVALID; | 367 | orig->flags |= PFLAG_INVALID; |
366 | aa_put_profile(tmp); | 368 | aa_put_profile(tmp); |
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 6172509fa2b7..345bec07a27d 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c | |||
@@ -563,7 +563,8 @@ void __init aa_free_root_ns(void) | |||
563 | static void free_replacedby(struct aa_replacedby *r) | 563 | static void free_replacedby(struct aa_replacedby *r) |
564 | { | 564 | { |
565 | if (r) { | 565 | if (r) { |
566 | aa_put_profile(rcu_dereference(r->profile)); | 566 | /* r->profile will not be updated any more as r is dead */ |
567 | aa_put_profile(rcu_dereference_protected(r->profile, true)); | ||
567 | kzfree(r); | 568 | kzfree(r); |
568 | } | 569 | } |
569 | } | 570 | } |