aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/radeon/atom.c15
-rw-r--r--drivers/gpu/drm/radeon/atom.h1
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_encoders.c25
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c2
-rw-r--r--drivers/hwmon/w83627ehf.c5
-rw-r--r--drivers/media/video/v4l2-dev.c2
-rw-r--r--drivers/net/bonding/bond_main.c7
-rw-r--r--drivers/net/netconsole.c5
-rw-r--r--drivers/net/pptp.c22
-rw-r--r--drivers/net/r8169.c90
-rw-r--r--drivers/net/smsc911x.c2
-rw-r--r--drivers/net/tg3.c2
13 files changed, 124 insertions, 56 deletions
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index e88c64417a8a..14cc88aaf3a7 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -277,7 +277,12 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr,
277 case ATOM_ARG_FB: 277 case ATOM_ARG_FB:
278 idx = U8(*ptr); 278 idx = U8(*ptr);
279 (*ptr)++; 279 (*ptr)++;
280 val = gctx->scratch[((gctx->fb_base + idx) / 4)]; 280 if ((gctx->fb_base + (idx * 4)) > gctx->scratch_size_bytes) {
281 DRM_ERROR("ATOM: fb read beyond scratch region: %d vs. %d\n",
282 gctx->fb_base + (idx * 4), gctx->scratch_size_bytes);
283 val = 0;
284 } else
285 val = gctx->scratch[(gctx->fb_base / 4) + idx];
281 if (print) 286 if (print)
282 DEBUG("FB[0x%02X]", idx); 287 DEBUG("FB[0x%02X]", idx);
283 break; 288 break;
@@ -531,7 +536,11 @@ static void atom_put_dst(atom_exec_context *ctx, int arg, uint8_t attr,
531 case ATOM_ARG_FB: 536 case ATOM_ARG_FB:
532 idx = U8(*ptr); 537 idx = U8(*ptr);
533 (*ptr)++; 538 (*ptr)++;
534 gctx->scratch[((gctx->fb_base + idx) / 4)] = val; 539 if ((gctx->fb_base + (idx * 4)) > gctx->scratch_size_bytes) {
540 DRM_ERROR("ATOM: fb write beyond scratch region: %d vs. %d\n",
541 gctx->fb_base + (idx * 4), gctx->scratch_size_bytes);
542 } else
543 gctx->scratch[(gctx->fb_base / 4) + idx] = val;
535 DEBUG("FB[0x%02X]", idx); 544 DEBUG("FB[0x%02X]", idx);
536 break; 545 break;
537 case ATOM_ARG_PLL: 546 case ATOM_ARG_PLL:
@@ -1370,11 +1379,13 @@ int atom_allocate_fb_scratch(struct atom_context *ctx)
1370 1379
1371 usage_bytes = firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb * 1024; 1380 usage_bytes = firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb * 1024;
1372 } 1381 }
1382 ctx->scratch_size_bytes = 0;
1373 if (usage_bytes == 0) 1383 if (usage_bytes == 0)
1374 usage_bytes = 20 * 1024; 1384 usage_bytes = 20 * 1024;
1375 /* allocate some scratch memory */ 1385 /* allocate some scratch memory */
1376 ctx->scratch = kzalloc(usage_bytes, GFP_KERNEL); 1386 ctx->scratch = kzalloc(usage_bytes, GFP_KERNEL);
1377 if (!ctx->scratch) 1387 if (!ctx->scratch)
1378 return -ENOMEM; 1388 return -ENOMEM;
1389 ctx->scratch_size_bytes = usage_bytes;
1379 return 0; 1390 return 0;
1380} 1391}
diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h
index a589a55b223e..93cfe2086ba0 100644
--- a/drivers/gpu/drm/radeon/atom.h
+++ b/drivers/gpu/drm/radeon/atom.h
@@ -137,6 +137,7 @@ struct atom_context {
137 int cs_equal, cs_above; 137 int cs_equal, cs_above;
138 int io_mode; 138 int io_mode;
139 uint32_t *scratch; 139 uint32_t *scratch;
140 int scratch_size_bytes;
140}; 141};
141 142
142extern int atom_debug; 143extern int atom_debug;
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index c742944d3805..a515b2a09d85 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -466,7 +466,7 @@ static void atombios_crtc_program_ss(struct drm_crtc *crtc,
466 return; 466 return;
467 } 467 }
468 args.v2.ucEnable = enable; 468 args.v2.ucEnable = enable;
469 if ((ss->percentage == 0) || (ss->type & ATOM_EXTERNAL_SS_MASK)) 469 if ((ss->percentage == 0) || (ss->type & ATOM_EXTERNAL_SS_MASK) || ASIC_IS_DCE41(rdev))
470 args.v2.ucEnable = ATOM_DISABLE; 470 args.v2.ucEnable = ATOM_DISABLE;
471 } else if (ASIC_IS_DCE3(rdev)) { 471 } else if (ASIC_IS_DCE3(rdev)) {
472 args.v1.usSpreadSpectrumPercentage = cpu_to_le16(ss->percentage); 472 args.v1.usSpreadSpectrumPercentage = cpu_to_le16(ss->percentage);
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
index 8a171b21b453..eb3f6dc6df83 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -1638,7 +1638,17 @@ atombios_set_encoder_crtc_source(struct drm_encoder *encoder)
1638 break; 1638 break;
1639 case 2: 1639 case 2:
1640 args.v2.ucCRTC = radeon_crtc->crtc_id; 1640 args.v2.ucCRTC = radeon_crtc->crtc_id;
1641 args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder); 1641 if (radeon_encoder_is_dp_bridge(encoder)) {
1642 struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
1643
1644 if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)
1645 args.v2.ucEncodeMode = ATOM_ENCODER_MODE_LVDS;
1646 else if (connector->connector_type == DRM_MODE_CONNECTOR_VGA)
1647 args.v2.ucEncodeMode = ATOM_ENCODER_MODE_CRT;
1648 else
1649 args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder);
1650 } else
1651 args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder);
1642 switch (radeon_encoder->encoder_id) { 1652 switch (radeon_encoder->encoder_id) {
1643 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: 1653 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
1644 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: 1654 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
@@ -1756,10 +1766,15 @@ static int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder)
1756 if (ASIC_IS_DCE4(rdev)) { 1766 if (ASIC_IS_DCE4(rdev)) {
1757 dig = radeon_encoder->enc_priv; 1767 dig = radeon_encoder->enc_priv;
1758 if (ASIC_IS_DCE41(rdev)) { 1768 if (ASIC_IS_DCE41(rdev)) {
1759 if (dig->linkb) 1769 /* ontario follows DCE4 */
1760 return 1; 1770 if (rdev->family == CHIP_PALM) {
1761 else 1771 if (dig->linkb)
1762 return 0; 1772 return 1;
1773 else
1774 return 0;
1775 } else
1776 /* llano follows DCE3.2 */
1777 return radeon_crtc->crtc_id;
1763 } else { 1778 } else {
1764 switch (radeon_encoder->encoder_id) { 1779 switch (radeon_encoder->encoder_id) {
1765 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: 1780 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index ae3c6f5dd2b7..082fcaea583f 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -321,7 +321,7 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
321 struct ttm_mem_type_manager *man = &bdev->man[new_mem->mem_type]; 321 struct ttm_mem_type_manager *man = &bdev->man[new_mem->mem_type];
322 struct ttm_tt *ttm = bo->ttm; 322 struct ttm_tt *ttm = bo->ttm;
323 struct ttm_mem_reg *old_mem = &bo->mem; 323 struct ttm_mem_reg *old_mem = &bo->mem;
324 struct ttm_mem_reg old_copy; 324 struct ttm_mem_reg old_copy = *old_mem;
325 void *old_iomap; 325 void *old_iomap;
326 void *new_iomap; 326 void *new_iomap;
327 int ret; 327 int ret;
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index 7b0260dc76fb..36d7f270b14d 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -390,7 +390,7 @@ temp_from_reg(u16 reg, s16 regval)
390{ 390{
391 if (is_word_sized(reg)) 391 if (is_word_sized(reg))
392 return LM75_TEMP_FROM_REG(regval); 392 return LM75_TEMP_FROM_REG(regval);
393 return regval * 1000; 393 return ((s8)regval) * 1000;
394} 394}
395 395
396static inline u16 396static inline u16
@@ -398,7 +398,8 @@ temp_to_reg(u16 reg, long temp)
398{ 398{
399 if (is_word_sized(reg)) 399 if (is_word_sized(reg))
400 return LM75_TEMP_TO_REG(temp); 400 return LM75_TEMP_TO_REG(temp);
401 return DIV_ROUND_CLOSEST(SENSORS_LIMIT(temp, -127000, 128000), 1000); 401 return (s8)DIV_ROUND_CLOSEST(SENSORS_LIMIT(temp, -127000, 128000),
402 1000);
402} 403}
403 404
404/* Some of analog inputs have internal scaling (2x), 8mV is ADC LSB */ 405/* Some of analog inputs have internal scaling (2x), 8mV is ADC LSB */
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index d72156517726..a5c9ed128b97 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -181,7 +181,7 @@ static void v4l2_device_release(struct device *cd)
181 * TODO: In the long run all drivers that use v4l2_device should use the 181 * TODO: In the long run all drivers that use v4l2_device should use the
182 * v4l2_device release callback. This check will then be unnecessary. 182 * v4l2_device release callback. This check will then be unnecessary.
183 */ 183 */
184 if (v4l2_dev->release == NULL) 184 if (v4l2_dev && v4l2_dev->release == NULL)
185 v4l2_dev = NULL; 185 v4l2_dev = NULL;
186 186
187 /* Release video_device and perform other 187 /* Release video_device and perform other
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6d79b78cfc75..de3d351ccb6b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1435,6 +1435,8 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1435 struct sk_buff *skb = *pskb; 1435 struct sk_buff *skb = *pskb;
1436 struct slave *slave; 1436 struct slave *slave;
1437 struct bonding *bond; 1437 struct bonding *bond;
1438 void (*recv_probe)(struct sk_buff *, struct bonding *,
1439 struct slave *);
1438 1440
1439 skb = skb_share_check(skb, GFP_ATOMIC); 1441 skb = skb_share_check(skb, GFP_ATOMIC);
1440 if (unlikely(!skb)) 1442 if (unlikely(!skb))
@@ -1448,11 +1450,12 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1448 if (bond->params.arp_interval) 1450 if (bond->params.arp_interval)
1449 slave->dev->last_rx = jiffies; 1451 slave->dev->last_rx = jiffies;
1450 1452
1451 if (bond->recv_probe) { 1453 recv_probe = ACCESS_ONCE(bond->recv_probe);
1454 if (recv_probe) {
1452 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); 1455 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
1453 1456
1454 if (likely(nskb)) { 1457 if (likely(nskb)) {
1455 bond->recv_probe(nskb, bond, slave); 1458 recv_probe(nskb, bond, slave);
1456 dev_kfree_skb(nskb); 1459 dev_kfree_skb(nskb);
1457 } 1460 }
1458 } 1461 }
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index ed2a3977c6e7..e8882023576b 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -307,6 +307,11 @@ static ssize_t store_enabled(struct netconsole_target *nt,
307 return err; 307 return err;
308 if (enabled < 0 || enabled > 1) 308 if (enabled < 0 || enabled > 1)
309 return -EINVAL; 309 return -EINVAL;
310 if (enabled == nt->enabled) {
311 printk(KERN_INFO "netconsole: network logging has already %s\n",
312 nt->enabled ? "started" : "stopped");
313 return -EINVAL;
314 }
310 315
311 if (enabled) { /* 1 */ 316 if (enabled) { /* 1 */
312 317
diff --git a/drivers/net/pptp.c b/drivers/net/pptp.c
index eae542a7e987..89f829f5f725 100644
--- a/drivers/net/pptp.c
+++ b/drivers/net/pptp.c
@@ -285,8 +285,10 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
285 ip_send_check(iph); 285 ip_send_check(iph);
286 286
287 ip_local_out(skb); 287 ip_local_out(skb);
288 return 1;
288 289
289tx_error: 290tx_error:
291 kfree_skb(skb);
290 return 1; 292 return 1;
291} 293}
292 294
@@ -305,11 +307,18 @@ static int pptp_rcv_core(struct sock *sk, struct sk_buff *skb)
305 } 307 }
306 308
307 header = (struct pptp_gre_header *)(skb->data); 309 header = (struct pptp_gre_header *)(skb->data);
310 headersize = sizeof(*header);
308 311
309 /* test if acknowledgement present */ 312 /* test if acknowledgement present */
310 if (PPTP_GRE_IS_A(header->ver)) { 313 if (PPTP_GRE_IS_A(header->ver)) {
311 __u32 ack = (PPTP_GRE_IS_S(header->flags)) ? 314 __u32 ack;
312 header->ack : header->seq; /* ack in different place if S = 0 */ 315
316 if (!pskb_may_pull(skb, headersize))
317 goto drop;
318 header = (struct pptp_gre_header *)(skb->data);
319
320 /* ack in different place if S = 0 */
321 ack = PPTP_GRE_IS_S(header->flags) ? header->ack : header->seq;
313 322
314 ack = ntohl(ack); 323 ack = ntohl(ack);
315 324
@@ -318,21 +327,18 @@ static int pptp_rcv_core(struct sock *sk, struct sk_buff *skb)
318 /* also handle sequence number wrap-around */ 327 /* also handle sequence number wrap-around */
319 if (WRAPPED(ack, opt->ack_recv)) 328 if (WRAPPED(ack, opt->ack_recv))
320 opt->ack_recv = ack; 329 opt->ack_recv = ack;
330 } else {
331 headersize -= sizeof(header->ack);
321 } 332 }
322
323 /* test if payload present */ 333 /* test if payload present */
324 if (!PPTP_GRE_IS_S(header->flags)) 334 if (!PPTP_GRE_IS_S(header->flags))
325 goto drop; 335 goto drop;
326 336
327 headersize = sizeof(*header);
328 payload_len = ntohs(header->payload_len); 337 payload_len = ntohs(header->payload_len);
329 seq = ntohl(header->seq); 338 seq = ntohl(header->seq);
330 339
331 /* no ack present? */
332 if (!PPTP_GRE_IS_A(header->ver))
333 headersize -= sizeof(header->ack);
334 /* check for incomplete packet (length smaller than expected) */ 340 /* check for incomplete packet (length smaller than expected) */
335 if (skb->len - headersize < payload_len) 341 if (!pskb_may_pull(skb, headersize + payload_len))
336 goto drop; 342 goto drop;
337 343
338 payload = skb->data + headersize; 344 payload = skb->data + headersize;
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c23667017922..6d657cabb951 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2859,7 +2859,7 @@ static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp)
2859 rtl_writephy(tp, 0x1f, 0x0004); 2859 rtl_writephy(tp, 0x1f, 0x0004);
2860 rtl_writephy(tp, 0x1f, 0x0007); 2860 rtl_writephy(tp, 0x1f, 0x0007);
2861 rtl_writephy(tp, 0x1e, 0x0020); 2861 rtl_writephy(tp, 0x1e, 0x0020);
2862 rtl_w1w0_phy(tp, 0x06, 0x0000, 0x0100); 2862 rtl_w1w0_phy(tp, 0x15, 0x0000, 0x0100);
2863 rtl_writephy(tp, 0x1f, 0x0002); 2863 rtl_writephy(tp, 0x1f, 0x0002);
2864 rtl_writephy(tp, 0x1f, 0x0000); 2864 rtl_writephy(tp, 0x1f, 0x0000);
2865 rtl_writephy(tp, 0x0d, 0x0007); 2865 rtl_writephy(tp, 0x0d, 0x0007);
@@ -3316,6 +3316,37 @@ static void __devinit rtl_init_mdio_ops(struct rtl8169_private *tp)
3316 } 3316 }
3317} 3317}
3318 3318
3319static void rtl_wol_suspend_quirk(struct rtl8169_private *tp)
3320{
3321 void __iomem *ioaddr = tp->mmio_addr;
3322
3323 switch (tp->mac_version) {
3324 case RTL_GIGA_MAC_VER_29:
3325 case RTL_GIGA_MAC_VER_30:
3326 case RTL_GIGA_MAC_VER_32:
3327 case RTL_GIGA_MAC_VER_33:
3328 case RTL_GIGA_MAC_VER_34:
3329 RTL_W32(RxConfig, RTL_R32(RxConfig) |
3330 AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
3331 break;
3332 default:
3333 break;
3334 }
3335}
3336
3337static bool rtl_wol_pll_power_down(struct rtl8169_private *tp)
3338{
3339 if (!(__rtl8169_get_wol(tp) & WAKE_ANY))
3340 return false;
3341
3342 rtl_writephy(tp, 0x1f, 0x0000);
3343 rtl_writephy(tp, MII_BMCR, 0x0000);
3344
3345 rtl_wol_suspend_quirk(tp);
3346
3347 return true;
3348}
3349
3319static void r810x_phy_power_down(struct rtl8169_private *tp) 3350static void r810x_phy_power_down(struct rtl8169_private *tp)
3320{ 3351{
3321 rtl_writephy(tp, 0x1f, 0x0000); 3352 rtl_writephy(tp, 0x1f, 0x0000);
@@ -3330,18 +3361,8 @@ static void r810x_phy_power_up(struct rtl8169_private *tp)
3330 3361
3331static void r810x_pll_power_down(struct rtl8169_private *tp) 3362static void r810x_pll_power_down(struct rtl8169_private *tp)
3332{ 3363{
3333 void __iomem *ioaddr = tp->mmio_addr; 3364 if (rtl_wol_pll_power_down(tp))
3334
3335 if (__rtl8169_get_wol(tp) & WAKE_ANY) {
3336 rtl_writephy(tp, 0x1f, 0x0000);
3337 rtl_writephy(tp, MII_BMCR, 0x0000);
3338
3339 if (tp->mac_version == RTL_GIGA_MAC_VER_29 ||
3340 tp->mac_version == RTL_GIGA_MAC_VER_30)
3341 RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast |
3342 AcceptMulticast | AcceptMyPhys);
3343 return; 3365 return;
3344 }
3345 3366
3346 r810x_phy_power_down(tp); 3367 r810x_phy_power_down(tp);
3347} 3368}
@@ -3430,17 +3451,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
3430 tp->mac_version == RTL_GIGA_MAC_VER_33) 3451 tp->mac_version == RTL_GIGA_MAC_VER_33)
3431 rtl_ephy_write(ioaddr, 0x19, 0xff64); 3452 rtl_ephy_write(ioaddr, 0x19, 0xff64);
3432 3453
3433 if (__rtl8169_get_wol(tp) & WAKE_ANY) { 3454 if (rtl_wol_pll_power_down(tp))
3434 rtl_writephy(tp, 0x1f, 0x0000);
3435 rtl_writephy(tp, MII_BMCR, 0x0000);
3436
3437 if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
3438 tp->mac_version == RTL_GIGA_MAC_VER_33 ||
3439 tp->mac_version == RTL_GIGA_MAC_VER_34)
3440 RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast |
3441 AcceptMulticast | AcceptMyPhys);
3442 return; 3455 return;
3443 }
3444 3456
3445 r8168_phy_power_down(tp); 3457 r8168_phy_power_down(tp);
3446 3458
@@ -5788,11 +5800,30 @@ static const struct dev_pm_ops rtl8169_pm_ops = {
5788 5800
5789#endif /* !CONFIG_PM */ 5801#endif /* !CONFIG_PM */
5790 5802
5803static void rtl_wol_shutdown_quirk(struct rtl8169_private *tp)
5804{
5805 void __iomem *ioaddr = tp->mmio_addr;
5806
5807 /* WoL fails with 8168b when the receiver is disabled. */
5808 switch (tp->mac_version) {
5809 case RTL_GIGA_MAC_VER_11:
5810 case RTL_GIGA_MAC_VER_12:
5811 case RTL_GIGA_MAC_VER_17:
5812 pci_clear_master(tp->pci_dev);
5813
5814 RTL_W8(ChipCmd, CmdRxEnb);
5815 /* PCI commit */
5816 RTL_R8(ChipCmd);
5817 break;
5818 default:
5819 break;
5820 }
5821}
5822
5791static void rtl_shutdown(struct pci_dev *pdev) 5823static void rtl_shutdown(struct pci_dev *pdev)
5792{ 5824{
5793 struct net_device *dev = pci_get_drvdata(pdev); 5825 struct net_device *dev = pci_get_drvdata(pdev);
5794 struct rtl8169_private *tp = netdev_priv(dev); 5826 struct rtl8169_private *tp = netdev_priv(dev);
5795 void __iomem *ioaddr = tp->mmio_addr;
5796 5827
5797 rtl8169_net_suspend(dev); 5828 rtl8169_net_suspend(dev);
5798 5829
@@ -5806,16 +5837,9 @@ static void rtl_shutdown(struct pci_dev *pdev)
5806 spin_unlock_irq(&tp->lock); 5837 spin_unlock_irq(&tp->lock);
5807 5838
5808 if (system_state == SYSTEM_POWER_OFF) { 5839 if (system_state == SYSTEM_POWER_OFF) {
5809 /* WoL fails with 8168b when the receiver is disabled. */ 5840 if (__rtl8169_get_wol(tp) & WAKE_ANY) {
5810 if ((tp->mac_version == RTL_GIGA_MAC_VER_11 || 5841 rtl_wol_suspend_quirk(tp);
5811 tp->mac_version == RTL_GIGA_MAC_VER_12 || 5842 rtl_wol_shutdown_quirk(tp);
5812 tp->mac_version == RTL_GIGA_MAC_VER_17) &&
5813 (tp->features & RTL_FEATURE_WOL)) {
5814 pci_clear_master(pdev);
5815
5816 RTL_W8(ChipCmd, CmdRxEnb);
5817 /* PCI commit */
5818 RTL_R8(ChipCmd);
5819 } 5843 }
5820 5844
5821 pci_wake_from_d3(pdev, true); 5845 pci_wake_from_d3(pdev, true);
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index b9016a30cdc5..c90ddb61cc56 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -26,6 +26,7 @@
26 * LAN9215, LAN9216, LAN9217, LAN9218 26 * LAN9215, LAN9216, LAN9217, LAN9218
27 * LAN9210, LAN9211 27 * LAN9210, LAN9211
28 * LAN9220, LAN9221 28 * LAN9220, LAN9221
29 * LAN89218
29 * 30 *
30 */ 31 */
31 32
@@ -1983,6 +1984,7 @@ static int __devinit smsc911x_init(struct net_device *dev)
1983 case 0x01170000: 1984 case 0x01170000:
1984 case 0x01160000: 1985 case 0x01160000:
1985 case 0x01150000: 1986 case 0x01150000:
1987 case 0x218A0000:
1986 /* LAN911[5678] family */ 1988 /* LAN911[5678] family */
1987 pdata->generation = pdata->idrev & 0x0000FFFF; 1989 pdata->generation = pdata->idrev & 0x0000FFFF;
1988 break; 1990 break;
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4a1374df6084..c11a2b8327f3 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -15577,7 +15577,7 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
15577 15577
15578 cancel_work_sync(&tp->reset_task); 15578 cancel_work_sync(&tp->reset_task);
15579 15579
15580 if (!tg3_flag(tp, USE_PHYLIB)) { 15580 if (tg3_flag(tp, USE_PHYLIB)) {
15581 tg3_phy_fini(tp); 15581 tg3_phy_fini(tp);
15582 tg3_mdio_fini(tp); 15582 tg3_mdio_fini(tp);
15583 } 15583 }