Skip to content

Commit 851ba64

Browse files
committed
Merge 4.9.200 into android-4.9-q
Changes in 4.9.200 regulator: ti-abb: Fix timeout in ti_abb_wait_txdone/ti_abb_clear_all_txdone regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized ASoC: wm_adsp: Don't generate kcontrols without READ flags ASoc: rockchip: i2s: Fix RPM imbalance ARM: dts: logicpd-torpedo-som: Remove twl_keypad pinctrl: ns2: Fix off by one bugs in ns2_pinmux_enable() ARM: mm: fix alignment handler faults under memory pressure scsi: scsi_dh_alua: handle RTPG sense code correctly during state transitions scsi: sni_53c710: fix compilation error scsi: fix kconfig dependency warning related to 53C700_LE_ON_BE ARM: dts: imx7s: Correct GPT's ipg clock source perf kmem: Fix memory leak in compact_gfp_flags() ARM: davinci: dm365: Fix McBSP dma_slave_map entry scsi: target: core: Do not overwrite CDB byte 1 of: unittest: fix memory leak in unittest_data_add MIPS: bmips: mark exception vectors as char arrays cifs: Fix cifsInodeInfo lock_sem deadlock when reconnect occurs dccp: do not leak jiffies on the wire net: fix sk_page_frag() recursion from memory reclaim net: hisilicon: Fix ping latency when deal with high throughput net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() selftests: net: reuseport_dualstack: fix uninitalized parameter net: add READ_ONCE() annotation in __skb_wait_for_more_packets() net: dsa: fix switch tree list net: bcmgenet: reset 40nm EPHY on energy detect vxlan: check tun_info options_len properly net/mlx4_core: Dynamically set guaranteed amount of counters per VF inet: stop leaking jiffies on the wire Kbuild: make designated_init attribute fatal kbuild: use -fmacro-prefix-map to make __FILE__ a relative path kbuild: add -fcf-protection=none when using retpoline flags net/flow_dissector: switch to siphash dmaengine: qcom: bam_dma: Fix resource leak alarmtimer: Change remaining ENOTSUPP to EOPNOTSUPP Linux 4.9.200 Signed-off-by: Greg Kroah-Hartman <[email protected]>
2 parents 9bb0f69 + 574a61d commit 851ba64

Some content is hidden

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

48 files changed

+285
-180
lines changed

Makefile

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 9
3-
SUBLEVEL = 199
3+
SUBLEVEL = 200
44
EXTRAVERSION =
55
NAME = Roaring Lionus
66

@@ -901,6 +901,18 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
901901
# enforce correct pointer usage
902902
KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)
903903

904+
# Require designated initializers for all marked structures
905+
KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
906+
907+
# change __FILE__ to the relative path from the srctree
908+
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
909+
910+
# ensure -fcf-protection is disabled when using retpoline as it is
911+
# incompatible with -mindirect-branch=thunk-extern
912+
ifdef CONFIG_RETPOLINE
913+
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
914+
endif
915+
904916
# use the deterministic mode of AR if available
905917
KBUILD_ARFLAGS := $(call ar-option,D)
906918

arch/arm/boot/dts/imx7s.dtsi

+4-4
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@
437437
compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
438438
reg = <0x302d0000 0x10000>;
439439
interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
440-
clocks = <&clks IMX7D_CLK_DUMMY>,
440+
clocks = <&clks IMX7D_GPT1_ROOT_CLK>,
441441
<&clks IMX7D_GPT1_ROOT_CLK>;
442442
clock-names = "ipg", "per";
443443
};
@@ -446,7 +446,7 @@
446446
compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
447447
reg = <0x302e0000 0x10000>;
448448
interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
449-
clocks = <&clks IMX7D_CLK_DUMMY>,
449+
clocks = <&clks IMX7D_GPT2_ROOT_CLK>,
450450
<&clks IMX7D_GPT2_ROOT_CLK>;
451451
clock-names = "ipg", "per";
452452
status = "disabled";
@@ -456,7 +456,7 @@
456456
compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
457457
reg = <0x302f0000 0x10000>;
458458
interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
459-
clocks = <&clks IMX7D_CLK_DUMMY>,
459+
clocks = <&clks IMX7D_GPT3_ROOT_CLK>,
460460
<&clks IMX7D_GPT3_ROOT_CLK>;
461461
clock-names = "ipg", "per";
462462
status = "disabled";
@@ -466,7 +466,7 @@
466466
compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
467467
reg = <0x30300000 0x10000>;
468468
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
469-
clocks = <&clks IMX7D_CLK_DUMMY>,
469+
clocks = <&clks IMX7D_GPT4_ROOT_CLK>,
470470
<&clks IMX7D_GPT4_ROOT_CLK>;
471471
clock-names = "ipg", "per";
472472
status = "disabled";

