Skip to content

Commit eaa8857

Browse files
author
Alex Shi
committed
Merge tag 'v4.4.40' into linux-linaro-lsk-v4.4
This is the 4.4.40 stable release
2 parents 6381499 + a3edc7b commit eaa8857

67 files changed

Lines changed: 632 additions & 256 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 39
3+
SUBLEVEL = 40
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

arch/arm/xen/enlighten.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ static int __init xen_guest_init(void)
239239
* for secondary CPUs as they are brought up.
240240
* For uniformity we use VCPUOP_register_vcpu_info even on cpu0.
241241
*/
242-
xen_vcpu_info = __alloc_percpu(sizeof(struct vcpu_info),
243-
sizeof(struct vcpu_info));
242+
xen_vcpu_info = alloc_percpu(struct vcpu_info);
244243
if (xen_vcpu_info == NULL)
245244
return -ENOMEM;
246245

block/blk-mq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,9 +1313,9 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
13131313
blk_mq_put_ctx(data.ctx);
13141314
if (!old_rq)
13151315
goto done;
1316-
if (!blk_mq_direct_issue_request(old_rq, &cookie))
1317-
goto done;
1318-
blk_mq_insert_request(old_rq, false, true, true);
1316+
if (test_bit(BLK_MQ_S_STOPPED, &data.hctx->state) ||
1317+
blk_mq_direct_issue_request(old_rq, &cookie) != 0)
1318+
blk_mq_insert_request(old_rq, false, true, true);
13191319
goto done;
13201320
}
13211321

drivers/base/core.c

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -836,23 +836,36 @@ static struct kobject *get_device_parent(struct device *dev,
836836
return NULL;
837837
}
838838

839+
static inline bool live_in_glue_dir(struct kobject *kobj,
840+
struct device *dev)
841+
{
842+
if (!kobj || !dev->class ||
843+
kobj->kset != &dev->class->p->glue_dirs)
844+
return false;
845+
return true;
846+
}
847+
848+
static inline struct kobject *get_glue_dir(struct device *dev)
849+
{
850+
return dev->kobj.parent;
851+
}
852+
853+
/*
854+
* make sure cleaning up dir as the last step, we need to make
855+
* sure .release handler of kobject is run with holding the
856+
* global lock
857+
*/
839858
static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
840859
{
841860
/* see if we live in a "glue" directory */
842-
if (!glue_dir || !dev->class ||
843-
glue_dir->kset != &dev->class->p->glue_dirs)
861+
if (!live_in_glue_dir(glue_dir, dev))
844862
return;
845863

846864
mutex_lock(&gdp_mutex);
847865
kobject_put(glue_dir);
848866
mutex_unlock(&gdp_mutex);
849867
}
850868

