aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/e1000/e1000_main.c5
-rw-r--r--drivers/net/forcedeth.c15
-rw-r--r--net/bluetooth/hci_sysfs.c6
-rw-r--r--net/sched/cls_api.c23
4 files changed, 33 insertions, 16 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index b1419e21b46b..fffb006b7d95 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4027,8 +4027,9 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
4027 PCI_DMA_FROMDEVICE); 4027 PCI_DMA_FROMDEVICE);
4028 4028
4029 length = le16_to_cpu(rx_desc->length); 4029 length = le16_to_cpu(rx_desc->length);
4030 4030 /* !EOP means multiple descriptors were used to store a single
4031 if (unlikely(!(status & E1000_RXD_STAT_EOP))) { 4031 * packet, also make sure the frame isn't just CRC only */
4032 if (unlikely(!(status & E1000_RXD_STAT_EOP) || (length <= 4))) {
4032 /* All receives must fit into a single buffer */ 4033 /* All receives must fit into a single buffer */
4033 E1000_DBG("%s: Receive packet consumed multiple" 4034 E1000_DBG("%s: Receive packet consumed multiple"
4034 " buffers\n", netdev->name); 4035 " buffers\n", netdev->name);
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index f9a846b1b92f..9f6a68fb7b45 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -897,6 +897,12 @@ enum {
897}; 897};
898static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED; 898static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED;
899 899
900/*
901 * Power down phy when interface is down (persists through reboot;
902 * older Linux and other OSes may not power it up again)
903 */
904static int phy_power_down = 0;
905
900static inline struct fe_priv *get_nvpriv(struct net_device *dev) 906static inline struct fe_priv *get_nvpriv(struct net_device *dev)
901{ 907{
902 return netdev_priv(dev); 908 return netdev_priv(dev);
@@ -1485,7 +1491,10 @@ static int phy_init(struct net_device *dev)
1485 1491
1486 /* restart auto negotiation, power down phy */ 1492 /* restart auto negotiation, power down phy */
1487 mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ); 1493 mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
1488 mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN); 1494 mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
1495 if (phy_power_down) {
1496 mii_control |= BMCR_PDOWN;
1497 }
1489 if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) { 1498 if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
1490 return PHY_ERROR; 1499 return PHY_ERROR;
1491 } 1500 }
@@ -5513,7 +5522,7 @@ static int nv_close(struct net_device *dev)
5513 5522
5514 nv_drain_rxtx(dev); 5523 nv_drain_rxtx(dev);
5515 5524
5516 if (np->wolenabled) { 5525 if (np->wolenabled || !phy_power_down) {
5517 writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags); 5526 writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
5518 nv_start_rx(dev); 5527 nv_start_rx(dev);
5519 } else { 5528 } else {
@@ -6367,6 +6376,8 @@ module_param(dma_64bit, int, 0);
6367MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0."); 6376MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0.");
6368module_param(phy_cross, int, 0); 6377module_param(phy_cross, int, 0);
6369MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0."); 6378MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0.");
6379module_param(phy_power_down, int, 0);
6380MODULE_PARM_DESC(phy_power_down, "Power down phy and disable link when interface is down (1), or leave phy powered up (0).");
6370 6381
6371MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>"); 6382MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>");
6372MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver"); 6383MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver");
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 4cc3624bd22d..95f7a7a544b4 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -90,9 +90,6 @@ static void add_conn(struct work_struct *work)
90 struct hci_conn *conn = container_of(work, struct hci_conn, work_add); 90 struct hci_conn *conn = container_of(work, struct hci_conn, work_add);
91 struct hci_dev *hdev = conn->hdev; 91 struct hci_dev *hdev = conn->hdev;
92 92
93 /* ensure previous del is complete */
94 flush_work(&conn->work_del);
95
96 dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle); 93 dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);
97 94
98 if (device_add(&conn->dev) < 0) { 95 if (device_add(&conn->dev) < 0) {
@@ -118,9 +115,6 @@ static void del_conn(struct work_struct *work)
118 struct hci_conn *conn = container_of(work, struct hci_conn, work_del); 115 struct hci_conn *conn = container_of(work, struct hci_conn, work_del);
119 struct hci_dev *hdev = conn->hdev; 116 struct hci_dev *hdev = conn->hdev;
120 117
121 /* ensure previous add is complete */
122 flush_work(&conn->work_add);
123
124 if (!device_is_registered(&conn->dev)) 118 if (!device_is_registered(&conn->dev))
125 return; 119 return;
126 120
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 0759f32e9dca..09cdcdfe7e91 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -135,6 +135,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
135 unsigned long cl; 135 unsigned long cl;
136 unsigned long fh; 136 unsigned long fh;
137 int err; 137 int err;
138 int tp_created = 0;
138 139
139 if (net != &init_net) 140 if (net != &init_net)
140 return -EINVAL; 141 return -EINVAL;
@@ -266,10 +267,7 @@ replay:
266 goto errout; 267 goto errout;
267 } 268 }
268 269
269 spin_lock_bh(root_lock); 270 tp_created = 1;
270 tp->next = *back;
271 *back = tp;
272 spin_unlock_bh(root_lock);
273 271
274 } else if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], tp->ops->kind)) 272 } else if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], tp->ops->kind))
275 goto errout; 273 goto errout;
@@ -296,8 +294,11 @@ replay:
296 switch (n->nlmsg_type) { 294 switch (n->nlmsg_type) {
297 case RTM_NEWTFILTER: 295 case RTM_NEWTFILTER:
298 err = -EEXIST; 296 err = -EEXIST;
299 if (n->nlmsg_flags & NLM_F_EXCL) 297 if (n->nlmsg_flags & NLM_F_EXCL) {
298 if (tp_created)
299 tcf_destroy(tp);
300 goto errout; 300 goto errout;
301 }
301 break; 302 break;
302 case RTM_DELTFILTER: 303 case RTM_DELTFILTER:
303 err = tp->ops->delete(tp, fh); 304 err = tp->ops->delete(tp, fh);
@@ -314,8 +315,18 @@ replay:
314 } 315 }
315 316
316 err = tp->ops->change(tp, cl, t->tcm_handle, tca, &fh); 317 err = tp->ops->change(tp, cl, t->tcm_handle, tca, &fh);
317 if (err == 0) 318 if (err == 0) {
319 if (tp_created) {
320 spin_lock_bh(root_lock);
321 tp->next = *back;
322 *back = tp;
323 spin_unlock_bh(root_lock);
324 }
318 tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER); 325 tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER);
326 } else {
327 if (tp_created)
328 tcf_destroy(tp);
329 }
319 330
320errout: 331errout:
321 if (cl) 332 if (cl)