arch/arm/boot/dts/logicpd-torpedo-som.dtsi

+4
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,7 @@
266266
&twl_gpio {
267267
ti,use-leds;
268268
};
269+
270+
&twl_keypad {
271+
status = "disabled";
272+
};

arch/arm/mach-davinci/dm365.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -864,8 +864,8 @@ static s8 dm365_queue_priority_mapping[][2] = {
864864
};
865865

866866
static const struct dma_slave_map dm365_edma_map[] = {
867-
{ "davinci-mcbsp.0", "tx", EDMA_FILTER_PARAM(0, 2) },
868-
{ "davinci-mcbsp.0", "rx", EDMA_FILTER_PARAM(0, 3) },
867+
{ "davinci-mcbsp", "tx", EDMA_FILTER_PARAM(0, 2) },
868+
{ "davinci-mcbsp", "rx", EDMA_FILTER_PARAM(0, 3) },
869869
{ "davinci_voicecodec", "tx", EDMA_FILTER_PARAM(0, 2) },
870870
{ "davinci_voicecodec", "rx", EDMA_FILTER_PARAM(0, 3) },
871871
{ "spi_davinci.2", "tx", EDMA_FILTER_PARAM(0, 10) },

arch/arm/mm/alignment.c

+36-8
Original file line numberDiff line numberDiff line change
@@ -767,17 +767,47 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs,
767767
return NULL;
768768
}
769769

770+
static int alignment_get_arm(struct pt_regs *regs, u32 *ip, unsigned long *inst)
771+
{
772+
u32 instr = 0;
773+
int fault;
774+
775+
if (user_mode(regs))
776+
fault = get_user(instr, ip);
777+
else
778+
fault = probe_kernel_address(ip, instr);
779+
780+
*inst = __mem_to_opcode_arm(instr);
781+
782+
return fault;
783+
}
784+
785+
static int alignment_get_thumb(struct pt_regs *regs, u16 *ip, u16 *inst)
786+
{
787+
u16 instr = 0;
788+
int fault;
789+
790+
if (user_mode(regs))
791+
fault = get_user(instr, ip);
792+
else
793+
fault = probe_kernel_address(ip, instr);
794+
795+
*inst = __mem_to_opcode_thumb16(instr);
796+
797+
return fault;
798+
}
799+
770800
static int
771801
do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
772802
{
773803
union offset_union uninitialized_var(offset);
774804
unsigned long instr = 0, instrptr;
775805
int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs);
776806
unsigned int type;
777-
unsigned int fault;
778807
u16 tinstr = 0;
779808
int isize = 4;
780809
int thumb2_32b = 0;
810+
int fault;
781811

782812
if (interrupts_enabled(regs))
783813
local_irq_enable();
@@ -786,15 +816,14 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
786816