851-
static void cleanup_device_parent(struct device *dev)
852-
{
853-
cleanup_glue_dir(dev, dev->kobj.parent);
854-
}
855-
856869
static int device_add_class_symlinks(struct device *dev)
857870
{
858871
struct device_node *of_node = dev_of_node(dev);
@@ -1028,6 +1041,7 @@ int device_add(struct device *dev)
10281041
struct kobject *kobj;
10291042
struct class_interface *class_intf;
10301043
int error = -EINVAL;
1044+
struct kobject *glue_dir = NULL;
10311045

10321046
dev = get_device(dev);
10331047
if (!dev)
@@ -1072,8 +1086,10 @@ int device_add(struct device *dev)
10721086
/* first, register with generic layer. */
10731087
/* we require the name to be set before, and pass NULL */
10741088
error = kobject_add(&dev->kobj, dev->kobj.parent, NULL);
1075-
if (error)
1089+
if (error) {
1090+
glue_dir = get_glue_dir(dev);
10761091
goto Error;
1092+
}
10771093

10781094
/* notify platform of device entry */
10791095
if (platform_notify)
@@ -1154,9 +1170,10 @@ int device_add(struct device *dev)
11541170
device_remove_file(dev, &dev_attr_uevent);
11551171
attrError:
11561172
kobject_uevent(&dev->kobj, KOBJ_REMOVE);
1173+
glue_dir = get_glue_dir(dev);
11571174
kobject_del(&dev->kobj);
11581175
Error:
1159-
cleanup_device_parent(dev);
1176+
cleanup_glue_dir(dev, glue_dir);
11601177
put_device(parent);
11611178
name_error:
11621179
kfree(dev->p);
@@ -1232,6 +1249,7 @@ EXPORT_SYMBOL_GPL(put_device);
12321249
void device_del(struct device *dev)
12331250
{
12341251
struct device *parent = dev->parent;
1252+
struct kobject *glue_dir = NULL;
12351253
struct class_interface *class_intf;
12361254

12371255
/* Notify clients of device removal. This call must come
@@ -1276,8 +1294,9 @@ void device_del(struct device *dev)
12761294
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
12771295
BUS_NOTIFY_REMOVED_DEVICE, dev);
12781296
kobject_uevent(&dev->kobj, KOBJ_REMOVE);
1279-
cleanup_device_parent(dev);
1297+
glue_dir = get_glue_dir(dev);
12801298
kobject_del(&dev->kobj);
1299+
cleanup_glue_dir(dev, glue_dir);
12811300
put_device(parent);
12821301
}
12831302
EXPORT_SYMBOL_GPL(device_del);

drivers/block/loop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx,
16571657
blk_mq_start_request(bd->rq);
16581658

16591659
if (lo->lo_state != Lo_bound)
1660-
return -EIO;
1660+
return BLK_MQ_RQ_QUEUE_ERROR;
16611661

16621662
if (lo->use_dio && !(cmd->rq->cmd_flags & (REQ_FLUSH |
16631663
REQ_DISCARD)))

drivers/char/tpm/xen-tpmfront.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ static int tpmfront_probe(struct xenbus_device *dev,
305305
rv = setup_ring(dev, priv);
306306
if (rv) {
307307
chip = dev_get_drvdata(&dev->dev);
308-
tpm_chip_unregister(chip);
309308
ring_free(priv);
310309
return rv;
311310
}

drivers/clk/ti/clk-3xxx.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222

2323
#include "clock.h"
2424

25-
/*
26-
* DPLL5_FREQ_FOR_USBHOST: USBHOST and USBTLL are the only clocks
27-
* that are sourced by DPLL5, and both of these require this clock
28-
* to be at 120 MHz for proper operation.
29-
*/
30-
#define DPLL5_FREQ_FOR_USBHOST 120000000
31-
3225
#define OMAP3430ES2_ST_DSS_IDLE_SHIFT 1
3326
#define OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT 5
3427
#define OMAP3430ES2_ST_SSI_IDLE_SHIFT 8
@@ -546,14 +539,21 @@ void __init omap3_clk_lock_dpll5(void)
546539
struct clk *dpll5_clk;
547540
struct clk *dpll5_m2_clk;
548541

542+
/*
543+
* Errata sprz319f advisory 2.1 documents a USB host clock drift issue
544+
* that can be worked around using specially crafted dpll5 settings
545+
* with a dpll5_m2 divider set to 8. Set the dpll5 rate to 8x the USB
546+
* host clock rate, its .set_rate handler() will detect that frequency
547+
* and use the errata settings.
548+
*/
549549
dpll5_clk = clk_get(NULL, "dpll5_ck");
550-
clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
550+
clk_set_rate(dpll5_clk, OMAP3_DPLL5_FREQ_FOR_USBHOST * 8);
551551
clk_prepare_enable(dpll5_clk);
552552

553-
/* Program dpll5_m2_clk divider for no division */
553+
/* Program dpll5_m2_clk divider */
554554
dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck");
555555
clk_prepare_enable(dpll5_m2_clk);
556-
clk_set_rate(dpll5_m2_clk, DPLL5_FREQ_FOR_USBHOST);
556+
clk_set_rate(dpll5_m2_clk, OMAP3_DPLL5_FREQ_FOR_USBHOST);
557557

558558
clk_disable_unprepare(dpll5_m2_clk);
559559
clk_disable_unprepare(dpll5_clk);

drivers/clk/ti/clock.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,20 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
257257
unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,
258258
unsigned long parent_rate);
259259

260+
/*
261+
* OMAP3_DPLL5_FREQ_FOR_USBHOST: USBHOST and USBTLL are the only clocks
262+
* that are sourced by DPLL5, and both of these require this clock
263+
* to be at 120 MHz for proper operation.
264+
*/
265+
#define OMAP3_DPLL5_FREQ_FOR_USBHOST 120000000
266+
260267
unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate);
261268
int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate,
262269
unsigned long parent_rate);
263270
int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
264271
unsigned long parent_rate, u8 index);
272+
int omap3_dpll5_set_rate(struct clk_hw *hw, unsigned long rate,
273+
unsigned long parent_rate);
265274
void omap3_clk_lock_dpll5(void);
266275

267276
unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,

drivers/clk/ti/dpll.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,18 @@ static const struct clk_ops omap3_dpll_ck_ops = {
114114
.round_rate = &omap2_dpll_round_rate,
115115
};
116116

