diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-08-27 20:52:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-08-27 20:52:38 -0400 |
commit | e001d7084a687c7a25b02bee47548a1df10d6e0b (patch) | |
tree | dfbcb25537a433469357da6a62959b1d9e6e5fe5 | |
parent | 5c98bcce6497c55947f1fc22e51b41849d9ad3fe (diff) | |
parent | f648f807f61e64d247d26611e34cc97e4ed03401 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:
"Some straggler bug fixes here:
1) Netlink_sendmsg() doesn't check iterator type properly in mmap
case, from Ken-ichirou MATSUZAWA.
2) Don't sleep in atomic context in bcmgenet driver, from Florian
Fainelli.
3) The pfkey_broadcast() code patch can't actually ever use anything
other than GFP_ATOMIC. And the cases that right now pass
GFP_KERNEL or similar will currently trigger an RCU splat. Just
use GFP_ATOMIC unconditionally. From David Ahern.
4) Fix FD bit timings handling in pcan_usb driver, from Marc
Kleine-Budde.
5) Cache dst leaked in ip6_gre tunnel removal, fix from Huaibin Wang.
6) Traversal into drivers/net/ethernet/renesas should be triggered by
CONFIG_NET_VENDOR_RENESAS, not a particular driver's config
option. From Kazuya Mizuguchi.
7) Fix regression in handling of igmp_join errors in vxlan, from
Marcelo Ricardo Leitner.
8) Make phy_{read,write}_mmd_indirect() properly take the mdio_lock
mutex when programming the registers. From Russell King.
9) Fix non-forced handling in u32_destroy(), from WANG Cong.
10) Test the EVENT_NO_RUNTIME_PM flag before it is cleared in
usbnet_stop(), from Eugene Shatokhin.
11) In sfc driver, don't fetch statistics firmware isn't capable of,
from Bert Kenward.
12) Verify ASCONF address parameter location in SCTP, from Xin Long"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
sctp: donot reset the overall_error_count in SHUTDOWN_RECEIVE state
sctp: asconf's process should verify address parameter is in the beginning
sfc: only use vadaptor stats if firmware is capable
net: phy: fixed: propagate fixed link values to struct
usbnet: Get EVENT_NO_RUNTIME_PM bit before it is cleared
drivers: net: xgene: fix: Oops in linkwatch_fire_event
cls_u32: complete the check for non-forced case in u32_destroy()
net: fec: use reinit_completion() in mdio accessor functions
net: phy: add locking to phy_read_mmd_indirect()/phy_write_mmd_indirect()
vxlan: re-ignore EADDRINUSE from igmp_join
net: compile renesas directory if NET_VENDOR_RENESAS is configured
ip6_gre: release cached dst on tunnel removal
phylib: Make PHYs children of their MDIO bus, not the bus' parent.
can: pcan_usb: don't provide CAN FD bittimings by non-FD adapters
net: Fix RCU splat in af_key
net: bcmgenet: fix uncleaned dma flags
net: bcmgenet: Avoid sleeping in bcmgenet_timeout
netlink: mmap: fix tx type check
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb.c | 24 | ||||
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_core.c | 4 | ||||
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_core.h | 4 | ||||
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 96 | ||||
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 24 | ||||
-rw-r--r-- | drivers/net/ethernet/Makefile | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/genet/bcmgenet.c | 20 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/ef10.c | 27 | ||||
-rw-r--r-- | drivers/net/phy/fixed_phy.c | 9 | ||||
-rw-r--r-- | drivers/net/phy/phy.c | 16 | ||||
-rw-r--r-- | drivers/net/phy/phy_device.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 7 | ||||
-rw-r--r-- | drivers/net/vxlan.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_gre.c | 1 | ||||
-rw-r--r-- | net/key/af_key.c | 46 | ||||
-rw-r--r-- | net/netlink/af_netlink.c | 2 | ||||
-rw-r--r-- | net/sched/cls_u32.c | 13 | ||||
-rw-r--r-- | net/sctp/sm_make_chunk.c | 7 | ||||
-rw-r--r-- | net/sctp/sm_sideeffect.c | 2 |
22 files changed, 207 insertions, 113 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c index 6b94007ae052..838545ce468d 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb.c | |||
@@ -854,6 +854,18 @@ static int pcan_usb_probe(struct usb_interface *intf) | |||
854 | /* | 854 | /* |
855 | * describe the PCAN-USB adapter | 855 | * describe the PCAN-USB adapter |
856 | */ | 856 | */ |
857 | static const struct can_bittiming_const pcan_usb_const = { | ||
858 | .name = "pcan_usb", | ||
859 | .tseg1_min = 1, | ||
860 | .tseg1_max = 16, | ||
861 | .tseg2_min = 1, | ||
862 | .tseg2_max = 8, | ||
863 | .sjw_max = 4, | ||
864 | .brp_min = 1, | ||
865 | .brp_max = 64, | ||
866 | .brp_inc = 1, | ||
867 | }; | ||
868 | |||
857 | const struct peak_usb_adapter pcan_usb = { | 869 | const struct peak_usb_adapter pcan_usb = { |
858 | .name = "PCAN-USB", | 870 | .name = "PCAN-USB", |
859 | .device_id = PCAN_USB_PRODUCT_ID, | 871 | .device_id = PCAN_USB_PRODUCT_ID, |
@@ -862,17 +874,7 @@ const struct peak_usb_adapter pcan_usb = { | |||
862 | .clock = { | 874 | .clock = { |
863 | .freq = PCAN_USB_CRYSTAL_HZ / 2 , | 875 | .freq = PCAN_USB_CRYSTAL_HZ / 2 , |
864 | }, | 876 | }, |
865 | .bittiming_const = { | 877 | .bittiming_const = &pcan_usb_const, |
866 | .name = "pcan_usb", | ||
867 | .tseg1_min = 1, | ||
868 | .tseg1_max = 16, | ||
869 | .tseg2_min = 1, | ||
870 | .tseg2_max = 8, | ||
871 | .sjw_max = 4, | ||
872 | .brp_min = 1, | ||
873 | .brp_max = 64, | ||
874 | .brp_inc = 1, | ||
875 | }, | ||
876 | 878 | ||
877 | /* size of device private data */ | 879 | /* size of device private data */ |
878 | .sizeof_dev_private = sizeof(struct pcan_usb), | 880 | .sizeof_dev_private = sizeof(struct pcan_usb), |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c index 7921cff93a63..5a2e341a6d1e 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c | |||
@@ -792,9 +792,9 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter, | |||
792 | dev->ep_msg_out = peak_usb_adapter->ep_msg_out[ctrl_idx]; | 792 | dev->ep_msg_out = peak_usb_adapter->ep_msg_out[ctrl_idx]; |
793 | 793 | ||
794 | dev->can.clock = peak_usb_adapter->clock; | 794 | dev->can.clock = peak_usb_adapter->clock; |
795 | dev->can.bittiming_const = &peak_usb_adapter->bittiming_const; | 795 | dev->can.bittiming_const = peak_usb_adapter->bittiming_const; |
796 | dev->can.do_set_bittiming = peak_usb_set_bittiming; | 796 | dev->can.do_set_bittiming = peak_usb_set_bittiming; |
797 | dev->can.data_bittiming_const = &peak_usb_adapter->data_bittiming_const; | 797 | dev->can.data_bittiming_const = peak_usb_adapter->data_bittiming_const; |
798 | dev->can.do_set_data_bittiming = peak_usb_set_data_bittiming; | 798 | dev->can.do_set_data_bittiming = peak_usb_set_data_bittiming; |
799 | dev->can.do_set_mode = peak_usb_set_mode; | 799 | dev->can.do_set_mode = peak_usb_set_mode; |
800 | dev->can.do_get_berr_counter = peak_usb_adapter->do_get_berr_counter; | 800 | dev->can.do_get_berr_counter = peak_usb_adapter->do_get_berr_counter; |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.h b/drivers/net/can/usb/peak_usb/pcan_usb_core.h index 9e624f05ad4d..506fe506c9d3 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.h +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.h | |||
@@ -48,8 +48,8 @@ struct peak_usb_adapter { | |||
48 | u32 device_id; | 48 | u32 device_id; |
49 | u32 ctrlmode_supported; | 49 | u32 ctrlmode_supported; |
50 | struct can_clock clock; | 50 | struct can_clock clock; |
51 | const struct can_bittiming_const bittiming_const; | 51 | const struct can_bittiming_const * const bittiming_const; |
52 | const struct can_bittiming_const data_bittiming_const; | 52 | const struct can_bittiming_const * const data_bittiming_const; |
53 | unsigned int ctrl_count; | 53 | unsigned int ctrl_count; |
54 | 54 | ||
55 | int (*intf_probe)(struct usb_interface *intf); | 55 | int (*intf_probe)(struct usb_interface *intf); |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c index 09d14e70abd7..ce44a033f63b 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c | |||
@@ -990,6 +990,30 @@ static void pcan_usb_fd_free(struct peak_usb_device *dev) | |||
990 | } | 990 | } |
991 | 991 | ||
992 | /* describes the PCAN-USB FD adapter */ | 992 | /* describes the PCAN-USB FD adapter */ |
993 | static const struct can_bittiming_const pcan_usb_fd_const = { | ||
994 | .name = "pcan_usb_fd", | ||
995 | .tseg1_min = 1, | ||
996 | .tseg1_max = 64, | ||
997 | .tseg2_min = 1, | ||
998 | .tseg2_max = 16, | ||
999 | .sjw_max = 16, | ||
1000 | .brp_min = 1, | ||
1001 | .brp_max = 1024, | ||
1002 | .brp_inc = 1, | ||
1003 | }; | ||
1004 | |||
1005 | static const struct can_bittiming_const pcan_usb_fd_data_const = { | ||
1006 | .name = "pcan_usb_fd", | ||
1007 | .tseg1_min = 1, | ||
1008 | .tseg1_max = 16, | ||
1009 | .tseg2_min = 1, | ||
1010 | .tseg2_max = 8, | ||
1011 | .sjw_max = 4, | ||
1012 | .brp_min = 1, | ||
1013 | .brp_max = 1024, | ||
1014 | .brp_inc = 1, | ||
1015 | }; | ||
1016 | |||
993 | const struct peak_usb_adapter pcan_usb_fd = { | 1017 | const struct peak_usb_adapter pcan_usb_fd = { |
994 | .name = "PCAN-USB FD", | 1018 | .name = "PCAN-USB FD", |
995 | .device_id = PCAN_USBFD_PRODUCT_ID, | 1019 | .device_id = PCAN_USBFD_PRODUCT_ID, |
@@ -999,28 +1023,8 @@ const struct peak_usb_adapter pcan_usb_fd = { | |||
999 | .clock = { | 1023 | .clock = { |
1000 | .freq = PCAN_UFD_CRYSTAL_HZ, | 1024 | .freq = PCAN_UFD_CRYSTAL_HZ, |
1001 | }, | 1025 | }, |
1002 | .bittiming_const = { | 1026 | .bittiming_const = &pcan_usb_fd_const, |
1003 | .name = "pcan_usb_fd", | 1027 | .data_bittiming_const = &pcan_usb_fd_data_const, |
1004 | .tseg1_min = 1, | ||
1005 | .tseg1_max = 64, | ||
1006 | .tseg2_min = 1, | ||
1007 | .tseg2_max = 16, | ||
1008 | .sjw_max = 16, | ||
1009 | .brp_min = 1, | ||
1010 | .brp_max = 1024, | ||
1011 | .brp_inc = 1, | ||
1012 | }, | ||
1013 | .data_bittiming_const = { | ||
1014 | .name = "pcan_usb_fd", | ||
1015 | .tseg1_min = 1, | ||
1016 | .tseg1_max = 16, | ||
1017 | .tseg2_min = 1, | ||
1018 | .tseg2_max = 8, | ||
1019 | .sjw_max = 4, | ||
1020 | .brp_min = 1, | ||
1021 | .brp_max = 1024, | ||
1022 | .brp_inc = 1, | ||
1023 | }, | ||
1024 | 1028 | ||
1025 | /* size of device private data */ | 1029 | /* size of device private data */ |
1026 | .sizeof_dev_private = sizeof(struct pcan_usb_fd_device), | 1030 | .sizeof_dev_private = sizeof(struct pcan_usb_fd_device), |
@@ -1058,6 +1062,30 @@ const struct peak_usb_adapter pcan_usb_fd = { | |||
1058 | }; | 1062 | }; |
1059 | 1063 | ||
1060 | /* describes the PCAN-USB Pro FD adapter */ | 1064 | /* describes the PCAN-USB Pro FD adapter */ |
1065 | static const struct can_bittiming_const pcan_usb_pro_fd_const = { | ||
1066 | .name = "pcan_usb_pro_fd", | ||
1067 | .tseg1_min = 1, | ||
1068 | .tseg1_max = 64, | ||
1069 | .tseg2_min = 1, | ||
1070 | .tseg2_max = 16, | ||
1071 | .sjw_max = 16, | ||
1072 | .brp_min = 1, | ||
1073 | .brp_max = 1024, | ||
1074 | .brp_inc = 1, | ||
1075 | }; | ||
1076 | |||
1077 | static const struct can_bittiming_const pcan_usb_pro_fd_data_const = { | ||
1078 | .name = "pcan_usb_pro_fd", | ||
1079 | .tseg1_min = 1, | ||
1080 | .tseg1_max = 16, | ||
1081 | .tseg2_min = 1, | ||
1082 | .tseg2_max = 8, | ||
1083 | .sjw_max = 4, | ||
1084 | .brp_min = 1, | ||
1085 | .brp_max = 1024, | ||
1086 | .brp_inc = 1, | ||
1087 | }; | ||
1088 | |||
1061 | const struct peak_usb_adapter pcan_usb_pro_fd = { | 1089 | const struct peak_usb_adapter pcan_usb_pro_fd = { |
1062 | .name = "PCAN-USB Pro FD", | 1090 | .name = "PCAN-USB Pro FD", |
1063 | .device_id = PCAN_USBPROFD_PRODUCT_ID, | 1091 | .device_id = PCAN_USBPROFD_PRODUCT_ID, |
@@ -1067,28 +1095,8 @@ const struct peak_usb_adapter pcan_usb_pro_fd = { | |||
1067 | .clock = { | 1095 | .clock = { |
1068 | .freq = PCAN_UFD_CRYSTAL_HZ, | 1096 | .freq = PCAN_UFD_CRYSTAL_HZ, |
1069 | }, | 1097 | }, |
1070 | .bittiming_const = { | 1098 | .bittiming_const = &pcan_usb_pro_fd_const, |
1071 | .name = "pcan_usb_pro_fd", | 1099 | .data_bittiming_const = &pcan_usb_pro_fd_data_const, |
1072 | .tseg1_min = 1, | ||
1073 | .tseg1_max = 64, | ||
1074 | .tseg2_min = 1, | ||
1075 | .tseg2_max = 16, | ||
1076 | .sjw_max = 16, | ||
1077 | .brp_min = 1, | ||
1078 | .brp_max = 1024, | ||
1079 | .brp_inc = 1, | ||
1080 | }, | ||
1081 | .data_bittiming_const = { | ||
1082 | .name = "pcan_usb_pro_fd", | ||
1083 | .tseg1_min = 1, | ||
1084 | .tseg1_max = 16, | ||
1085 | .tseg2_min = 1, | ||
1086 | .tseg2_max = 8, | ||
1087 | .sjw_max = 4, | ||
1088 | .brp_min = 1, | ||
1089 | .brp_max = 1024, | ||
1090 | .brp_inc = 1, | ||
1091 | }, | ||
1092 | 1100 | ||
1093 | /* size of device private data */ | 1101 | /* size of device private data */ |
1094 | .sizeof_dev_private = sizeof(struct pcan_usb_fd_device), | 1102 | .sizeof_dev_private = sizeof(struct pcan_usb_fd_device), |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c index 7d61b3279798..bbdd6058cd2f 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c | |||
@@ -1004,6 +1004,18 @@ int pcan_usb_pro_probe(struct usb_interface *intf) | |||
1004 | /* | 1004 | /* |
1005 | * describe the PCAN-USB Pro adapter | 1005 | * describe the PCAN-USB Pro adapter |
1006 | */ | 1006 | */ |
1007 | static const struct can_bittiming_const pcan_usb_pro_const = { | ||
1008 | .name = "pcan_usb_pro", | ||
1009 | .tseg1_min = 1, | ||
1010 | .tseg1_max = 16, | ||
1011 | .tseg2_min = 1, | ||
1012 | .tseg2_max = 8, | ||
1013 | .sjw_max = 4, | ||
1014 | .brp_min = 1, | ||
1015 | .brp_max = 1024, | ||
1016 | .brp_inc = 1, | ||
1017 | }; | ||
1018 | |||
1007 | const struct peak_usb_adapter pcan_usb_pro = { | 1019 | const struct peak_usb_adapter pcan_usb_pro = { |
1008 | .name = "PCAN-USB Pro", | 1020 | .name = "PCAN-USB Pro", |
1009 | .device_id = PCAN_USBPRO_PRODUCT_ID, | 1021 | .device_id = PCAN_USBPRO_PRODUCT_ID, |
@@ -1012,17 +1024,7 @@ const struct peak_usb_adapter pcan_usb_pro = { | |||
1012 | .clock = { | 1024 | .clock = { |
1013 | .freq = PCAN_USBPRO_CRYSTAL_HZ, | 1025 | .freq = PCAN_USBPRO_CRYSTAL_HZ, |
1014 | }, | 1026 | }, |
1015 | .bittiming_const = { | 1027 | .bittiming_const = &pcan_usb_pro_const, |
1016 | .name = "pcan_usb_pro", | ||
1017 | .tseg1_min = 1, | ||
1018 | .tseg1_max = 16, | ||
1019 | .tseg2_min = 1, | ||
1020 | .tseg2_max = 8, | ||
1021 | .sjw_max = 4, | ||
1022 | .brp_min = 1, | ||
1023 | .brp_max = 1024, | ||
1024 | .brp_inc = 1, | ||
1025 | }, | ||
1026 | 1028 | ||
1027 | /* size of device private data */ | 1029 | /* size of device private data */ |
1028 | .sizeof_dev_private = sizeof(struct pcan_usb_pro_device), | 1030 | .sizeof_dev_private = sizeof(struct pcan_usb_pro_device), |
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile index c51014b0464f..b52e0f63f9a3 100644 --- a/drivers/net/ethernet/Makefile +++ b/drivers/net/ethernet/Makefile | |||
@@ -65,7 +65,7 @@ obj-$(CONFIG_NET_VENDOR_PASEMI) += pasemi/ | |||
65 | obj-$(CONFIG_NET_VENDOR_QLOGIC) += qlogic/ | 65 | obj-$(CONFIG_NET_VENDOR_QLOGIC) += qlogic/ |
66 | obj-$(CONFIG_NET_VENDOR_QUALCOMM) += qualcomm/ | 66 | obj-$(CONFIG_NET_VENDOR_QUALCOMM) += qualcomm/ |
67 | obj-$(CONFIG_NET_VENDOR_REALTEK) += realtek/ | 67 | obj-$(CONFIG_NET_VENDOR_REALTEK) += realtek/ |
68 | obj-$(CONFIG_SH_ETH) += renesas/ | 68 | obj-$(CONFIG_NET_VENDOR_RENESAS) += renesas/ |
69 | obj-$(CONFIG_NET_VENDOR_RDC) += rdc/ | 69 | obj-$(CONFIG_NET_VENDOR_RDC) += rdc/ |
70 | obj-$(CONFIG_NET_VENDOR_ROCKER) += rocker/ | 70 | obj-$(CONFIG_NET_VENDOR_ROCKER) += rocker/ |
71 | obj-$(CONFIG_NET_VENDOR_SAMSUNG) += samsung/ | 71 | obj-$(CONFIG_NET_VENDOR_SAMSUNG) += samsung/ |
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c index a626c4315a89..cfa37041ab71 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | |||
@@ -801,6 +801,9 @@ int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata) | |||
801 | 801 | ||
802 | void xgene_enet_mdio_remove(struct xgene_enet_pdata *pdata) | 802 | void xgene_enet_mdio_remove(struct xgene_enet_pdata *pdata) |
803 | { | 803 | { |
804 | if (pdata->phy_dev) | ||
805 | phy_disconnect(pdata->phy_dev); | ||
806 | |||
804 | mdiobus_unregister(pdata->mdio_bus); | 807 | mdiobus_unregister(pdata->mdio_bus); |
805 | mdiobus_free(pdata->mdio_bus); | 808 | mdiobus_free(pdata->mdio_bus); |
806 | pdata->mdio_bus = NULL; | 809 | pdata->mdio_bus = NULL; |
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c index 299eb4315fe6..a02ea7f8fdae 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c | |||
@@ -1277,9 +1277,10 @@ static int xgene_enet_remove(struct platform_device *pdev) | |||
1277 | mac_ops->tx_disable(pdata); | 1277 | mac_ops->tx_disable(pdata); |
1278 | 1278 | ||
1279 | xgene_enet_napi_del(pdata); | 1279 | xgene_enet_napi_del(pdata); |
1280 | xgene_enet_mdio_remove(pdata); | 1280 | if (pdata->phy_mode == PHY_INTERFACE_MODE_RGMII) |
1281 | xgene_enet_delete_desc_rings(pdata); | 1281 | xgene_enet_mdio_remove(pdata); |
1282 | unregister_netdev(ndev); | 1282 | unregister_netdev(ndev); |
1283 | xgene_enet_delete_desc_rings(pdata); | ||
1283 | pdata->port_ops->shutdown(pdata); | 1284 | pdata->port_ops->shutdown(pdata); |
1284 | free_netdev(ndev); | 1285 | free_netdev(ndev); |
1285 | 1286 | ||
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 64c1e9db6b0b..09ff09f828d0 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c | |||
@@ -2126,6 +2126,8 @@ static int bcmgenet_dma_teardown(struct bcmgenet_priv *priv) | |||
2126 | int ret = 0; | 2126 | int ret = 0; |
2127 | int timeout = 0; | 2127 | int timeout = 0; |
2128 | u32 reg; | 2128 | u32 reg; |
2129 | u32 dma_ctrl; | ||
2130 | int i; | ||
2129 | 2131 | ||
2130 | /* Disable TDMA to stop add more frames in TX DMA */ | 2132 | /* Disable TDMA to stop add more frames in TX DMA */ |
2131 | reg = bcmgenet_tdma_readl(priv, DMA_CTRL); | 2133 | reg = bcmgenet_tdma_readl(priv, DMA_CTRL); |
@@ -2169,6 +2171,20 @@ static int bcmgenet_dma_teardown(struct bcmgenet_priv *priv) | |||
2169 | ret = -ETIMEDOUT; | 2171 | ret = -ETIMEDOUT; |
2170 | } | 2172 | } |
2171 | 2173 | ||
2174 | dma_ctrl = 0; | ||
2175 | for (i = 0; i < priv->hw_params->rx_queues; i++) | ||
2176 | dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT)); | ||
2177 | reg = bcmgenet_rdma_readl(priv, DMA_CTRL); | ||
2178 | reg &= ~dma_ctrl; | ||
2179 | bcmgenet_rdma_writel(priv, reg, DMA_CTRL); | ||
2180 | |||
2181 | dma_ctrl = 0; | ||
2182 | for (i = 0; i < priv->hw_params->tx_queues; i++) | ||
2183 | dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT)); | ||
2184 | reg = bcmgenet_tdma_readl(priv, DMA_CTRL); | ||
2185 | reg &= ~dma_ctrl; | ||
2186 | bcmgenet_tdma_writel(priv, reg, DMA_CTRL); | ||
2187 | |||
2172 | return ret; | 2188 | return ret; |
2173 | } | 2189 | } |
2174 | 2190 | ||
@@ -2820,8 +2836,6 @@ static void bcmgenet_timeout(struct net_device *dev) | |||
2820 | 2836 | ||
2821 | netif_dbg(priv, tx_err, dev, "bcmgenet_timeout\n"); | 2837 | netif_dbg(priv, tx_err, dev, "bcmgenet_timeout\n"); |
2822 | 2838 | ||
2823 | bcmgenet_disable_tx_napi(priv); | ||
2824 | |||
2825 | for (q = 0; q < priv->hw_params->tx_queues; q++) | 2839 | for (q = 0; q < priv->hw_params->tx_queues; q++) |
2826 | bcmgenet_dump_tx_queue(&priv->tx_rings[q]); | 2840 | bcmgenet_dump_tx_queue(&priv->tx_rings[q]); |
2827 | bcmgenet_dump_tx_queue(&priv->tx_rings[DESC_INDEX]); | 2841 | bcmgenet_dump_tx_queue(&priv->tx_rings[DESC_INDEX]); |
@@ -2837,8 +2851,6 @@ static void bcmgenet_timeout(struct net_device *dev) | |||
2837 | bcmgenet_intrl2_0_writel(priv, int0_enable, INTRL2_CPU_MASK_CLEAR); | 2851 | bcmgenet_intrl2_0_writel(priv, int0_enable, INTRL2_CPU_MASK_CLEAR); |
2838 | bcmgenet_intrl2_1_writel(priv, int1_enable, INTRL2_CPU_MASK_CLEAR); | 2852 | bcmgenet_intrl2_1_writel(priv, int1_enable, INTRL2_CPU_MASK_CLEAR); |
2839 | 2853 | ||
2840 | bcmgenet_enable_tx_napi(priv); | ||
2841 | |||
2842 | dev->trans_start = jiffies; | 2854 | dev->trans_start = jiffies; |
2843 | 2855 | ||
2844 | dev->stats.tx_errors++; | 2856 | dev->stats.tx_errors++; |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 271bb5862346..b349e6f36ea7 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -1778,7 +1778,7 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum) | |||
1778 | return ret; | 1778 | return ret; |
1779 | 1779 | ||
1780 | fep->mii_timeout = 0; | 1780 | fep->mii_timeout = 0; |
1781 | init_completion(&fep->mdio_done); | 1781 | reinit_completion(&fep->mdio_done); |
1782 | 1782 | ||
1783 | /* start a read op */ | 1783 | /* start a read op */ |
1784 | writel(FEC_MMFR_ST | FEC_MMFR_OP_READ | | 1784 | writel(FEC_MMFR_ST | FEC_MMFR_OP_READ | |
@@ -1817,7 +1817,7 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum, | |||
1817 | return ret; | 1817 | return ret; |
1818 | 1818 | ||
1819 | fep->mii_timeout = 0; | 1819 | fep->mii_timeout = 0; |
1820 | init_completion(&fep->mdio_done); | 1820 | reinit_completion(&fep->mdio_done); |
1821 | 1821 | ||
1822 | /* start a write op */ | 1822 | /* start a write op */ |
1823 | writel(FEC_MMFR_ST | FEC_MMFR_OP_WRITE | | 1823 | writel(FEC_MMFR_ST | FEC_MMFR_OP_WRITE | |
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 605cc8948594..b1a4ea21c91c 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
@@ -1282,7 +1282,12 @@ static size_t efx_ef10_update_stats_common(struct efx_nic *efx, u64 *full_stats, | |||
1282 | } | 1282 | } |
1283 | } | 1283 | } |
1284 | 1284 | ||
1285 | if (core_stats) { | 1285 | if (!core_stats) |
1286 | return stats_count; | ||
1287 | |||
1288 | if (nic_data->datapath_caps & | ||
1289 | 1 << MC_CMD_GET_CAPABILITIES_OUT_EVB_LBN) { | ||
1290 | /* Use vadaptor stats. */ | ||
1286 | core_stats->rx_packets = stats[EF10_STAT_rx_unicast] + | 1291 | core_stats->rx_packets = stats[EF10_STAT_rx_unicast] + |
1287 | stats[EF10_STAT_rx_multicast] + | 1292 | stats[EF10_STAT_rx_multicast] + |
1288 | stats[EF10_STAT_rx_broadcast]; | 1293 | stats[EF10_STAT_rx_broadcast]; |
@@ -1302,6 +1307,26 @@ static size_t efx_ef10_update_stats_common(struct efx_nic *efx, u64 *full_stats, | |||
1302 | core_stats->rx_fifo_errors = stats[EF10_STAT_rx_overflow]; | 1307 | core_stats->rx_fifo_errors = stats[EF10_STAT_rx_overflow]; |
1303 | core_stats->rx_errors = core_stats->rx_crc_errors; | 1308 | core_stats->rx_errors = core_stats->rx_crc_errors; |
1304 | core_stats->tx_errors = stats[EF10_STAT_tx_bad]; | 1309 | core_stats->tx_errors = stats[EF10_STAT_tx_bad]; |
1310 | } else { | ||
1311 | /* Use port stats. */ | ||
1312 | core_stats->rx_packets = stats[EF10_STAT_port_rx_packets]; | ||
1313 | core_stats->tx_packets = stats[EF10_STAT_port_tx_packets]; | ||
1314 | core_stats->rx_bytes = stats[EF10_STAT_port_rx_bytes]; | ||
1315 | core_stats->tx_bytes = stats[EF10_STAT_port_tx_bytes]; | ||
1316 | core_stats->rx_dropped = stats[EF10_STAT_port_rx_nodesc_drops] + | ||
1317 | stats[GENERIC_STAT_rx_nodesc_trunc] + | ||
1318 | stats[GENERIC_STAT_rx_noskb_drops]; | ||
1319 | core_stats->multicast = stats[EF10_STAT_port_rx_multicast]; | ||
1320 | core_stats->rx_length_errors = | ||
1321 | stats[EF10_STAT_port_rx_gtjumbo] + | ||
1322 | stats[EF10_STAT_port_rx_length_error]; | ||
1323 | core_stats->rx_crc_errors = stats[EF10_STAT_port_rx_bad]; | ||
1324 | core_stats->rx_frame_errors = | ||
1325 | stats[EF10_STAT_port_rx_align_error]; | ||
1326 | core_stats->rx_fifo_errors = stats[EF10_STAT_port_rx_overflow]; | ||
1327 | core_stats->rx_errors = (core_stats->rx_length_errors + | ||
1328 | core_stats->rx_crc_errors + | ||
1329 | core_stats->rx_frame_errors); | ||
1305 | } | 1330 | } |
1306 | 1331 | ||
1307 | return stats_count; | 1332 | return stats_count; |
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c index 1960b46add65..d7a65247f952 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c | |||
@@ -290,6 +290,15 @@ struct phy_device *fixed_phy_register(unsigned int irq, | |||
290 | return ERR_PTR(-EINVAL); | 290 | return ERR_PTR(-EINVAL); |
291 | } | 291 | } |
292 | 292 | ||
293 | /* propagate the fixed link values to struct phy_device */ | ||
294 | phy->link = status->link; | ||
295 | if (status->link) { | ||
296 | phy->speed = status->speed; | ||
297 | phy->duplex = status->duplex; | ||
298 | phy->pause = status->pause; | ||
299 | phy->asym_pause = status->asym_pause; | ||
300 | } | ||
301 | |||
293 | of_node_get(np); | 302 | of_node_get(np); |
294 | phy->dev.of_node = np; | 303 | phy->dev.of_node = np; |
295 | 304 | ||
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 1e1fbb049ec6..34fe339f4e80 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -1038,10 +1038,14 @@ int phy_read_mmd_indirect(struct phy_device *phydev, int prtad, | |||
1038 | int value = -1; | 1038 | int value = -1; |
1039 | 1039 | ||
1040 | if (phydrv->read_mmd_indirect == NULL) { | 1040 | if (phydrv->read_mmd_indirect == NULL) { |
1041 | mmd_phy_indirect(phydev->bus, prtad, devad, addr); | 1041 | struct mii_bus *bus = phydev->bus; |
1042 | |||
1043 | mutex_lock(&bus->mdio_lock); | ||
1044 | mmd_phy_indirect(bus, prtad, devad, addr); | ||
1042 | 1045 | ||
1043 | /* Read the content of the MMD's selected register */ | 1046 | /* Read the content of the MMD's selected register */ |
1044 | value = phydev->bus->read(phydev->bus, addr, MII_MMD_DATA); | 1047 | value = bus->read(bus, addr, MII_MMD_DATA); |
1048 | mutex_unlock(&bus->mdio_lock); | ||
1045 | } else { | 1049 | } else { |
1046 | value = phydrv->read_mmd_indirect(phydev, prtad, devad, addr); | 1050 | value = phydrv->read_mmd_indirect(phydev, prtad, devad, addr); |
1047 | } | 1051 | } |
@@ -1071,10 +1075,14 @@ void phy_write_mmd_indirect(struct phy_device *phydev, int prtad, | |||
1071 | struct phy_driver *phydrv = phydev->drv; | 1075 | struct phy_driver *phydrv = phydev->drv; |
1072 | 1076 | ||
1073 | if (phydrv->write_mmd_indirect == NULL) { | 1077 | if (phydrv->write_mmd_indirect == NULL) { |
1074 | mmd_phy_indirect(phydev->bus, prtad, devad, addr); | 1078 | struct mii_bus *bus = phydev->bus; |
1079 | |||
1080 | mutex_lock(&bus->mdio_lock); | ||
1081 | mmd_phy_indirect(bus, prtad, devad, addr); | ||
1075 | 1082 | ||
1076 | /* Write the data into MMD's selected register */ | 1083 | /* Write the data into MMD's selected register */ |
1077 | phydev->bus->write(phydev->bus, addr, MII_MMD_DATA, data); | 1084 | bus->write(bus, addr, MII_MMD_DATA, data); |
1085 | mutex_unlock(&bus->mdio_lock); | ||
1078 | } else { | 1086 | } else { |
1079 | phydrv->write_mmd_indirect(phydev, prtad, devad, addr, data); | 1087 | phydrv->write_mmd_indirect(phydev, prtad, devad, addr, data); |
1080 | } | 1088 | } |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 0302483de240..55f01788df5e 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -176,7 +176,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, | |||
176 | if (c45_ids) | 176 | if (c45_ids) |
177 | dev->c45_ids = *c45_ids; | 177 | dev->c45_ids = *c45_ids; |
178 | dev->bus = bus; | 178 | dev->bus = bus; |
179 | dev->dev.parent = bus->parent; | 179 | dev->dev.parent = &bus->dev; |
180 | dev->dev.bus = &mdio_bus_type; | 180 | dev->dev.bus = &mdio_bus_type; |
181 | dev->irq = bus->irq != NULL ? bus->irq[addr] : PHY_POLL; | 181 | dev->irq = bus->irq != NULL ? bus->irq[addr] : PHY_POLL; |
182 | dev_set_name(&dev->dev, PHY_ID_FMT, bus->id, addr); | 182 | dev_set_name(&dev->dev, PHY_ID_FMT, bus->id, addr); |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 3c86b107275a..e0498571ae26 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -778,7 +778,7 @@ int usbnet_stop (struct net_device *net) | |||
778 | { | 778 | { |
779 | struct usbnet *dev = netdev_priv(net); | 779 | struct usbnet *dev = netdev_priv(net); |
780 | struct driver_info *info = dev->driver_info; | 780 | struct driver_info *info = dev->driver_info; |
781 | int retval, pm; | 781 | int retval, pm, mpn; |
782 | 782 | ||
783 | clear_bit(EVENT_DEV_OPEN, &dev->flags); | 783 | clear_bit(EVENT_DEV_OPEN, &dev->flags); |
784 | netif_stop_queue (net); | 784 | netif_stop_queue (net); |
@@ -809,6 +809,8 @@ int usbnet_stop (struct net_device *net) | |||
809 | 809 | ||
810 | usbnet_purge_paused_rxq(dev); | 810 | usbnet_purge_paused_rxq(dev); |
811 | 811 | ||
812 | mpn = !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags); | ||
813 | |||
812 | /* deferred work (task, timer, softirq) must also stop. | 814 | /* deferred work (task, timer, softirq) must also stop. |
813 | * can't flush_scheduled_work() until we drop rtnl (later), | 815 | * can't flush_scheduled_work() until we drop rtnl (later), |
814 | * else workers could deadlock; so make workers a NOP. | 816 | * else workers could deadlock; so make workers a NOP. |
@@ -819,8 +821,7 @@ int usbnet_stop (struct net_device *net) | |||
819 | if (!pm) | 821 | if (!pm) |
820 | usb_autopm_put_interface(dev->intf); | 822 | usb_autopm_put_interface(dev->intf); |
821 | 823 | ||
822 | if (info->manage_power && | 824 | if (info->manage_power && mpn) |
823 | !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags)) | ||
824 | info->manage_power(dev, 0); | 825 | info->manage_power(dev, 0); |
825 | else | 826 | else |
826 | usb_autopm_put_interface(dev->intf); | 827 | usb_autopm_put_interface(dev->intf); |
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 34c519eb1db5..5bc4b1ed67b3 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -2216,6 +2216,8 @@ static int vxlan_open(struct net_device *dev) | |||
2216 | 2216 | ||
2217 | if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip)) { | 2217 | if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip)) { |
2218 | ret = vxlan_igmp_join(vxlan); | 2218 | ret = vxlan_igmp_join(vxlan); |
2219 | if (ret == -EADDRINUSE) | ||
2220 | ret = 0; | ||
2219 | if (ret) { | 2221 | if (ret) { |
2220 | vxlan_sock_release(vs); | 2222 | vxlan_sock_release(vs); |
2221 | return ret; | 2223 | return ret; |
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index a38d3ac0f18f..69f4f689f06a 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
@@ -361,6 +361,7 @@ static void ip6gre_tunnel_uninit(struct net_device *dev) | |||
361 | struct ip6gre_net *ign = net_generic(t->net, ip6gre_net_id); | 361 | struct ip6gre_net *ign = net_generic(t->net, ip6gre_net_id); |
362 | 362 | ||
363 | ip6gre_tunnel_unlink(ign, t); | 363 | ip6gre_tunnel_unlink(ign, t); |
364 | ip6_tnl_dst_reset(t); | ||
364 | dev_put(dev); | 365 | dev_put(dev); |
365 | } | 366 | } |
366 | 367 | ||
diff --git a/net/key/af_key.c b/net/key/af_key.c index b397f0aa9005..83a70688784b 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -219,7 +219,7 @@ static int pfkey_broadcast_one(struct sk_buff *skb, struct sk_buff **skb2, | |||
219 | #define BROADCAST_ONE 1 | 219 | #define BROADCAST_ONE 1 |
220 | #define BROADCAST_REGISTERED 2 | 220 | #define BROADCAST_REGISTERED 2 |
221 | #define BROADCAST_PROMISC_ONLY 4 | 221 | #define BROADCAST_PROMISC_ONLY 4 |
222 | static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation, | 222 | static int pfkey_broadcast(struct sk_buff *skb, |
223 | int broadcast_flags, struct sock *one_sk, | 223 | int broadcast_flags, struct sock *one_sk, |
224 | struct net *net) | 224 | struct net *net) |
225 | { | 225 | { |
@@ -244,7 +244,7 @@ static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation, | |||
244 | * socket. | 244 | * socket. |
245 | */ | 245 | */ |
246 | if (pfk->promisc) | 246 | if (pfk->promisc) |
247 | pfkey_broadcast_one(skb, &skb2, allocation, sk); | 247 | pfkey_broadcast_one(skb, &skb2, GFP_ATOMIC, sk); |
248 | 248 | ||
249 | /* the exact target will be processed later */ | 249 | /* the exact target will be processed later */ |
250 | if (sk == one_sk) | 250 | if (sk == one_sk) |
@@ -259,7 +259,7 @@ static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation, | |||
259 | continue; | 259 | continue; |
260 | } | 260 | } |
261 | 261 | ||
262 | err2 = pfkey_broadcast_one(skb, &skb2, allocation, sk); | 262 | err2 = pfkey_broadcast_one(skb, &skb2, GFP_ATOMIC, sk); |
263 | 263 | ||
264 | /* Error is cleare after succecful sending to at least one | 264 | /* Error is cleare after succecful sending to at least one |
265 | * registered KM */ | 265 | * registered KM */ |
@@ -269,7 +269,7 @@ static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation, | |||
269 | rcu_read_unlock(); | 269 | rcu_read_unlock(); |
270 | 270 | ||
271 | if (one_sk != NULL) | 271 | if (one_sk != NULL) |
272 | err = pfkey_broadcast_one(skb, &skb2, allocation, one_sk); | 272 | err = pfkey_broadcast_one(skb, &skb2, GFP_KERNEL, one_sk); |
273 | 273 | ||
274 | kfree_skb(skb2); | 274 | kfree_skb(skb2); |
275 | kfree_skb(skb); | 275 | kfree_skb(skb); |
@@ -292,7 +292,7 @@ static int pfkey_do_dump(struct pfkey_sock *pfk) | |||
292 | hdr = (struct sadb_msg *) pfk->dump.skb->data; | 292 | hdr = (struct sadb_msg *) pfk->dump.skb->data; |
293 | hdr->sadb_msg_seq = 0; | 293 | hdr->sadb_msg_seq = 0; |
294 | hdr->sadb_msg_errno = rc; | 294 | hdr->sadb_msg_errno = rc; |
295 | pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE, | 295 | pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE, |
296 | &pfk->sk, sock_net(&pfk->sk)); | 296 | &pfk->sk, sock_net(&pfk->sk)); |
297 | pfk->dump.skb = NULL; | 297 | pfk->dump.skb = NULL; |
298 | } | 298 | } |
@@ -333,7 +333,7 @@ static int pfkey_error(const struct sadb_msg *orig, int err, struct sock *sk) | |||
333 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / | 333 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / |
334 | sizeof(uint64_t)); | 334 | sizeof(uint64_t)); |
335 | 335 | ||
336 | pfkey_broadcast(skb, GFP_KERNEL, BROADCAST_ONE, sk, sock_net(sk)); | 336 | pfkey_broadcast(skb, BROADCAST_ONE, sk, sock_net(sk)); |
337 | 337 | ||
338 | return 0; | 338 | return 0; |
339 | } | 339 | } |
@@ -1365,7 +1365,7 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, const struct sadb_ | |||
1365 | 1365 | ||
1366 | xfrm_state_put(x); | 1366 | xfrm_state_put(x); |
1367 | 1367 | ||
1368 | pfkey_broadcast(resp_skb, GFP_KERNEL, BROADCAST_ONE, sk, net); | 1368 | pfkey_broadcast(resp_skb, BROADCAST_ONE, sk, net); |
1369 | 1369 | ||
1370 | return 0; | 1370 | return 0; |
1371 | } | 1371 | } |
@@ -1452,7 +1452,7 @@ static int key_notify_sa(struct xfrm_state *x, const struct km_event *c) | |||
1452 | hdr->sadb_msg_seq = c->seq; | 1452 | hdr->sadb_msg_seq = c->seq; |
1453 | hdr->sadb_msg_pid = c->portid; | 1453 | hdr->sadb_msg_pid = c->portid; |
1454 | 1454 | ||
1455 | pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xs_net(x)); | 1455 | pfkey_broadcast(skb, BROADCAST_ALL, NULL, xs_net(x)); |
1456 | 1456 | ||
1457 | return 0; | 1457 | return 0; |
1458 | } | 1458 | } |
@@ -1565,7 +1565,7 @@ static int pfkey_get(struct sock *sk, struct sk_buff *skb, const struct sadb_msg | |||
1565 | out_hdr->sadb_msg_reserved = 0; | 1565 | out_hdr->sadb_msg_reserved = 0; |
1566 | out_hdr->sadb_msg_seq = hdr->sadb_msg_seq; | 1566 | out_hdr->sadb_msg_seq = hdr->sadb_msg_seq; |
1567 | out_hdr->sadb_msg_pid = hdr->sadb_msg_pid; | 1567 | out_hdr->sadb_msg_pid = hdr->sadb_msg_pid; |
1568 | pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ONE, sk, sock_net(sk)); | 1568 | pfkey_broadcast(out_skb, BROADCAST_ONE, sk, sock_net(sk)); |
1569 | 1569 | ||
1570 | return 0; | 1570 | return 0; |
1571 | } | 1571 | } |
@@ -1670,7 +1670,7 @@ static int pfkey_register(struct sock *sk, struct sk_buff *skb, const struct sad | |||
1670 | return -ENOBUFS; | 1670 | return -ENOBUFS; |
1671 | } | 1671 | } |
1672 | 1672 | ||
1673 | pfkey_broadcast(supp_skb, GFP_KERNEL, BROADCAST_REGISTERED, sk, sock_net(sk)); | 1673 | pfkey_broadcast(supp_skb, BROADCAST_REGISTERED, sk, sock_net(sk)); |
1674 | 1674 | ||
1675 | return 0; | 1675 | return 0; |
1676 | } | 1676 | } |
@@ -1689,7 +1689,7 @@ static int unicast_flush_resp(struct sock *sk, const struct sadb_msg *ihdr) | |||
1689 | hdr->sadb_msg_errno = (uint8_t) 0; | 1689 | hdr->sadb_msg_errno = (uint8_t) 0; |
1690 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); | 1690 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); |
1691 | 1691 | ||
1692 | return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ONE, sk, sock_net(sk)); | 1692 | return pfkey_broadcast(skb, BROADCAST_ONE, sk, sock_net(sk)); |
1693 | } | 1693 | } |
1694 | 1694 | ||
1695 | static int key_notify_sa_flush(const struct km_event *c) | 1695 | static int key_notify_sa_flush(const struct km_event *c) |
@@ -1710,7 +1710,7 @@ static int key_notify_sa_flush(const struct km_event *c) | |||
1710 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); | 1710 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); |
1711 | hdr->sadb_msg_reserved = 0; | 1711 | hdr->sadb_msg_reserved = 0; |
1712 | 1712 | ||
1713 | pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net); | 1713 | pfkey_broadcast(skb, BROADCAST_ALL, NULL, c->net); |
1714 | 1714 | ||
1715 | return 0; | 1715 | return 0; |
1716 | } | 1716 | } |
@@ -1767,7 +1767,7 @@ static int dump_sa(struct xfrm_state *x, int count, void *ptr) | |||
1767 | out_hdr->sadb_msg_pid = pfk->dump.msg_portid; | 1767 | out_hdr->sadb_msg_pid = pfk->dump.msg_portid; |
1768 | 1768 | ||
1769 | if (pfk->dump.skb) | 1769 | if (pfk->dump.skb) |
1770 | pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE, | 1770 | pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE, |
1771 | &pfk->sk, sock_net(&pfk->sk)); | 1771 | &pfk->sk, sock_net(&pfk->sk)); |
1772 | pfk->dump.skb = out_skb; | 1772 | pfk->dump.skb = out_skb; |
1773 | 1773 | ||
@@ -1847,7 +1847,7 @@ static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, const struct sadb | |||
1847 | new_hdr->sadb_msg_errno = 0; | 1847 | new_hdr->sadb_msg_errno = 0; |
1848 | } | 1848 | } |
1849 | 1849 | ||
1850 | pfkey_broadcast(skb, GFP_KERNEL, BROADCAST_ALL, NULL, sock_net(sk)); | 1850 | pfkey_broadcast(skb, BROADCAST_ALL, NULL, sock_net(sk)); |
1851 | return 0; | 1851 | return 0; |
1852 | } | 1852 | } |
1853 | 1853 | ||
@@ -2181,7 +2181,7 @@ static int key_notify_policy(struct xfrm_policy *xp, int dir, const struct km_ev | |||
2181 | out_hdr->sadb_msg_errno = 0; | 2181 | out_hdr->sadb_msg_errno = 0; |
2182 | out_hdr->sadb_msg_seq = c->seq; | 2182 | out_hdr->sadb_msg_seq = c->seq; |
2183 | out_hdr->sadb_msg_pid = c->portid; | 2183 | out_hdr->sadb_msg_pid = c->portid; |
2184 | pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xp_net(xp)); | 2184 | pfkey_broadcast(out_skb, BROADCAST_ALL, NULL, xp_net(xp)); |
2185 | return 0; | 2185 | return 0; |
2186 | 2186 | ||
2187 | } | 2187 | } |
@@ -2401,7 +2401,7 @@ static int key_pol_get_resp(struct sock *sk, struct xfrm_policy *xp, const struc | |||
2401 | out_hdr->sadb_msg_errno = 0; | 2401 | out_hdr->sadb_msg_errno = 0; |
2402 | out_hdr->sadb_msg_seq = hdr->sadb_msg_seq; | 2402 | out_hdr->sadb_msg_seq = hdr->sadb_msg_seq; |
2403 | out_hdr->sadb_msg_pid = hdr->sadb_msg_pid; | 2403 | out_hdr->sadb_msg_pid = hdr->sadb_msg_pid; |
2404 | pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ONE, sk, xp_net(xp)); | 2404 | pfkey_broadcast(out_skb, BROADCAST_ONE, sk, xp_net(xp)); |
2405 | err = 0; | 2405 | err = 0; |
2406 | 2406 | ||
2407 | out: | 2407 | out: |
@@ -2655,7 +2655,7 @@ static int dump_sp(struct xfrm_policy *xp, int dir, int count, void *ptr) | |||
2655 | out_hdr->sadb_msg_pid = pfk->dump.msg_portid; | 2655 | out_hdr->sadb_msg_pid = pfk->dump.msg_portid; |
2656 | 2656 | ||
2657 | if (pfk->dump.skb) | 2657 | if (pfk->dump.skb) |
2658 | pfkey_broadcast(pfk->dump.skb, GFP_ATOMIC, BROADCAST_ONE, | 2658 | pfkey_broadcast(pfk->dump.skb, BROADCAST_ONE, |
2659 | &pfk->sk, sock_net(&pfk->sk)); | 2659 | &pfk->sk, sock_net(&pfk->sk)); |
2660 | pfk->dump.skb = out_skb; | 2660 | pfk->dump.skb = out_skb; |
2661 | 2661 | ||
@@ -2708,7 +2708,7 @@ static int key_notify_policy_flush(const struct km_event *c) | |||
2708 | hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC; | 2708 | hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC; |
2709 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); | 2709 | hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t)); |
2710 | hdr->sadb_msg_reserved = 0; | 2710 | hdr->sadb_msg_reserved = 0; |
2711 | pfkey_broadcast(skb_out, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net); | 2711 | pfkey_broadcast(skb_out, BROADCAST_ALL, NULL, c->net); |
2712 | return 0; | 2712 | return 0; |
2713 | 2713 | ||
2714 | } | 2714 | } |
@@ -2770,7 +2770,7 @@ static int pfkey_process(struct sock *sk, struct sk_buff *skb, const struct sadb | |||
2770 | void *ext_hdrs[SADB_EXT_MAX]; | 2770 | void *ext_hdrs[SADB_EXT_MAX]; |
2771 | int err; | 2771 | int err; |
2772 | 2772 | ||
2773 | pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL, | 2773 | pfkey_broadcast(skb_clone(skb, GFP_KERNEL), |
2774 | BROADCAST_PROMISC_ONLY, NULL, sock_net(sk)); | 2774 | BROADCAST_PROMISC_ONLY, NULL, sock_net(sk)); |
2775 | 2775 | ||
2776 | memset(ext_hdrs, 0, sizeof(ext_hdrs)); | 2776 | memset(ext_hdrs, 0, sizeof(ext_hdrs)); |
@@ -2992,7 +2992,7 @@ static int key_notify_sa_expire(struct xfrm_state *x, const struct km_event *c) | |||
2992 | out_hdr->sadb_msg_seq = 0; | 2992 | out_hdr->sadb_msg_seq = 0; |
2993 | out_hdr->sadb_msg_pid = 0; | 2993 | out_hdr->sadb_msg_pid = 0; |
2994 | 2994 | ||
2995 | pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL, xs_net(x)); | 2995 | pfkey_broadcast(out_skb, BROADCAST_REGISTERED, NULL, xs_net(x)); |
2996 | return 0; | 2996 | return 0; |
2997 | } | 2997 | } |
2998 | 2998 | ||
@@ -3182,7 +3182,7 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct | |||
3182 | xfrm_ctx->ctx_len); | 3182 | xfrm_ctx->ctx_len); |
3183 | } | 3183 | } |
3184 | 3184 | ||
3185 | return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL, xs_net(x)); | 3185 | return pfkey_broadcast(skb, BROADCAST_REGISTERED, NULL, xs_net(x)); |
3186 | } | 3186 | } |
3187 | 3187 | ||
3188 | static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt, | 3188 | static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt, |
@@ -3380,7 +3380,7 @@ static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, | |||
3380 | n_port->sadb_x_nat_t_port_port = sport; | 3380 | n_port->sadb_x_nat_t_port_port = sport; |
3381 | n_port->sadb_x_nat_t_port_reserved = 0; | 3381 | n_port->sadb_x_nat_t_port_reserved = 0; |
3382 | 3382 | ||
3383 | return pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_REGISTERED, NULL, xs_net(x)); | 3383 | return pfkey_broadcast(skb, BROADCAST_REGISTERED, NULL, xs_net(x)); |
3384 | } | 3384 | } |
3385 | 3385 | ||
3386 | #ifdef CONFIG_NET_KEY_MIGRATE | 3386 | #ifdef CONFIG_NET_KEY_MIGRATE |
@@ -3572,7 +3572,7 @@ static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | |||
3572 | } | 3572 | } |
3573 | 3573 | ||
3574 | /* broadcast migrate message to sockets */ | 3574 | /* broadcast migrate message to sockets */ |
3575 | pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, &init_net); | 3575 | pfkey_broadcast(skb, BROADCAST_ALL, NULL, &init_net); |
3576 | 3576 | ||
3577 | return 0; | 3577 | return 0; |
3578 | 3578 | ||
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 67d210477863..a774985489e2 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -2401,7 +2401,7 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) | |||
2401 | * sendmsg(), but that's what we've got... | 2401 | * sendmsg(), but that's what we've got... |
2402 | */ | 2402 | */ |
2403 | if (netlink_tx_is_mmaped(sk) && | 2403 | if (netlink_tx_is_mmaped(sk) && |
2404 | msg->msg_iter.type == ITER_IOVEC && | 2404 | iter_is_iovec(&msg->msg_iter) && |
2405 | msg->msg_iter.nr_segs == 1 && | 2405 | msg->msg_iter.nr_segs == 1 && |
2406 | msg->msg_iter.iov->iov_base == NULL) { | 2406 | msg->msg_iter.iov->iov_base == NULL) { |
2407 | err = netlink_mmap_sendmsg(sk, msg, dst_portid, dst_group, | 2407 | err = netlink_mmap_sendmsg(sk, msg, dst_portid, dst_group, |
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index cab9e9b43967..4fbb67430ce4 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
@@ -490,6 +490,19 @@ static bool u32_destroy(struct tcf_proto *tp, bool force) | |||
490 | return false; | 490 | return false; |
491 | } | 491 | } |
492 | } | 492 | } |
493 | |||
494 | if (tp_c->refcnt > 1) | ||
495 | return false; | ||
496 | |||
497 | if (tp_c->refcnt == 1) { | ||
498 | struct tc_u_hnode *ht; | ||
499 | |||
500 | for (ht = rtnl_dereference(tp_c->hlist); | ||
501 | ht; | ||
502 | ht = rtnl_dereference(ht->next)) | ||
503 | if (!ht_empty(ht)) | ||
504 | return false; | ||
505 | } | ||
493 | } | 506 | } |
494 | 507 | ||
495 | if (root_ht && --root_ht->refcnt == 0) | 508 | if (root_ht && --root_ht->refcnt == 0) |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 06320c8c1c86..a655ddc3f353 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -3132,11 +3132,18 @@ bool sctp_verify_asconf(const struct sctp_association *asoc, | |||
3132 | case SCTP_PARAM_IPV4_ADDRESS: | 3132 | case SCTP_PARAM_IPV4_ADDRESS: |
3133 | if (length != sizeof(sctp_ipv4addr_param_t)) | 3133 | if (length != sizeof(sctp_ipv4addr_param_t)) |
3134 | return false; | 3134 | return false; |
3135 | /* ensure there is only one addr param and it's in the | ||
3136 | * beginning of addip_hdr params, or we reject it. | ||
3137 | */ | ||
3138 | if (param.v != addip->addip_hdr.params) | ||
3139 | return false; | ||
3135 | addr_param_seen = true; | 3140 | addr_param_seen = true; |
3136 | break; | 3141 | break; |
3137 | case SCTP_PARAM_IPV6_ADDRESS: | 3142 | case SCTP_PARAM_IPV6_ADDRESS: |
3138 | if (length != sizeof(sctp_ipv6addr_param_t)) | 3143 | if (length != sizeof(sctp_ipv6addr_param_t)) |
3139 | return false; | 3144 | return false; |
3145 | if (param.v != addip->addip_hdr.params) | ||
3146 | return false; | ||
3140 | addr_param_seen = true; | 3147 | addr_param_seen = true; |
3141 | break; | 3148 | break; |
3142 | case SCTP_PARAM_ADD_IP: | 3149 | case SCTP_PARAM_ADD_IP: |
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index fef2acdf4a2e..85e6f03aeb70 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -702,7 +702,7 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds, | |||
702 | * outstanding data and rely on the retransmission limit be reached | 702 | * outstanding data and rely on the retransmission limit be reached |
703 | * to shutdown the association. | 703 | * to shutdown the association. |
704 | */ | 704 | */ |
705 | if (t->asoc->state != SCTP_STATE_SHUTDOWN_PENDING) | 705 | if (t->asoc->state < SCTP_STATE_SHUTDOWN_PENDING) |
706 | t->asoc->overall_error_count = 0; | 706 | t->asoc->overall_error_count = 0; |
707 | 707 | ||
708 | /* Clear the hb_sent flag to signal that we had a good | 708 | /* Clear the hb_sent flag to signal that we had a good |