787817
if (thumb_mode(regs)) {
788818
u16 *ptr = (u16 *)(instrptr & ~1);
789-
fault = probe_kernel_address(ptr, tinstr);
790-
tinstr = __mem_to_opcode_thumb16(tinstr);
819+
820+
fault = alignment_get_thumb(regs, ptr, &tinstr);
791821
if (!fault) {
792822
if (cpu_architecture() >= CPU_ARCH_ARMv7 &&
793823
IS_T32(tinstr)) {
794824
/* Thumb-2 32-bit */
795-
u16 tinst2 = 0;
796-
fault = probe_kernel_address(ptr + 1, tinst2);
797-
tinst2 = __mem_to_opcode_thumb16(tinst2);
825+
u16 tinst2;
826+
fault = alignment_get_thumb(regs, ptr + 1, &tinst2);
798827
instr = __opcode_thumb32_compose(tinstr, tinst2);
799828
thumb2_32b = 1;
800829
} else {
@@ -803,8 +832,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
803832
}
804833
}
805834
} else {
806-
fault = probe_kernel_address((void *)instrptr, instr);
807-
instr = __mem_to_opcode_arm(instr);
835+
fault = alignment_get_arm(regs, (void *)instrptr, &instr);
808836
}
809837

810838
if (fault) {

arch/mips/bcm63xx/prom.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void __init prom_init(void)
8484
* Here we will start up CPU1 in the background and ask it to
8585
* reconfigure itself then go back to sleep.
8686
*/
87-
memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20);
87+
memcpy((void *)0xa0000200, bmips_smp_movevec, 0x20);
8888
__sync();
8989
set_c0_cause(C_SW0);
9090
cpumask_set_cpu(1, &bmips_booted_mask);

arch/mips/include/asm/bmips.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ static inline int register_bmips_smp_ops(void)
7575
#endif
7676
}
7777

78-
extern char bmips_reset_nmi_vec;
79-
extern char bmips_reset_nmi_vec_end;
80-
extern char bmips_smp_movevec;
81-
extern char bmips_smp_int_vec;
82-
extern char bmips_smp_int_vec_end;
78+
extern char bmips_reset_nmi_vec[];
79+
extern char bmips_reset_nmi_vec_end[];
80+
extern char bmips_smp_movevec[];
81+
extern char bmips_smp_int_vec[];
82+
extern char bmips_smp_int_vec_end[];
8383

8484
extern int bmips_smp_enabled;
8585
extern int bmips_cpu_offset;

arch/mips/kernel/smp-bmips.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,10 @@ static void bmips_wr_vec(unsigned long dst, char *start, char *end)
453453

454454
static inline void bmips_nmi_handler_setup(void)
455455
{
456-
bmips_wr_vec(BMIPS_NMI_RESET_VEC, &bmips_reset_nmi_vec,
457-
&bmips_reset_nmi_vec_end);
458-
bmips_wr_vec(BMIPS_WARM_RESTART_VEC, &bmips_smp_int_vec,
459-
&bmips_smp_int_vec_end);
456+
bmips_wr_vec(BMIPS_NMI_RESET_VEC, bmips_reset_nmi_vec,
457+
bmips_reset_nmi_vec_end);
458+
bmips_wr_vec(BMIPS_WARM_RESTART_VEC, bmips_smp_int_vec,
459+
bmips_smp_int_vec_end);
460460
}
461461

462462
struct reset_vec_info {

drivers/dma/qcom/bam_dma.c

+14
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,21 @@ static int bam_dma_terminate_all(struct dma_chan *chan)
686686

687687
/* remove all transactions, including active transaction */
688688
spin_lock_irqsave(&bchan->vc.lock, flag);
689+
/*
690+
* If we have transactions queued, then some might be committed to the
691+
* hardware in the desc fifo. The only way to reset the desc fifo is
692+
* to do a hardware reset (either by pipe or the entire block).
693+
* bam_chan_init_hw() will trigger a pipe reset, and also reinit the
694+
* pipe. If the pipe is left disabled (default state after pipe reset)
695+
* and is accessed by a connected hardware engine, a fatal error in
696+
* the BAM will occur. There is a small window where this could happen
697+
* with bam_chan_init_hw(), but it is assumed that the caller has
698+
* stopped activity on any attached hardware engine. Make sure to do
699+
* this first so that the BAM hardware doesn't cause memory corruption
700+
* by accessing freed resources.
701+
*/
689702
if (bchan->curr_txd) {
703+
bam_chan_init_hw(bchan, bchan->curr_txd->dir);
690704
list_add(&bchan->curr_txd->vd.node, &bchan->vc.desc_issued);
691705
bchan->curr_txd = NULL;
692706
}

drivers/net/ethernet/broadcom/genet/bcmgenet.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -1914,6 +1914,8 @@ static void bcmgenet_link_intr_enable(struct bcmgenet_priv *priv)
19141914
*/
19151915
if (priv->internal_phy) {
19161916
int0_enable |= UMAC_IRQ_LINK_EVENT;
1917+
if (GENET_IS_V1(priv) || GENET_IS_V2(priv) || GENET_IS_V3(priv))
1918+
int0_enable |= UMAC_IRQ_PHY_DET_R;
19171919
} else if (priv->ext_phy) {
19181920
int0_enable |= UMAC_IRQ_LINK_EVENT;
19191921
} else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {
@@ -2531,6 +2533,10 @@ static void bcmgenet_irq_task(struct work_struct *work)
25312533
bcmgenet_power_up(priv, GENET_POWER_WOL_MAGIC);
25322534
}
25332535

2536+
if (status & UMAC_IRQ_PHY_DET_R &&
2537+
priv->dev->phydev->autoneg != AUTONEG_ENABLE)
2538+
phy_init_hw(priv->dev->phydev);
2539+
25342540
/* Link UP/DOWN event */
25352541
if (status & UMAC_IRQ_LINK_EVENT)
25362542
phy_mac_interrupt(priv->phydev,
@@ -2627,8 +2633,7 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id)
26272633
}
26282634