117+
static const struct clk_ops omap3_dpll5_ck_ops = {
118+
.enable = &omap3_noncore_dpll_enable,
119+
.disable = &omap3_noncore_dpll_disable,
120+
.get_parent = &omap2_init_dpll_parent,
121+
.recalc_rate = &omap3_dpll_recalc,
122+
.set_rate = &omap3_dpll5_set_rate,
123+
.set_parent = &omap3_noncore_dpll_set_parent,
124+
.set_rate_and_parent = &omap3_noncore_dpll_set_rate_and_parent,
125+
.determine_rate = &omap3_noncore_dpll_determine_rate,
126+
.round_rate = &omap2_dpll_round_rate,
127+
};
128+
117129
static const struct clk_ops omap3_dpll_per_ck_ops = {
118130
.enable = &omap3_noncore_dpll_enable,
119131
.disable = &omap3_noncore_dpll_disable,
@@ -461,7 +473,12 @@ static void __init of_ti_omap3_dpll_setup(struct device_node *node)
461473
.modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
462474
};
463475

464-
of_ti_dpll_setup(node, &omap3_dpll_ck_ops, &dd);
476+
if ((of_machine_is_compatible("ti,omap3630") ||
477+
of_machine_is_compatible("ti,omap36xx")) &&
478+
!strcmp(node->name, "dpll5_ck"))
479+
of_ti_dpll_setup(node, &omap3_dpll5_ck_ops, &dd);
480+
else
481+
of_ti_dpll_setup(node, &omap3_dpll_ck_ops, &dd);
465482
}
466483
CLK_OF_DECLARE(ti_omap3_dpll_clock, "ti,omap3-dpll-clock",
467484
of_ti_omap3_dpll_setup);

drivers/clk/ti/dpll3xxx.c

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,3 +815,70 @@ int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
815815
return omap3_noncore_dpll_set_rate_and_parent(hw, rate, parent_rate,
816816
index);
817817
}
818+
819+
/* Apply DM3730 errata sprz319 advisory 2.1. */
820+
static bool omap3_dpll5_apply_errata(struct clk_hw *hw,
821+
unsigned long parent_rate)
822+
{
823+
struct omap3_dpll5_settings {
824+
unsigned int rate, m, n;
825+
};
826+
827+
static const struct omap3_dpll5_settings precomputed[] = {
828+
/*
829+
* From DM3730 errata advisory 2.1, table 35 and 36.
830+
* The N value is increased by 1 compared to the tables as the
831+
* errata lists register values while last_rounded_field is the
832+
* real divider value.
833+
*/
834+
{ 12000000, 80, 0 + 1 },
835+
{ 13000000, 443, 5 + 1 },
836+
{ 19200000, 50, 0 + 1 },
837+
{ 26000000, 443, 11 + 1 },
838+
{ 38400000, 25, 0 + 1 }
839+
};
840+
841+
const struct omap3_dpll5_settings *d;
842+
struct clk_hw_omap *clk = to_clk_hw_omap(hw);
843+
struct dpll_data *dd;
844+
unsigned int i;
845+
846+
for (i = 0; i < ARRAY_SIZE(precomputed); ++i) {
847+
if (parent_rate == precomputed[i].rate)
848+
break;
849+
}
850+
851+
if (i == ARRAY_SIZE(precomputed))
852+
return false;
853+
854+
d = &precomputed[i];
855+
856+
/* Update the M, N and rounded rate values and program the DPLL. */
857+
dd = clk->dpll_data;
858+
dd->last_rounded_m = d->m;
859+
dd->last_rounded_n = d->n;
860+
dd->last_rounded_rate = div_u64((u64)parent_rate * d->m, d->n);
861+
omap3_noncore_dpll_program(clk, 0);
862+
863+
return true;
864+
}
865+
866+
/**
867+
* omap3_dpll5_set_rate - set rate for omap3 dpll5
868+
* @hw: clock to change
869+
* @rate: target rate for clock
870+
* @parent_rate: rate of the parent clock
871+
*
872+
* Set rate for the DPLL5 clock. Apply the sprz319 advisory 2.1 on OMAP36xx if
873+
* the DPLL is used for USB host (detected through the requested rate).
874+
*/
875+
int omap3_dpll5_set_rate(struct clk_hw *hw, unsigned long rate,
876+
unsigned long parent_rate)
877+
{
878+
if (rate == OMAP3_DPLL5_FREQ_FOR_USBHOST * 8) {
879+
if (omap3_dpll5_apply_errata(hw, parent_rate))
880+
return 0;
881+
}
882+
883+
return omap3_noncore_dpll_set_rate(hw, rate, parent_rate);
884+
}

0 commit comments

Comments
 (0)