aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bluetooth/hci_ldisc.c2
-rw-r--r--drivers/clk/x86/clk-pmc-atom.c18
-rw-r--r--drivers/net/appletalk/ipddp.c8
-rw-r--r--drivers/net/dsa/mv88e6xxx/global1.h2
-rw-r--r--drivers/net/dsa/mv88e6xxx/global1_atu.c2
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.c9
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c9
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h2
-rw-r--r--drivers/net/ethernet/cadence/macb_main.c8
-rw-r--r--drivers/net/ethernet/hp/hp100.c2
-rw-r--r--drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c21
-rw-r--r--drivers/net/ethernet/microchip/lan743x_main.c6
-rw-r--r--drivers/net/ethernet/realtek/r8169.c40
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c5
-rw-r--r--drivers/net/ethernet/ti/Kconfig1
-rw-r--r--drivers/net/hyperv/netvsc.c3
-rw-r--r--drivers/net/hyperv/netvsc_drv.c67
-rw-r--r--drivers/net/ppp/pppoe.c3
-rw-r--r--drivers/net/usb/qmi_wwan.c14
-rw-r--r--drivers/net/veth.c4
-rw-r--r--drivers/net/xen-netfront.c8
-rw-r--r--drivers/pci/controller/pci-hyperv.c37
-rw-r--r--drivers/platform/x86/alienware-wmi.c1
-rw-r--r--drivers/platform/x86/dell-smbios-wmi.c1
-rw-r--r--drivers/spi/spi-fsl-dspi.c6
-rw-r--r--drivers/spi/spi.c13
26 files changed, 208 insertions, 84 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 963bb0309e25..ea6238ed5c0e 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -543,6 +543,8 @@ static void hci_uart_tty_close(struct tty_struct *tty)
543 } 543 }
544 clear_bit(HCI_UART_PROTO_SET, &hu->flags); 544 clear_bit(HCI_UART_PROTO_SET, &hu->flags);
545 545
546 percpu_free_rwsem(&hu->proto_lock);
547
546 kfree(hu); 548 kfree(hu);
547} 549}
548 550
diff --git a/drivers/clk/x86/clk-pmc-atom.c b/drivers/clk/x86/clk-pmc-atom.c
index 08ef69945ffb..d977193842df 100644
--- a/drivers/clk/x86/clk-pmc-atom.c
+++ b/drivers/clk/x86/clk-pmc-atom.c
@@ -55,6 +55,7 @@ struct clk_plt_data {
55 u8 nparents; 55 u8 nparents;
56 struct clk_plt *clks[PMC_CLK_NUM]; 56 struct clk_plt *clks[PMC_CLK_NUM];
57 struct clk_lookup *mclk_lookup; 57 struct clk_lookup *mclk_lookup;
58 struct clk_lookup *ether_clk_lookup;
58}; 59};
59 60
60/* Return an index in parent table */ 61/* Return an index in parent table */
@@ -186,13 +187,6 @@ static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id,
186 pclk->reg = base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE; 187 pclk->reg = base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE;
187 spin_lock_init(&pclk->lock); 188 spin_lock_init(&pclk->lock);
188 189
189 /*
190 * If the clock was already enabled by the firmware mark it as critical
191 * to avoid it being gated by the clock framework if no driver owns it.
192 */
193 if (plt_clk_is_enabled(&pclk->hw))
194 init.flags |= CLK_IS_CRITICAL;
195
196 ret = devm_clk_hw_register(&pdev->dev, &pclk->hw); 190 ret = devm_clk_hw_register(&pdev->dev, &pclk->hw);
197 if (ret) { 191 if (ret) {
198 pclk = ERR_PTR(ret); 192 pclk = ERR_PTR(ret);
@@ -351,11 +345,20 @@ static int plt_clk_probe(struct platform_device *pdev)
351 goto err_unreg_clk_plt; 345 goto err_unreg_clk_plt;
352 } 346 }
353 347
348 data->ether_clk_lookup = clkdev_hw_create(&data->clks[4]->hw,
349 "ether_clk", NULL);
350 if (!data->ether_clk_lookup) {
351 err = -ENOMEM;
352 goto err_drop_mclk;
353 }
354
354 plt_clk_free_parent_names_loop(parent_names, data->nparents); 355 plt_clk_free_parent_names_loop(parent_names, data->nparents);
355 356
356 platform_set_drvdata(pdev, data); 357 platform_set_drvdata(pdev, data);
357 return 0; 358 return 0;
358 359
360err_drop_mclk:
361 clkdev_drop(data->mclk_lookup);
359err_unreg_clk_plt: 362err_unreg_clk_plt:
360 plt_clk_unregister_loop(data, i); 363 plt_clk_unregister_loop(data, i);
361 plt_clk_unregister_parents(data); 364 plt_clk_unregister_parents(data);
@@ -369,6 +372,7 @@ static int plt_clk_remove(struct platform_device *pdev)
369 372
370 data = platform_get_drvdata(pdev); 373 data = platform_get_drvdata(pdev);
371 374
375 clkdev_drop(data->ether_clk_lookup);
372 clkdev_drop(data->mclk_lookup); 376 clkdev_drop(data->mclk_lookup);
373 plt_clk_unregister_loop(data, PMC_CLK_NUM); 377 plt_clk_unregister_loop(data, PMC_CLK_NUM);
374 plt_clk_unregister_parents(data); 378 plt_clk_unregister_parents(data);
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c
index 9375cef22420..3d27616d9c85 100644
--- a/drivers/net/appletalk/ipddp.c
+++ b/drivers/net/appletalk/ipddp.c
@@ -283,8 +283,12 @@ static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
283 case SIOCFINDIPDDPRT: 283 case SIOCFINDIPDDPRT:
284 spin_lock_bh(&ipddp_route_lock); 284 spin_lock_bh(&ipddp_route_lock);
285 rp = __ipddp_find_route(&rcp); 285 rp = __ipddp_find_route(&rcp);
286 if (rp) 286 if (rp) {
287 memcpy(&rcp2, rp, sizeof(rcp2)); 287 memset(&rcp2, 0, sizeof(rcp2));
288 rcp2.ip = rp->ip;
289 rcp2.at = rp->at;
290 rcp2.flags = rp->flags;
291 }
288 spin_unlock_bh(&ipddp_route_lock); 292 spin_unlock_bh(&ipddp_route_lock);
289 293
290 if (rp) { 294 if (rp) {
diff --git a/drivers/net/dsa/mv88e6xxx/global1.h b/drivers/net/dsa/mv88e6xxx/global1.h
index 7c791c1da4b9..bef01331266f 100644
--- a/drivers/net/dsa/mv88e6xxx/global1.h
+++ b/drivers/net/dsa/mv88e6xxx/global1.h
@@ -128,7 +128,7 @@
128#define MV88E6XXX_G1_ATU_OP_GET_CLR_VIOLATION 0x7000 128#define MV88E6XXX_G1_ATU_OP_GET_CLR_VIOLATION 0x7000
129#define MV88E6XXX_G1_ATU_OP_AGE_OUT_VIOLATION BIT(7) 129#define MV88E6XXX_G1_ATU_OP_AGE_OUT_VIOLATION BIT(7)
130#define MV88E6XXX_G1_ATU_OP_MEMBER_VIOLATION BIT(6) 130#define MV88E6XXX_G1_ATU_OP_MEMBER_VIOLATION BIT(6)
131#define MV88E6XXX_G1_ATU_OP_MISS_VIOLTATION BIT(5) 131#define MV88E6XXX_G1_ATU_OP_MISS_VIOLATION BIT(5)
132#define MV88E6XXX_G1_ATU_OP_FULL_VIOLATION BIT(4) 132#define MV88E6XXX_G1_ATU_OP_FULL_VIOLATION BIT(4)
133 133
134/* Offset 0x0C: ATU Data Register */ 134/* Offset 0x0C: ATU Data Register */
diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c b/drivers/net/dsa/mv88e6xxx/global1_atu.c
index 307410898fc9..5200e4bdce93 100644
--- a/drivers/net/dsa/mv88e6xxx/global1_atu.c
+++ b/drivers/net/dsa/mv88e6xxx/global1_atu.c
@@ -349,7 +349,7 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id)
349 chip->ports[entry.portvec].atu_member_violation++; 349 chip->ports[entry.portvec].atu_member_violation++;
350 } 350 }
351 351
352 if (val & MV88E6XXX_G1_ATU_OP_MEMBER_VIOLATION) { 352 if (val & MV88E6XXX_G1_ATU_OP_MISS_VIOLATION) {
353 dev_err_ratelimited(chip->dev, 353 dev_err_ratelimited(chip->dev,
354 "ATU miss violation for %pM portvec %x\n", 354 "ATU miss violation for %pM portvec %x\n",
355 entry.mac, entry.portvec); 355 entry.mac, entry.portvec);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index cecbb1d1f587..177587f9c3f1 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -8027,7 +8027,7 @@ static int bnxt_change_mac_addr(struct net_device *dev, void *p)
8027 if (ether_addr_equal(addr->sa_data, dev->dev_addr)) 8027 if (ether_addr_equal(addr->sa_data, dev->dev_addr))
8028 return 0; 8028 return 0;
8029 8029
8030 rc = bnxt_approve_mac(bp, addr->sa_data); 8030 rc = bnxt_approve_mac(bp, addr->sa_data, true);
8031 if (rc) 8031 if (rc)
8032 return rc; 8032 return rc;
8033 8033
@@ -8827,14 +8827,19 @@ static int bnxt_init_mac_addr(struct bnxt *bp)
8827 } else { 8827 } else {
8828#ifdef CONFIG_BNXT_SRIOV 8828#ifdef CONFIG_BNXT_SRIOV
8829 struct bnxt_vf_info *vf = &bp->vf; 8829 struct bnxt_vf_info *vf = &bp->vf;
8830 bool strict_approval = true;
8830 8831
8831 if (is_valid_ether_addr(vf->mac_addr)) { 8832 if (is_valid_ether_addr(vf->mac_addr)) {
8832 /* overwrite netdev dev_addr with admin VF MAC */ 8833 /* overwrite netdev dev_addr with admin VF MAC */
8833 memcpy(bp->dev->dev_addr, vf->mac_addr, ETH_ALEN); 8834 memcpy(bp->dev->dev_addr, vf->mac_addr, ETH_ALEN);
8835 /* Older PF driver or firmware may not approve this
8836 * correctly.
8837 */
8838 strict_approval = false;
8834 } else { 8839 } else {
8835 eth_hw_addr_random(bp->dev); 8840 eth_hw_addr_random(bp->dev);
8836 } 8841 }
8837 rc = bnxt_approve_mac(bp, bp->dev->dev_addr); 8842 rc = bnxt_approve_mac(bp, bp->dev->dev_addr, strict_approval);
8838#endif 8843#endif
8839 } 8844 }
8840 return rc; 8845 return rc;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index fcd085a9853a..3962f6fd543c 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -1104,7 +1104,7 @@ update_vf_mac_exit:
1104 mutex_unlock(&bp->hwrm_cmd_lock); 1104 mutex_unlock(&bp->hwrm_cmd_lock);
1105} 1105}
1106 1106
1107int bnxt_approve_mac(struct bnxt *bp, u8 *mac) 1107int bnxt_approve_mac(struct bnxt *bp, u8 *mac, bool strict)
1108{ 1108{
1109 struct hwrm_func_vf_cfg_input req = {0}; 1109 struct hwrm_func_vf_cfg_input req = {0};
1110 int rc = 0; 1110 int rc = 0;
@@ -1122,12 +1122,13 @@ int bnxt_approve_mac(struct bnxt *bp, u8 *mac)
1122 memcpy(req.dflt_mac_addr, mac, ETH_ALEN); 1122 memcpy(req.dflt_mac_addr, mac, ETH_ALEN);
1123 rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); 1123 rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
1124mac_done: 1124mac_done:
1125 if (rc) { 1125 if (rc && strict) {
1126 rc = -EADDRNOTAVAIL; 1126 rc = -EADDRNOTAVAIL;
1127 netdev_warn(bp->dev, "VF MAC address %pM not approved by the PF\n", 1127 netdev_warn(bp->dev, "VF MAC address %pM not approved by the PF\n",
1128 mac); 1128 mac);
1129 return rc;
1129 } 1130 }
1130 return rc; 1131 return 0;
1131} 1132}
1132#else 1133#else
1133 1134
@@ -1144,7 +1145,7 @@ void bnxt_update_vf_mac(struct bnxt *bp)
1144{ 1145{
1145} 1146}
1146 1147
1147int bnxt_approve_mac(struct bnxt *bp, u8 *mac) 1148int bnxt_approve_mac(struct bnxt *bp, u8 *mac, bool strict)
1148{ 1149{
1149 return 0; 1150 return 0;
1150} 1151}
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h
index e9b20cd19881..2eed9eda1195 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h
@@ -39,5 +39,5 @@ int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs);
39void bnxt_sriov_disable(struct bnxt *); 39void bnxt_sriov_disable(struct bnxt *);
40void bnxt_hwrm_exec_fwd_req(struct bnxt *); 40void bnxt_hwrm_exec_fwd_req(struct bnxt *);
41void bnxt_update_vf_mac(struct bnxt *); 41void bnxt_update_vf_mac(struct bnxt *);
42int bnxt_approve_mac(struct bnxt *, u8 *); 42int bnxt_approve_mac(struct bnxt *, u8 *, bool);
43#endif 43#endif
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 16e4ef7d7185..f1a86b422617 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -3837,6 +3837,13 @@ static const struct macb_config at91sam9260_config = {
3837 .init = macb_init, 3837 .init = macb_init,
3838}; 3838};
3839 3839
3840static const struct macb_config sama5d3macb_config = {
3841 .caps = MACB_CAPS_SG_DISABLED
3842 | MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
3843 .clk_init = macb_clk_init,
3844 .init = macb_init,
3845};
3846
3840static const struct macb_config pc302gem_config = { 3847static const struct macb_config pc302gem_config = {
3841 .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE, 3848 .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE,
3842 .dma_burst_length = 16, 3849 .dma_burst_length = 16,
@@ -3904,6 +3911,7 @@ static const struct of_device_id macb_dt_ids[] = {
3904 { .compatible = "cdns,gem", .data = &pc302gem_config }, 3911 { .compatible = "cdns,gem", .data = &pc302gem_config },
3905 { .compatible = "atmel,sama5d2-gem", .data = &sama5d2_config }, 3912 { .compatible = "atmel,sama5d2-gem", .data = &sama5d2_config },
3906 { .compatible = "atmel,sama5d3-gem", .data = &sama5d3_config }, 3913 { .compatible = "atmel,sama5d3-gem", .data = &sama5d3_config },
3914 { .compatible = "atmel,sama5d3-macb", .data = &sama5d3macb_config },
3907 { .compatible = "atmel,sama5d4-gem", .data = &sama5d4_config }, 3915 { .compatible = "atmel,sama5d4-gem", .data = &sama5d4_config },
3908 { .compatible = "cdns,at91rm9200-emac", .data = &emac_config }, 3916 { .compatible = "cdns,at91rm9200-emac", .data = &emac_config },
3909 { .compatible = "cdns,emac", .data = &emac_config }, 3917 { .compatible = "cdns,emac", .data = &emac_config },
diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c
index c8c7ad2eff77..9b5a68b65432 100644
--- a/drivers/net/ethernet/hp/hp100.c
+++ b/drivers/net/ethernet/hp/hp100.c
@@ -2634,7 +2634,7 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin)
2634 /* Wait for link to drop */ 2634 /* Wait for link to drop */
2635 time = jiffies + (HZ / 10); 2635 time = jiffies + (HZ / 10);
2636 do { 2636 do {
2637 if (~(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST)) 2637 if (!(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST))
2638 break; 2638 break;
2639 if (!in_interrupt()) 2639 if (!in_interrupt())
2640 schedule_timeout_interruptible(1); 2640 schedule_timeout_interruptible(1);
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 28500417843e..702fec82d806 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -58,6 +58,8 @@ static struct {
58 */ 58 */
59static void mvpp2_mac_config(struct net_device *dev, unsigned int mode, 59static void mvpp2_mac_config(struct net_device *dev, unsigned int mode,
60 const struct phylink_link_state *state); 60 const struct phylink_link_state *state);
61static void mvpp2_mac_link_up(struct net_device *dev, unsigned int mode,
62 phy_interface_t interface, struct phy_device *phy);
61 63
62/* Queue modes */ 64/* Queue modes */
63#define MVPP2_QDIST_SINGLE_MODE 0 65#define MVPP2_QDIST_SINGLE_MODE 0
@@ -3142,6 +3144,7 @@ static void mvpp2_start_dev(struct mvpp2_port *port)
3142 mvpp22_mode_reconfigure(port); 3144 mvpp22_mode_reconfigure(port);
3143 3145
3144 if (port->phylink) { 3146 if (port->phylink) {
3147 netif_carrier_off(port->dev);
3145 phylink_start(port->phylink); 3148 phylink_start(port->phylink);
3146 } else { 3149 } else {
3147 /* Phylink isn't used as of now for ACPI, so the MAC has to be 3150 /* Phylink isn't used as of now for ACPI, so the MAC has to be
@@ -3150,9 +3153,10 @@ static void mvpp2_start_dev(struct mvpp2_port *port)
3150 */ 3153 */
3151 struct phylink_link_state state = { 3154 struct phylink_link_state state = {
3152 .interface = port->phy_interface, 3155 .interface = port->phy_interface,
3153 .link = 1,
3154 }; 3156 };
3155 mvpp2_mac_config(port->dev, MLO_AN_INBAND, &state); 3157 mvpp2_mac_config(port->dev, MLO_AN_INBAND, &state);
3158 mvpp2_mac_link_up(port->dev, MLO_AN_INBAND, port->phy_interface,
3159 NULL);
3156 } 3160 }
3157 3161
3158 netif_tx_start_all_queues(port->dev); 3162 netif_tx_start_all_queues(port->dev);
@@ -4495,10 +4499,6 @@ static void mvpp2_mac_config(struct net_device *dev, unsigned int mode,
4495 return; 4499 return;
4496 } 4500 }
4497 4501
4498 netif_tx_stop_all_queues(port->dev);
4499 if (!port->has_phy)
4500 netif_carrier_off(port->dev);
4501
4502 /* Make sure the port is disabled when reconfiguring the mode */ 4502 /* Make sure the port is disabled when reconfiguring the mode */
4503 mvpp2_port_disable(port); 4503 mvpp2_port_disable(port);
4504 4504
@@ -4523,16 +4523,7 @@ static void mvpp2_mac_config(struct net_device *dev, unsigned int mode,
4523 if (port->priv->hw_version == MVPP21 && port->flags & MVPP2_F_LOOPBACK) 4523 if (port->priv->hw_version == MVPP21 && port->flags & MVPP2_F_LOOPBACK)
4524 mvpp2_port_loopback_set(port, state); 4524 mvpp2_port_loopback_set(port, state);
4525 4525
4526 /* If the port already was up, make sure it's still in the same state */ 4526 mvpp2_port_enable(port);
4527 if (state->link || !port->has_phy) {
4528 mvpp2_port_enable(port);
4529
4530 mvpp2_egress_enable(port);
4531 mvpp2_ingress_enable(port);
4532 if (!port->has_phy)
4533 netif_carrier_on(dev);
4534 netif_tx_wake_all_queues(dev);
4535 }
4536} 4527}
4537 4528
4538static void mvpp2_mac_link_up(struct net_device *dev, unsigned int mode, 4529static void mvpp2_mac_link_up(struct net_device *dev, unsigned int mode,
diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index e7dce79ff2c9..001b5f714c1b 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -2850,7 +2850,7 @@ static void lan743x_pcidev_shutdown(struct pci_dev *pdev)
2850 lan743x_hardware_cleanup(adapter); 2850 lan743x_hardware_cleanup(adapter);
2851} 2851}
2852 2852
2853#ifdef CONFIG_PM 2853#ifdef CONFIG_PM_SLEEP
2854static u16 lan743x_pm_wakeframe_crc16(const u8 *buf, int len) 2854static u16 lan743x_pm_wakeframe_crc16(const u8 *buf, int len)
2855{ 2855{
2856 return bitrev16(crc16(0xFFFF, buf, len)); 2856 return bitrev16(crc16(0xFFFF, buf, len));
@@ -3016,7 +3016,7 @@ static int lan743x_pm_resume(struct device *dev)
3016static const struct dev_pm_ops lan743x_pm_ops = { 3016static const struct dev_pm_ops lan743x_pm_ops = {
3017 SET_SYSTEM_SLEEP_PM_OPS(lan743x_pm_suspend, lan743x_pm_resume) 3017 SET_SYSTEM_SLEEP_PM_OPS(lan743x_pm_suspend, lan743x_pm_resume)
3018}; 3018};
3019#endif /*CONFIG_PM */ 3019#endif /* CONFIG_PM_SLEEP */
3020 3020
3021static const struct pci_device_id lan743x_pcidev_tbl[] = { 3021static const struct pci_device_id lan743x_pcidev_tbl[] = {
3022 { PCI_DEVICE(PCI_VENDOR_ID_SMSC, PCI_DEVICE_ID_SMSC_LAN7430) }, 3022 { PCI_DEVICE(PCI_VENDOR_ID_SMSC, PCI_DEVICE_ID_SMSC_LAN7430) },
@@ -3028,7 +3028,7 @@ static struct pci_driver lan743x_pcidev_driver = {
3028 .id_table = lan743x_pcidev_tbl, 3028 .id_table = lan743x_pcidev_tbl,
3029 .probe = lan743x_pcidev_probe, 3029 .probe = lan743x_pcidev_probe,
3030 .remove = lan743x_pcidev_remove, 3030 .remove = lan743x_pcidev_remove,
3031#ifdef CONFIG_PM 3031#ifdef CONFIG_PM_SLEEP
3032 .driver.pm = &lan743x_pm_ops, 3032 .driver.pm = &lan743x_pm_ops,
3033#endif 3033#endif
3034 .shutdown = lan743x_pcidev_shutdown, 3034 .shutdown = lan743x_pcidev_shutdown,
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 1d8631303b53..bb529ff2ca81 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -13,6 +13,7 @@
13#include <linux/pci.h> 13#include <linux/pci.h>
14#include <linux/netdevice.h> 14#include <linux/netdevice.h>
15#include <linux/etherdevice.h> 15#include <linux/etherdevice.h>
16#include <linux/clk.h>
16#include <linux/delay.h> 17#include <linux/delay.h>
17#include <linux/ethtool.h> 18#include <linux/ethtool.h>
18#include <linux/phy.h> 19#include <linux/phy.h>
@@ -665,6 +666,7 @@ struct rtl8169_private {
665 666
666 u16 event_slow; 667 u16 event_slow;
667 const struct rtl_coalesce_info *coalesce_info; 668 const struct rtl_coalesce_info *coalesce_info;
669 struct clk *clk;
668 670
669 struct mdio_ops { 671 struct mdio_ops {
670 void (*write)(struct rtl8169_private *, int, int); 672 void (*write)(struct rtl8169_private *, int, int);
@@ -4775,12 +4777,14 @@ static void rtl_pcie_state_l2l3_enable(struct rtl8169_private *tp, bool enable)
4775static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable) 4777static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable)
4776{ 4778{
4777 if (enable) { 4779 if (enable) {
4778 RTL_W8(tp, Config2, RTL_R8(tp, Config2) | ClkReqEn);
4779 RTL_W8(tp, Config5, RTL_R8(tp, Config5) | ASPM_en); 4780 RTL_W8(tp, Config5, RTL_R8(tp, Config5) | ASPM_en);
4781 RTL_W8(tp, Config2, RTL_R8(tp, Config2) | ClkReqEn);
4780 } else { 4782 } else {
4781 RTL_W8(tp, Config2, RTL_R8(tp, Config2) & ~ClkReqEn); 4783 RTL_W8(tp, Config2, RTL_R8(tp, Config2) & ~ClkReqEn);
4782 RTL_W8(tp, Config5, RTL_R8(tp, Config5) & ~ASPM_en); 4784 RTL_W8(tp, Config5, RTL_R8(tp, Config5) & ~ASPM_en);
4783 } 4785 }
4786
4787 udelay(10);
4784} 4788}
4785 4789
4786static void rtl_hw_start_8168bb(struct rtl8169_private *tp) 4790static void rtl_hw_start_8168bb(struct rtl8169_private *tp)
@@ -5625,6 +5629,8 @@ static void rtl_hw_start_8402(struct rtl8169_private *tp)
5625 5629
5626static void rtl_hw_start_8106(struct rtl8169_private *tp) 5630static void rtl_hw_start_8106(struct rtl8169_private *tp)
5627{ 5631{
5632 rtl_hw_aspm_clkreq_enable(tp, false);
5633
5628 /* Force LAN exit from ASPM if Rx/Tx are not idle */ 5634 /* Force LAN exit from ASPM if Rx/Tx are not idle */
5629 RTL_W32(tp, FuncEvent, RTL_R32(tp, FuncEvent) | 0x002800); 5635 RTL_W32(tp, FuncEvent, RTL_R32(tp, FuncEvent) | 0x002800);
5630 5636
@@ -5633,6 +5639,7 @@ static void rtl_hw_start_8106(struct rtl8169_private *tp)
5633 RTL_W8(tp, DLLPR, RTL_R8(tp, DLLPR) & ~PFM_EN); 5639 RTL_W8(tp, DLLPR, RTL_R8(tp, DLLPR) & ~PFM_EN);
5634 5640
5635 rtl_pcie_state_l2l3_enable(tp, false); 5641 rtl_pcie_state_l2l3_enable(tp, false);
5642 rtl_hw_aspm_clkreq_enable(tp, true);
5636} 5643}
5637 5644
5638static void rtl_hw_start_8101(struct rtl8169_private *tp) 5645static void rtl_hw_start_8101(struct rtl8169_private *tp)
@@ -7257,6 +7264,11 @@ static int rtl_jumbo_max(struct rtl8169_private *tp)
7257 } 7264 }
7258} 7265}
7259 7266
7267static void rtl_disable_clk(void *data)
7268{
7269 clk_disable_unprepare(data);
7270}
7271
7260static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 7272static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
7261{ 7273{
7262 const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data; 7274 const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data;
@@ -7277,6 +7289,32 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
7277 tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT); 7289 tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT);
7278 tp->supports_gmii = cfg->has_gmii; 7290 tp->supports_gmii = cfg->has_gmii;
7279 7291
7292 /* Get the *optional* external "ether_clk" used on some boards */
7293 tp->clk = devm_clk_get(&pdev->dev, "ether_clk");
7294 if (IS_ERR(tp->clk)) {
7295 rc = PTR_ERR(tp->clk);
7296 if (rc == -ENOENT) {
7297 /* clk-core allows NULL (for suspend / resume) */
7298 tp->clk = NULL;
7299 } else if (rc == -EPROBE_DEFER) {
7300 return rc;
7301 } else {
7302 dev_err(&pdev->dev, "failed to get clk: %d\n", rc);
7303 return rc;
7304 }
7305 } else {
7306 rc = clk_prepare_enable(tp->clk);
7307 if (rc) {
7308 dev_err(&pdev->dev, "failed to enable clk: %d\n", rc);
7309 return rc;
7310 }
7311
7312 rc = devm_add_action_or_reset(&pdev->dev, rtl_disable_clk,
7313 tp->clk);
7314 if (rc)
7315 return rc;
7316 }
7317
7280 /* enable device (incl. PCI PM wakeup and hotplug setup) */ 7318 /* enable device (incl. PCI PM wakeup and hotplug setup) */
7281 rc = pcim_enable_device(pdev); 7319 rc = pcim_enable_device(pdev);
7282 if (rc < 0) { 7320 if (rc < 0) {
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 3609c7b696c7..2b800ce1d5bf 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -67,7 +67,7 @@ static int dwmac1000_validate_mcast_bins(int mcast_bins)
67 * Description: 67 * Description:
68 * This function validates the number of Unicast address entries supported 68 * This function validates the number of Unicast address entries supported
69 * by a particular Synopsys 10/100/1000 controller. The Synopsys controller 69 * by a particular Synopsys 10/100/1000 controller. The Synopsys controller
70 * supports 1, 32, 64, or 128 Unicast filter entries for it's Unicast filter 70 * supports 1..32, 64, or 128 Unicast filter entries for it's Unicast filter
71 * logic. This function validates a valid, supported configuration is 71 * logic. This function validates a valid, supported configuration is
72 * selected, and defaults to 1 Unicast address if an unsupported 72 * selected, and defaults to 1 Unicast address if an unsupported
73 * configuration is selected. 73 * configuration is selected.
@@ -77,8 +77,7 @@ static int dwmac1000_validate_ucast_entries(int ucast_entries)
77 int x = ucast_entries; 77 int x = ucast_entries;
78 78
79 switch (x) { 79 switch (x) {
80 case 1: 80 case 1 ... 32:
81 case 32:
82 case 64: 81 case 64:
83 case 128: 82 case 128:
84 break; 83 break;
diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index 9263d638bd6d..f932923f7d56 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -41,6 +41,7 @@ config TI_DAVINCI_MDIO
41config TI_DAVINCI_CPDMA 41config TI_DAVINCI_CPDMA
42 tristate "TI DaVinci CPDMA Support" 42 tristate "TI DaVinci CPDMA Support"
43 depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST 43 depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST
44 select GENERIC_ALLOCATOR
44 ---help--- 45 ---help---
45 This driver supports TI's DaVinci CPDMA dma engine. 46 This driver supports TI's DaVinci CPDMA dma engine.
46 47
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 31c3d77b4733..fe01e141c8f8 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1203,6 +1203,9 @@ static void netvsc_send_vf(struct net_device *ndev,
1203 1203
1204 net_device_ctx->vf_alloc = nvmsg->msg.v4_msg.vf_assoc.allocated; 1204 net_device_ctx->vf_alloc = nvmsg->msg.v4_msg.vf_assoc.allocated;
1205 net_device_ctx->vf_serial = nvmsg->msg.v4_msg.vf_assoc.serial; 1205 net_device_ctx->vf_serial = nvmsg->msg.v4_msg.vf_assoc.serial;
1206 netdev_info(ndev, "VF slot %u %s\n",
1207 net_device_ctx->vf_serial,
1208 net_device_ctx->vf_alloc ? "added" : "removed");
1206} 1209}
1207 1210
1208static void netvsc_receive_inband(struct net_device *ndev, 1211static void netvsc_receive_inband(struct net_device *ndev,
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 70921bbe0e28..3af6d8d15233 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1894,20 +1894,6 @@ out_unlock:
1894 rtnl_unlock(); 1894 rtnl_unlock();
1895} 1895}
1896 1896
1897static struct net_device *get_netvsc_bymac(const u8 *mac)
1898{
1899 struct net_device_context *ndev_ctx;
1900
1901 list_for_each_entry(ndev_ctx, &netvsc_dev_list, list) {
1902 struct net_device *dev = hv_get_drvdata(ndev_ctx->device_ctx);
1903
1904 if (ether_addr_equal(mac, dev->perm_addr))
1905 return dev;
1906 }
1907
1908 return NULL;
1909}
1910
1911static struct net_device *get_netvsc_byref(struct net_device *vf_netdev) 1897static struct net_device *get_netvsc_byref(struct net_device *vf_netdev)
1912{ 1898{
1913 struct net_device_context *net_device_ctx; 1899 struct net_device_context *net_device_ctx;
@@ -2036,26 +2022,48 @@ static void netvsc_vf_setup(struct work_struct *w)
2036 rtnl_unlock(); 2022 rtnl_unlock();
2037} 2023}
2038 2024
2025/* Find netvsc by VMBus serial number.
2026 * The PCI hyperv controller records the serial number as the slot.
2027 */
2028static struct net_device *get_netvsc_byslot(const struct net_device *vf_netdev)
2029{
2030 struct device *parent = vf_netdev->dev.parent;
2031 struct net_device_context *ndev_ctx;
2032 struct pci_dev *pdev;
2033
2034 if (!parent || !dev_is_pci(parent))
2035 return NULL; /* not a PCI device */
2036
2037 pdev = to_pci_dev(parent);
2038 if (!pdev->slot) {
2039 netdev_notice(vf_netdev, "no PCI slot information\n");
2040 return NULL;
2041 }
2042
2043 list_for_each_entry(ndev_ctx, &netvsc_dev_list, list) {
2044 if (!ndev_ctx->vf_alloc)
2045 continue;
2046
2047 if (ndev_ctx->vf_serial == pdev->slot->number)
2048 return hv_get_drvdata(ndev_ctx->device_ctx);
2049 }
2050
2051 netdev_notice(vf_netdev,
2052 "no netdev found for slot %u\n", pdev->slot->number);
2053 return NULL;
2054}
2055
2039static int netvsc_register_vf(struct net_device *vf_netdev) 2056static int netvsc_register_vf(struct net_device *vf_netdev)
2040{ 2057{
2041 struct net_device *ndev;
2042 struct net_device_context *net_device_ctx; 2058 struct net_device_context *net_device_ctx;
2043 struct device *pdev = vf_netdev->dev.parent;
2044 struct netvsc_device *netvsc_dev; 2059 struct netvsc_device *netvsc_dev;
2060 struct net_device *ndev;
2045 int ret; 2061 int ret;
2046 2062
2047 if (vf_netdev->addr_len != ETH_ALEN) 2063 if (vf_netdev->addr_len != ETH_ALEN)
2048 return NOTIFY_DONE; 2064 return NOTIFY_DONE;
2049 2065
2050 if (!pdev || !dev_is_pci(pdev) || dev_is_pf(pdev)) 2066 ndev = get_netvsc_byslot(vf_netdev);
2051 return NOTIFY_DONE;
2052
2053 /*
2054 * We will use the MAC address to locate the synthetic interface to
2055 * associate with the VF interface. If we don't find a matching
2056 * synthetic interface, move on.
2057 */
2058 ndev = get_netvsc_bymac(vf_netdev->perm_addr);
2059 if (!ndev) 2067 if (!ndev)
2060 return NOTIFY_DONE; 2068 return NOTIFY_DONE;
2061 2069
@@ -2272,17 +2280,15 @@ static int netvsc_remove(struct hv_device *dev)
2272 2280
2273 cancel_delayed_work_sync(&ndev_ctx->dwork); 2281 cancel_delayed_work_sync(&ndev_ctx->dwork);
2274 2282
2275 rcu_read_lock(); 2283 rtnl_lock();
2276 nvdev = rcu_dereference(ndev_ctx->nvdev); 2284 nvdev = rtnl_dereference(ndev_ctx->nvdev);
2277 2285 if (nvdev)
2278 if (nvdev)
2279 cancel_work_sync(&nvdev->subchan_work); 2286 cancel_work_sync(&nvdev->subchan_work);
2280 2287
2281 /* 2288 /*
2282 * Call to the vsc driver to let it know that the device is being 2289 * Call to the vsc driver to let it know that the device is being
2283 * removed. Also blocks mtu and channel changes. 2290 * removed. Also blocks mtu and channel changes.
2284 */ 2291 */
2285 rtnl_lock();
2286 vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev); 2292 vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);
2287 if (vf_netdev) 2293 if (vf_netdev)
2288 netvsc_unregister_vf(vf_netdev); 2294 netvsc_unregister_vf(vf_netdev);
@@ -2294,7 +2300,6 @@ static int netvsc_remove(struct hv_device *dev)
2294 list_del(&ndev_ctx->list); 2300 list_del(&ndev_ctx->list);
2295 2301
2296 rtnl_unlock(); 2302 rtnl_unlock();
2297 rcu_read_unlock();
2298 2303
2299 hv_set_drvdata(dev, NULL); 2304 hv_set_drvdata(dev, NULL);
2300 2305
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index ce61231e96ea..62dc564b251d 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -429,6 +429,9 @@ static int pppoe_rcv(struct sk_buff *skb, struct net_device *dev,
429 if (!skb) 429 if (!skb)
430 goto out; 430 goto out;
431 431
432 if (skb_mac_header_len(skb) < ETH_HLEN)
433 goto drop;
434
432 if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr))) 435 if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
433 goto drop; 436 goto drop;
434 437
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index e3270deecec2..533b6fb8d923 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1213,13 +1213,13 @@ static const struct usb_device_id products[] = {
1213 {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */ 1213 {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */
1214 {QMI_FIXED_INTF(0x1199, 0x9063, 8)}, /* Sierra Wireless EM7305 */ 1214 {QMI_FIXED_INTF(0x1199, 0x9063, 8)}, /* Sierra Wireless EM7305 */
1215 {QMI_FIXED_INTF(0x1199, 0x9063, 10)}, /* Sierra Wireless EM7305 */ 1215 {QMI_FIXED_INTF(0x1199, 0x9063, 10)}, /* Sierra Wireless EM7305 */
1216 {QMI_FIXED_INTF(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx */ 1216 {QMI_QUIRK_SET_DTR(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx */
1217 {QMI_FIXED_INTF(0x1199, 0x9071, 10)}, /* Sierra Wireless MC74xx */ 1217 {QMI_QUIRK_SET_DTR(0x1199, 0x9071, 10)},/* Sierra Wireless MC74xx */
1218 {QMI_FIXED_INTF(0x1199, 0x9079, 8)}, /* Sierra Wireless EM74xx */ 1218 {QMI_QUIRK_SET_DTR(0x1199, 0x9079, 8)}, /* Sierra Wireless EM74xx */
1219 {QMI_FIXED_INTF(0x1199, 0x9079, 10)}, /* Sierra Wireless EM74xx */ 1219 {QMI_QUIRK_SET_DTR(0x1199, 0x9079, 10)},/* Sierra Wireless EM74xx */
1220 {QMI_FIXED_INTF(0x1199, 0x907b, 8)}, /* Sierra Wireless EM74xx */ 1220 {QMI_QUIRK_SET_DTR(0x1199, 0x907b, 8)}, /* Sierra Wireless EM74xx */
1221 {QMI_FIXED_INTF(0x1199, 0x907b, 10)}, /* Sierra Wireless EM74xx */ 1221 {QMI_QUIRK_SET_DTR(0x1199, 0x907b, 10)},/* Sierra Wireless EM74xx */
1222 {QMI_FIXED_INTF(0x1199, 0x9091, 8)}, /* Sierra Wireless EM7565 */ 1222 {QMI_QUIRK_SET_DTR(0x1199, 0x9091, 8)}, /* Sierra Wireless EM7565 */
1223 {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */ 1223 {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
1224 {QMI_FIXED_INTF(0x1bbb, 0x0203, 2)}, /* Alcatel L800MA */ 1224 {QMI_FIXED_INTF(0x1bbb, 0x0203, 2)}, /* Alcatel L800MA */
1225 {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ 1225 {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 8d679c8b7f25..41a00cd76955 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -463,6 +463,8 @@ static struct sk_buff *veth_xdp_rcv_skb(struct veth_rq *rq, struct sk_buff *skb,
463 int mac_len, delta, off; 463 int mac_len, delta, off;
464 struct xdp_buff xdp; 464 struct xdp_buff xdp;
465 465
466 skb_orphan(skb);
467
466 rcu_read_lock(); 468 rcu_read_lock();
467 xdp_prog = rcu_dereference(rq->xdp_prog); 469 xdp_prog = rcu_dereference(rq->xdp_prog);
468 if (unlikely(!xdp_prog)) { 470 if (unlikely(!xdp_prog)) {
@@ -508,8 +510,6 @@ static struct sk_buff *veth_xdp_rcv_skb(struct veth_rq *rq, struct sk_buff *skb,
508 skb_copy_header(nskb, skb); 510 skb_copy_header(nskb, skb);
509 head_off = skb_headroom(nskb) - skb_headroom(skb); 511 head_off = skb_headroom(nskb) - skb_headroom(skb);
510 skb_headers_offset_update(nskb, head_off); 512 skb_headers_offset_update(nskb, head_off);
511 if (skb->sk)
512 skb_set_owner_w(nskb, skb->sk);
513 consume_skb(skb); 513 consume_skb(skb);
514 skb = nskb; 514 skb = nskb;
515 } 515 }
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 9407acbd19a9..f17f602e6171 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -908,7 +908,11 @@ static RING_IDX xennet_fill_frags(struct netfront_queue *queue,
908 BUG_ON(pull_to <= skb_headlen(skb)); 908 BUG_ON(pull_to <= skb_headlen(skb));
909 __pskb_pull_tail(skb, pull_to - skb_headlen(skb)); 909 __pskb_pull_tail(skb, pull_to - skb_headlen(skb));
910 } 910 }
911 BUG_ON(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS); 911 if (unlikely(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) {
912 queue->rx.rsp_cons = ++cons;
913 kfree_skb(nskb);
914 return ~0U;
915 }
912 916
913 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, 917 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
914 skb_frag_page(nfrag), 918 skb_frag_page(nfrag),
@@ -1045,6 +1049,8 @@ err:
1045 skb->len += rx->status; 1049 skb->len += rx->status;
1046 1050
1047 i = xennet_fill_frags(queue, skb, &tmpq); 1051 i = xennet_fill_frags(queue, skb, &tmpq);
1052 if (unlikely(i == ~0U))
1053 goto err;
1048 1054
1049 if (rx->flags & XEN_NETRXF_csum_blank) 1055 if (rx->flags & XEN_NETRXF_csum_blank)
1050 skb->ip_summed = CHECKSUM_PARTIAL; 1056 skb->ip_summed = CHECKSUM_PARTIAL;
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index c00f82cc54aa..ee80e79db21a 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -89,6 +89,9 @@ static enum pci_protocol_version_t pci_protocol_version;
89 89
90#define STATUS_REVISION_MISMATCH 0xC0000059 90#define STATUS_REVISION_MISMATCH 0xC0000059
91 91
92/* space for 32bit serial number as string */
93#define SLOT_NAME_SIZE 11
94
92/* 95/*
93 * Message Types 96 * Message Types
94 */ 97 */
@@ -494,6 +497,7 @@ struct hv_pci_dev {
494 struct list_head list_entry; 497 struct list_head list_entry;
495 refcount_t refs; 498 refcount_t refs;
496 enum hv_pcichild_state state; 499 enum hv_pcichild_state state;
500 struct pci_slot *pci_slot;
497 struct pci_function_description desc; 501 struct pci_function_description desc;
498 bool reported_missing; 502 bool reported_missing;
499 struct hv_pcibus_device *hbus; 503 struct hv_pcibus_device *hbus;
@@ -1457,6 +1461,34 @@ static void prepopulate_bars(struct hv_pcibus_device *hbus)
1457 spin_unlock_irqrestore(&hbus->device_list_lock, flags); 1461 spin_unlock_irqrestore(&hbus->device_list_lock, flags);
1458} 1462}
1459 1463
1464/*
1465 * Assign entries in sysfs pci slot directory.
1466 *
1467 * Note that this function does not need to lock the children list
1468 * because it is called from pci_devices_present_work which
1469 * is serialized with hv_eject_device_work because they are on the
1470 * same ordered workqueue. Therefore hbus->children list will not change
1471 * even when pci_create_slot sleeps.
1472 */
1473static void hv_pci_assign_slots(struct hv_pcibus_device *hbus)
1474{
1475 struct hv_pci_dev *hpdev;
1476 char name[SLOT_NAME_SIZE];
1477 int slot_nr;
1478
1479 list_for_each_entry(hpdev, &hbus->children, list_entry) {
1480 if (hpdev->pci_slot)
1481 continue;
1482
1483 slot_nr = PCI_SLOT(wslot_to_devfn(hpdev->desc.win_slot.slot));
1484 snprintf(name, SLOT_NAME_SIZE, "%u", hpdev->desc.ser);
1485 hpdev->pci_slot = pci_create_slot(hbus->pci_bus, slot_nr,
1486 name, NULL);
1487 if (!hpdev->pci_slot)
1488 pr_warn("pci_create slot %s failed\n", name);
1489 }
1490}
1491
1460/** 1492/**
1461 * create_root_hv_pci_bus() - Expose a new root PCI bus 1493 * create_root_hv_pci_bus() - Expose a new root PCI bus
1462 * @hbus: Root PCI bus, as understood by this driver 1494 * @hbus: Root PCI bus, as understood by this driver
@@ -1480,6 +1512,7 @@ static int create_root_hv_pci_bus(struct hv_pcibus_device *hbus)
1480 pci_lock_rescan_remove(); 1512 pci_lock_rescan_remove();
1481 pci_scan_child_bus(hbus->pci_bus); 1513 pci_scan_child_bus(hbus->pci_bus);
1482 pci_bus_assign_resources(hbus->pci_bus); 1514 pci_bus_assign_resources(hbus->pci_bus);
1515 hv_pci_assign_slots(hbus);
1483 pci_bus_add_devices(hbus->pci_bus); 1516 pci_bus_add_devices(hbus->pci_bus);
1484 pci_unlock_rescan_remove(); 1517 pci_unlock_rescan_remove();
1485 hbus->state = hv_pcibus_installed; 1518 hbus->state = hv_pcibus_installed;
@@ -1742,6 +1775,7 @@ static void pci_devices_present_work(struct work_struct *work)
1742 */ 1775 */
1743 pci_lock_rescan_remove(); 1776 pci_lock_rescan_remove();
1744 pci_scan_child_bus(hbus->pci_bus); 1777 pci_scan_child_bus(hbus->pci_bus);
1778 hv_pci_assign_slots(hbus);
1745 pci_unlock_rescan_remove(); 1779 pci_unlock_rescan_remove();
1746 break; 1780 break;
1747 1781
@@ -1858,6 +1892,9 @@ static void hv_eject_device_work(struct work_struct *work)
1858 list_del(&hpdev->list_entry); 1892 list_del(&hpdev->list_entry);
1859 spin_unlock_irqrestore(&hpdev->hbus->device_list_lock, flags); 1893 spin_unlock_irqrestore(&hpdev->hbus->device_list_lock, flags);
1860 1894
1895 if (hpdev->pci_slot)
1896 pci_destroy_slot(hpdev->pci_slot);
1897
1861 memset(&ctxt, 0, sizeof(ctxt)); 1898 memset(&ctxt, 0, sizeof(ctxt));
1862 ejct_pkt = (struct pci_eject_response *)&ctxt.pkt.message; 1899 ejct_pkt = (struct pci_eject_response *)&ctxt.pkt.message;
1863 ejct_pkt->message_type.type = PCI_EJECTION_COMPLETE; 1900 ejct_pkt->message_type.type = PCI_EJECTION_COMPLETE;
diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
index d975462a4c57..f10af5c383c5 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
@@ -536,6 +536,7 @@ static acpi_status alienware_wmax_command(struct wmax_basic_args *in_args,
536 if (obj && obj->type == ACPI_TYPE_INTEGER) 536 if (obj && obj->type == ACPI_TYPE_INTEGER)
537 *out_data = (u32) obj->integer.value; 537 *out_data = (u32) obj->integer.value;
538 } 538 }
539 kfree(output.pointer);
539 return status; 540 return status;
540 541
541} 542}
diff --git a/drivers/platform/x86/dell-smbios-wmi.c b/drivers/platform/x86/dell-smbios-wmi.c
index 88afe5651d24..cf2229ece9ff 100644
--- a/drivers/platform/x86/dell-smbios-wmi.c
+++ b/drivers/platform/x86/dell-smbios-wmi.c
@@ -78,6 +78,7 @@ static int run_smbios_call(struct wmi_device *wdev)
78 dev_dbg(&wdev->dev, "result: [%08x,%08x,%08x,%08x]\n", 78 dev_dbg(&wdev->dev, "result: [%08x,%08x,%08x,%08x]\n",
79 priv->buf->std.output[0], priv->buf->std.output[1], 79 priv->buf->std.output[0], priv->buf->std.output[1],
80 priv->buf->std.output[2], priv->buf->std.output[3]); 80 priv->buf->std.output[2], priv->buf->std.output[3]);
81 kfree(output.pointer);
81 82
82 return 0; 83 return 0;
83} 84}
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 7cb3ab0a35a0..3082e72e4f6c 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -30,7 +30,11 @@
30 30
31#define DRIVER_NAME "fsl-dspi" 31#define DRIVER_NAME "fsl-dspi"
32 32
33#ifdef CONFIG_M5441x
34#define DSPI_FIFO_SIZE 16
35#else
33#define DSPI_FIFO_SIZE 4 36#define DSPI_FIFO_SIZE 4
37#endif
34#define DSPI_DMA_BUFSIZE (DSPI_FIFO_SIZE * 1024) 38#define DSPI_DMA_BUFSIZE (DSPI_FIFO_SIZE * 1024)
35 39
36#define SPI_MCR 0x00 40#define SPI_MCR 0x00
@@ -623,9 +627,11 @@ static void dspi_tcfq_read(struct fsl_dspi *dspi)
623static void dspi_eoq_write(struct fsl_dspi *dspi) 627static void dspi_eoq_write(struct fsl_dspi *dspi)
624{ 628{
625 int fifo_size = DSPI_FIFO_SIZE; 629 int fifo_size = DSPI_FIFO_SIZE;
630 u16 xfer_cmd = dspi->tx_cmd;
626 631
627 /* Fill TX FIFO with as many transfers as possible */ 632 /* Fill TX FIFO with as many transfers as possible */
628 while (dspi->len && fifo_size--) { 633 while (dspi->len && fifo_size--) {
634 dspi->tx_cmd = xfer_cmd;
629 /* Request EOQF for last transfer in FIFO */ 635 /* Request EOQF for last transfer in FIFO */
630 if (dspi->len == dspi->bytes_per_word || fifo_size == 0) 636 if (dspi->len == dspi->bytes_per_word || fifo_size == 0)
631 dspi->tx_cmd |= SPI_PUSHR_CMD_EOQ; 637 dspi->tx_cmd |= SPI_PUSHR_CMD_EOQ;
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index ec395a6baf9c..9da0bc5a036c 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2143,8 +2143,17 @@ int spi_register_controller(struct spi_controller *ctlr)
2143 */ 2143 */
2144 if (ctlr->num_chipselect == 0) 2144 if (ctlr->num_chipselect == 0)
2145 return -EINVAL; 2145 return -EINVAL;
2146 /* allocate dynamic bus number using Linux idr */ 2146 if (ctlr->bus_num >= 0) {
2147 if ((ctlr->bus_num < 0) && ctlr->dev.of_node) { 2147 /* devices with a fixed bus num must check-in with the num */
2148 mutex_lock(&board_lock);
2149 id = idr_alloc(&spi_master_idr, ctlr, ctlr->bus_num,
2150 ctlr->bus_num + 1, GFP_KERNEL);
2151 mutex_unlock(&board_lock);
2152 if (WARN(id < 0, "couldn't get idr"))
2153 return id == -ENOSPC ? -EBUSY : id;
2154 ctlr->bus_num = id;
2155 } else if (ctlr->dev.of_node) {
2156 /* allocate dynamic bus number using Linux idr */
2148 id = of_alias_get_id(ctlr->dev.of_node, "spi"); 2157 id = of_alias_get_id(ctlr->dev.of_node, "spi");
2149 if (id >= 0) { 2158 if (id >= 0) {
2150 ctlr->bus_num = id; 2159 ctlr->bus_num = id;