26292635
/* all other interested interrupts handled in bottom half */
2630-
status &= (UMAC_IRQ_LINK_EVENT |
2631-
UMAC_IRQ_MPD_R);
2636+
status &= (UMAC_IRQ_LINK_EVENT | UMAC_IRQ_MPD_R | UMAC_IRQ_PHY_DET_R);
26322637
if (status) {
26332638
/* Save irq status for bottom-half processing. */
26342639
spin_lock_irqsave(&priv->lock, flags);

drivers/net/ethernet/hisilicon/hip04_eth.c

+9-6
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ struct hip04_priv {
174174
dma_addr_t rx_phys[RX_DESC_NUM];
175175
unsigned int rx_head;
176176
unsigned int rx_buf_size;
177+
unsigned int rx_cnt_remaining;
177178

178179
struct device_node *phy_node;
179180
struct phy_device *phy;
@@ -487,7 +488,6 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)
487488
struct hip04_priv *priv = container_of(napi, struct hip04_priv, napi);
488489
struct net_device *ndev = priv->ndev;
489490
struct net_device_stats *stats = &ndev->stats;
490-
unsigned int cnt = hip04_recv_cnt(priv);
491491
struct rx_desc *desc;
492492
struct sk_buff *skb;
493493
unsigned char *buf;
@@ -500,8 +500,8 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)
500500

