diff options
-rw-r--r-- | arch/powerpc/platforms/powermac/feature.c | 6 | ||||
-rw-r--r-- | drivers/net/sungem.c | 55 | ||||
-rw-r--r-- | include/net/route.h | 5 | ||||
-rw-r--r-- | net/bridge/br_if.c | 21 | ||||
-rw-r--r-- | net/bridge/br_private.h | 1 | ||||
-rw-r--r-- | net/dccp/ipv4.c | 3 | ||||
-rw-r--r-- | net/dccp/ipv6.c | 1 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 3 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 1 |
9 files changed, 51 insertions, 45 deletions
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index 2296f3d46ca8..558dd0692092 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -910,18 +910,16 @@ core99_gmac_phy_reset(struct device_node *node, long param, long value) | |||
910 | macio->type != macio_intrepid) | 910 | macio->type != macio_intrepid) |
911 | return -ENODEV; | 911 | return -ENODEV; |
912 | 912 | ||
913 | printk(KERN_DEBUG "Hard reset of PHY chip ...\n"); | ||
914 | |||
915 | LOCK(flags); | 913 | LOCK(flags); |
916 | MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE); | 914 | MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE); |
917 | (void)MACIO_IN8(KL_GPIO_ETH_PHY_RESET); | 915 | (void)MACIO_IN8(KL_GPIO_ETH_PHY_RESET); |
918 | UNLOCK(flags); | 916 | UNLOCK(flags); |
919 | msleep(10); | 917 | mdelay(10); |
920 | LOCK(flags); | 918 | LOCK(flags); |
921 | MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, /*KEYLARGO_GPIO_OUTPUT_ENABLE | */ | 919 | MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, /*KEYLARGO_GPIO_OUTPUT_ENABLE | */ |
922 | KEYLARGO_GPIO_OUTOUT_DATA); | 920 | KEYLARGO_GPIO_OUTOUT_DATA); |
923 | UNLOCK(flags); | 921 | UNLOCK(flags); |
924 | msleep(10); | 922 | mdelay(10); |
925 | 923 | ||
926 | return 0; | 924 | return 0; |
927 | } | 925 | } |
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 55f3b856236e..28ce47a02408 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -1653,40 +1653,36 @@ static void gem_init_rings(struct gem *gp) | |||
1653 | /* Init PHY interface and start link poll state machine */ | 1653 | /* Init PHY interface and start link poll state machine */ |
1654 | static void gem_init_phy(struct gem *gp) | 1654 | static void gem_init_phy(struct gem *gp) |
1655 | { | 1655 | { |
1656 | u32 mif_cfg; | 1656 | u32 mifcfg; |
1657 | 1657 | ||
1658 | /* Revert MIF CFG setting done on stop_phy */ | 1658 | /* Revert MIF CFG setting done on stop_phy */ |
1659 | mif_cfg = readl(gp->regs + MIF_CFG); | 1659 | mifcfg = readl(gp->regs + MIF_CFG); |
1660 | mif_cfg &= ~(MIF_CFG_PSELECT|MIF_CFG_POLL|MIF_CFG_BBMODE|MIF_CFG_MDI1); | 1660 | mifcfg &= ~MIF_CFG_BBMODE; |
1661 | mif_cfg |= MIF_CFG_MDI0; | 1661 | writel(mifcfg, gp->regs + MIF_CFG); |
1662 | writel(mif_cfg, gp->regs + MIF_CFG); | ||
1663 | writel(PCS_DMODE_MGM, gp->regs + PCS_DMODE); | ||
1664 | writel(MAC_XIFCFG_OE, gp->regs + MAC_XIFCFG); | ||
1665 | 1662 | ||
1666 | if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE) { | 1663 | if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE) { |
1667 | int i; | 1664 | int i; |
1668 | u16 ctrl; | ||
1669 | 1665 | ||
1666 | /* Those delay sucks, the HW seem to love them though, I'll | ||
1667 | * serisouly consider breaking some locks here to be able | ||
1668 | * to schedule instead | ||
1669 | */ | ||
1670 | for (i = 0; i < 3; i++) { | ||
1670 | #ifdef CONFIG_PPC_PMAC | 1671 | #ifdef CONFIG_PPC_PMAC |
1671 | pmac_call_feature(PMAC_FTR_GMAC_PHY_RESET, gp->of_node, 0, 0); | 1672 | pmac_call_feature(PMAC_FTR_GMAC_PHY_RESET, gp->of_node, 0, 0); |
1673 | msleep(20); | ||
1672 | #endif | 1674 | #endif |
1673 | 1675 | /* Some PHYs used by apple have problem getting back to us, | |
1674 | /* Some PHYs used by apple have problem getting back | 1676 | * we do an additional reset here |
1675 | * to us, we do an additional reset here | 1677 | */ |
1676 | */ | 1678 | phy_write(gp, MII_BMCR, BMCR_RESET); |
1677 | phy_write(gp, MII_BMCR, BMCR_RESET); | 1679 | msleep(20); |
1678 | for (i = 0; i < 50; i++) { | 1680 | if (phy_read(gp, MII_BMCR) != 0xffff) |
1679 | if ((phy_read(gp, MII_BMCR) & BMCR_RESET) == 0) | ||
1680 | break; | 1681 | break; |
1681 | msleep(10); | 1682 | if (i == 2) |
1683 | printk(KERN_WARNING "%s: GMAC PHY not responding !\n", | ||
1684 | gp->dev->name); | ||
1682 | } | 1685 | } |
1683 | if (i == 50) | ||
1684 | printk(KERN_WARNING "%s: GMAC PHY not responding !\n", | ||
1685 | gp->dev->name); | ||
1686 | /* Make sure isolate is off */ | ||
1687 | ctrl = phy_read(gp, MII_BMCR); | ||
1688 | if (ctrl & BMCR_ISOLATE) | ||
1689 | phy_write(gp, MII_BMCR, ctrl & ~BMCR_ISOLATE); | ||
1690 | } | 1686 | } |
1691 | 1687 | ||
1692 | if (gp->pdev->vendor == PCI_VENDOR_ID_SUN && | 1688 | if (gp->pdev->vendor == PCI_VENDOR_ID_SUN && |
@@ -2123,7 +2119,7 @@ static void gem_reinit_chip(struct gem *gp) | |||
2123 | /* Must be invoked with no lock held. */ | 2119 | /* Must be invoked with no lock held. */ |
2124 | static void gem_stop_phy(struct gem *gp, int wol) | 2120 | static void gem_stop_phy(struct gem *gp, int wol) |
2125 | { | 2121 | { |
2126 | u32 mif_cfg; | 2122 | u32 mifcfg; |
2127 | unsigned long flags; | 2123 | unsigned long flags; |
2128 | 2124 | ||
2129 | /* Let the chip settle down a bit, it seems that helps | 2125 | /* Let the chip settle down a bit, it seems that helps |
@@ -2134,9 +2130,9 @@ static void gem_stop_phy(struct gem *gp, int wol) | |||
2134 | /* Make sure we aren't polling PHY status change. We | 2130 | /* Make sure we aren't polling PHY status change. We |
2135 | * don't currently use that feature though | 2131 | * don't currently use that feature though |
2136 | */ | 2132 | */ |
2137 | mif_cfg = readl(gp->regs + MIF_CFG); | 2133 | mifcfg = readl(gp->regs + MIF_CFG); |
2138 | mif_cfg &= ~MIF_CFG_POLL; | 2134 | mifcfg &= ~MIF_CFG_POLL; |
2139 | writel(mif_cfg, gp->regs + MIF_CFG); | 2135 | writel(mifcfg, gp->regs + MIF_CFG); |
2140 | 2136 | ||
2141 | if (wol && gp->has_wol) { | 2137 | if (wol && gp->has_wol) { |
2142 | unsigned char *e = &gp->dev->dev_addr[0]; | 2138 | unsigned char *e = &gp->dev->dev_addr[0]; |
@@ -2186,8 +2182,7 @@ static void gem_stop_phy(struct gem *gp, int wol) | |||
2186 | /* According to Apple, we must set the MDIO pins to this begnign | 2182 | /* According to Apple, we must set the MDIO pins to this begnign |
2187 | * state or we may 1) eat more current, 2) damage some PHYs | 2183 | * state or we may 1) eat more current, 2) damage some PHYs |
2188 | */ | 2184 | */ |
2189 | mif_cfg = 0; | 2185 | writel(mifcfg | MIF_CFG_BBMODE, gp->regs + MIF_CFG); |
2190 | writel(mif_cfg | MIF_CFG_BBMODE, gp->regs + MIF_CFG); | ||
2191 | writel(0, gp->regs + MIF_BBCLK); | 2186 | writel(0, gp->regs + MIF_BBCLK); |
2192 | writel(0, gp->regs + MIF_BBDATA); | 2187 | writel(0, gp->regs + MIF_BBDATA); |
2193 | writel(0, gp->regs + MIF_BBOENAB); | 2188 | writel(0, gp->regs + MIF_BBOENAB); |
diff --git a/include/net/route.h b/include/net/route.h index e3e5436f8017..9c04f15090d2 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -170,8 +170,8 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst, | |||
170 | return ip_route_output_flow(rp, &fl, sk, 0); | 170 | return ip_route_output_flow(rp, &fl, sk, 0); |
171 | } | 171 | } |
172 | 172 | ||
173 | static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport, | 173 | static inline int ip_route_newports(struct rtable **rp, u8 protocol, |
174 | struct sock *sk) | 174 | u16 sport, u16 dport, struct sock *sk) |
175 | { | 175 | { |
176 | if (sport != (*rp)->fl.fl_ip_sport || | 176 | if (sport != (*rp)->fl.fl_ip_sport || |
177 | dport != (*rp)->fl.fl_ip_dport) { | 177 | dport != (*rp)->fl.fl_ip_dport) { |
@@ -180,6 +180,7 @@ static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport, | |||
180 | memcpy(&fl, &(*rp)->fl, sizeof(fl)); | 180 | memcpy(&fl, &(*rp)->fl, sizeof(fl)); |
181 | fl.fl_ip_sport = sport; | 181 | fl.fl_ip_sport = sport; |
182 | fl.fl_ip_dport = dport; | 182 | fl.fl_ip_dport = dport; |
183 | fl.proto = protocol; | ||
183 | ip_rt_put(*rp); | 184 | ip_rt_put(*rp); |
184 | *rp = NULL; | 185 | *rp = NULL; |
185 | return ip_route_output_flow(rp, &fl, sk, 0); | 186 | return ip_route_output_flow(rp, &fl, sk, 0); |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index ba442883e877..da687c8dc6ff 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -104,6 +104,7 @@ static void destroy_nbp(struct net_bridge_port *p) | |||
104 | { | 104 | { |
105 | struct net_device *dev = p->dev; | 105 | struct net_device *dev = p->dev; |
106 | 106 | ||
107 | dev->br_port = NULL; | ||
107 | p->br = NULL; | 108 | p->br = NULL; |
108 | p->dev = NULL; | 109 | p->dev = NULL; |
109 | dev_put(dev); | 110 | dev_put(dev); |
@@ -118,13 +119,24 @@ static void destroy_nbp_rcu(struct rcu_head *head) | |||
118 | destroy_nbp(p); | 119 | destroy_nbp(p); |
119 | } | 120 | } |
120 | 121 | ||
121 | /* called with RTNL */ | 122 | /* Delete port(interface) from bridge is done in two steps. |
123 | * via RCU. First step, marks device as down. That deletes | ||
124 | * all the timers and stops new packets from flowing through. | ||
125 | * | ||
126 | * Final cleanup doesn't occur until after all CPU's finished | ||
127 | * processing packets. | ||
128 | * | ||
129 | * Protected from multiple admin operations by RTNL mutex | ||
130 | */ | ||
122 | static void del_nbp(struct net_bridge_port *p) | 131 | static void del_nbp(struct net_bridge_port *p) |
123 | { | 132 | { |
124 | struct net_bridge *br = p->br; | 133 | struct net_bridge *br = p->br; |
125 | struct net_device *dev = p->dev; | 134 | struct net_device *dev = p->dev; |
126 | 135 | ||
127 | dev->br_port = NULL; | 136 | /* Race between RTNL notify and RCU callback */ |
137 | if (p->deleted) | ||
138 | return; | ||
139 | |||
128 | dev_set_promiscuity(dev, -1); | 140 | dev_set_promiscuity(dev, -1); |
129 | 141 | ||
130 | cancel_delayed_work(&p->carrier_check); | 142 | cancel_delayed_work(&p->carrier_check); |
@@ -132,16 +144,13 @@ static void del_nbp(struct net_bridge_port *p) | |||
132 | 144 | ||
133 | spin_lock_bh(&br->lock); | 145 | spin_lock_bh(&br->lock); |
134 | br_stp_disable_port(p); | 146 | br_stp_disable_port(p); |
147 | p->deleted = 1; | ||
135 | spin_unlock_bh(&br->lock); | 148 | spin_unlock_bh(&br->lock); |
136 | 149 | ||
137 | br_fdb_delete_by_port(br, p); | 150 | br_fdb_delete_by_port(br, p); |
138 | 151 | ||
139 | list_del_rcu(&p->list); | 152 | list_del_rcu(&p->list); |
140 | 153 | ||
141 | del_timer_sync(&p->message_age_timer); | ||
142 | del_timer_sync(&p->forward_delay_timer); | ||
143 | del_timer_sync(&p->hold_timer); | ||
144 | |||
145 | call_rcu(&p->rcu, destroy_nbp_rcu); | 154 | call_rcu(&p->rcu, destroy_nbp_rcu); |
146 | } | 155 | } |
147 | 156 | ||
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index c5bd631ffcd5..e330b17b6d81 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -68,6 +68,7 @@ struct net_bridge_port | |||
68 | /* STP */ | 68 | /* STP */ |
69 | u8 priority; | 69 | u8 priority; |
70 | u8 state; | 70 | u8 state; |
71 | u8 deleted; | ||
71 | u16 port_no; | 72 | u16 port_no; |
72 | unsigned char topology_change_ack; | 73 | unsigned char topology_change_ack; |
73 | unsigned char config_pending; | 74 | unsigned char config_pending; |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 00f983226672..dc0487b5bace 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -119,7 +119,8 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
119 | if (err != 0) | 119 | if (err != 0) |
120 | goto failure; | 120 | goto failure; |
121 | 121 | ||
122 | err = ip_route_newports(&rt, inet->sport, inet->dport, sk); | 122 | err = ip_route_newports(&rt, IPPROTO_DCCP, inet->sport, inet->dport, |
123 | sk); | ||
123 | if (err != 0) | 124 | if (err != 0) |
124 | goto failure; | 125 | goto failure; |
125 | 126 | ||
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index df074259f9c3..80c4d048869e 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -468,6 +468,7 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req, | |||
468 | done: | 468 | done: |
469 | if (opt && opt != np->opt) | 469 | if (opt && opt != np->opt) |
470 | sock_kfree_s(sk, opt, opt->tot_len); | 470 | sock_kfree_s(sk, opt, opt->tot_len); |
471 | dst_release(dst); | ||
471 | return err; | 472 | return err; |
472 | } | 473 | } |
473 | 474 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 6ea353907af5..233bdf259965 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -236,7 +236,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
236 | if (err) | 236 | if (err) |
237 | goto failure; | 237 | goto failure; |
238 | 238 | ||
239 | err = ip_route_newports(&rt, inet->sport, inet->dport, sk); | 239 | err = ip_route_newports(&rt, IPPROTO_TCP, inet->sport, inet->dport, sk); |
240 | if (err) | 240 | if (err) |
241 | goto failure; | 241 | goto failure; |
242 | 242 | ||
@@ -1845,7 +1845,6 @@ void __init tcp_v4_init(struct net_proto_family *ops) | |||
1845 | } | 1845 | } |
1846 | 1846 | ||
1847 | EXPORT_SYMBOL(ipv4_specific); | 1847 | EXPORT_SYMBOL(ipv4_specific); |
1848 | EXPORT_SYMBOL(inet_bind_bucket_create); | ||
1849 | EXPORT_SYMBOL(tcp_hashinfo); | 1848 | EXPORT_SYMBOL(tcp_hashinfo); |
1850 | EXPORT_SYMBOL(tcp_prot); | 1849 | EXPORT_SYMBOL(tcp_prot); |
1851 | EXPORT_SYMBOL(tcp_unhash); | 1850 | EXPORT_SYMBOL(tcp_unhash); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 66d04004afda..ca9cf6853755 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -515,6 +515,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req, | |||
515 | done: | 515 | done: |
516 | if (opt && opt != np->opt) | 516 | if (opt && opt != np->opt) |
517 | sock_kfree_s(sk, opt, opt->tot_len); | 517 | sock_kfree_s(sk, opt, opt->tot_len); |
518 | dst_release(dst); | ||
518 | return err; | 519 | return err; |
519 | } | 520 | } |
520 | 521 | ||