501501
/* clean up tx descriptors */
502502
tx_remaining = hip04_tx_reclaim(ndev, false);
503-
504-
while (cnt && !last) {
503+
priv->rx_cnt_remaining += hip04_recv_cnt(priv);
504+
while (priv->rx_cnt_remaining && !last) {
505505
buf = priv->rx_buf[priv->rx_head];
506506
skb = build_skb(buf, priv->rx_buf_size);
507507
if (unlikely(!skb)) {
@@ -547,11 +547,13 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)
547547
hip04_set_recv_desc(priv, phys);
548548

549549
priv->rx_head = RX_NEXT(priv->rx_head);
550-
if (rx >= budget)
550+
if (rx >= budget) {
551+
--priv->rx_cnt_remaining;
551552
goto done;
553+
}
552554

553-
if (--cnt == 0)
554-
cnt = hip04_recv_cnt(priv);
555+
if (--priv->rx_cnt_remaining == 0)
556+
priv->rx_cnt_remaining += hip04_recv_cnt(priv);
555557
}
556558

557559
if (!(priv->reg_inten & RCV_INT)) {
@@ -636,6 +638,7 @@ static int hip04_mac_open(struct net_device *ndev)
636638
int i;
637639

638640
priv->rx_head = 0;
641+
priv->rx_cnt_remaining = 0;
639642
priv->tx_head = 0;
640643
priv->tx_tail = 0;
641644
hip04_reset_ppe(priv);

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

+26-16
Original file line numberDiff line numberDiff line change
@@ -470,20 +470,38 @@ void mlx4_init_quotas(struct mlx4_dev *dev)
470470
priv->mfunc.master.res_tracker.res_alloc[RES_MPT].quota[pf];
471471
}
472472

473-
static int get_max_gauranteed_vfs_counter(struct mlx4_dev *dev)
473+
static int
474+
mlx4_calc_res_counter_guaranteed(struct mlx4_dev *dev,
475+
struct resource_allocator *res_alloc,
476+
int vf)
474477
{
475-
/* reduce the sink counter */
476-
return (dev->caps.max_counters - 1 -
477-
(MLX4_PF_COUNTERS_PER_PORT * MLX4_MAX_PORTS))
478-
/ MLX4_MAX_PORTS;
478+
struct mlx4_active_ports actv_ports;
479+
int ports, counters_guaranteed;
480+
481+
/* For master, only allocate according to the number of phys ports */
482+
if (vf == mlx4_master_func_num(dev))
483+
return MLX4_PF_COUNTERS_PER_PORT * dev->caps.num_ports;
484+
485+
/* calculate real number of ports for the VF */
486+
actv_ports = mlx4_get_active_ports(dev, vf);
487+
ports = bitmap_weight(actv_ports.ports, dev->caps.num_ports);
488+
counters_guaranteed = ports * MLX4_VF_COUNTERS_PER_PORT;
489+
490+
/* If we do not have enough counters for this VF, do not
491+
* allocate any for it. '-1' to reduce the sink counter.
492+
*/
493+
if ((res_alloc->res_reserved + counters_guaranteed) >
494+
(dev->caps.max_counters - 1))
495+
return 0;
496+
497+
return counters_guaranteed;
479498
}
480499

481500
int mlx4_init_resource_tracker(struct mlx4_dev *dev)
482501
{
483502
struct mlx4_priv *priv = mlx4_priv(dev);
484503
int i, j;
485504
int t;
486-
int max_vfs_guarantee_counter = get_max_gauranteed_vfs_counter(dev);
487505

488506
priv->mfunc.master.res_tracker.slave_list =
489507
kzalloc(dev->num_slaves * sizeof(struct slave_list),
@@ -600,16 +618,8 @@ int mlx4_init_resource_tracker(struct mlx4_dev *dev)
600618
break;
601619
case RES_COUNTER:
602620
res_alloc->quota[t] = dev->caps.max_counters;
603-
if (t == mlx4_master_func_num(dev))
604-
res_alloc->guaranteed[t] =
605-
MLX4_PF_COUNTERS_PER_PORT *
606-
MLX4_MAX_PORTS;
607-
else if (t <= max_vfs_guarantee_counter)
608-
res_alloc->guaranteed[t] =
609-
MLX4_VF_COUNTERS_PER_PORT *
610-
MLX4_MAX_PORTS;
611-
else
612-
res_alloc->guaranteed[t] = 0;
621+
res_alloc->guaranteed[t] =
622+
mlx4_calc_res_counter_guaranteed(dev, res_alloc, t);
613623
res_alloc->res_free -= res_alloc->guaranteed[t];
614624
break;
615625
default:

drivers/net/vxlan.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -2049,8 +2049,11 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
20492049
label = info->key.label;
20502050
udp_sum = !!(info->key.tun_flags & TUNNEL_CSUM);
20512051

2052-
if (info->options_len)
2052+
if (info->options_len) {
2053+
if (info->options_len < sizeof(*md))
2054+
goto drop;
20532055
md = ip_tunnel_info_opts(info);
2056+
}
20542057
} else {
20552058
md->gbp = skb->mark;
20562059
}

drivers/of/unittest.c

+1
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,7 @@ static int __init unittest_data_add(void)
933933
of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node);
934934
if (!unittest_data_node) {
935935
pr_warn("%s: No tree to attach; not running tests\n", __func__);
936+
kfree(unittest_data);
936937
return -ENODATA;
937938
}
938939
of_node_set_flag(unittest_data_node, OF_DETACHED);

0 commit comments

Comments
 (0)