Commit e3c0ac04 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  PHY: Add the phy_device_release device method.
  gianfar: fix compile warning
  pasemi_mac: Fix reuse of free'd skb
  SMC911X: Fix using of dereferenced skb after netif_rx
  sky2: recovery deadlock fix
  Fix memory corruption in fec_mpc52xx
  Don't claim to do IPv6 checksum offload
  cxgb - revert file mode changes.
parents 943547ab 6f4a7f41
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
...@@ -422,7 +422,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id) ...@@ -422,7 +422,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
rskb = bcom_retrieve_buffer(priv->rx_dmatsk, &status, rskb = bcom_retrieve_buffer(priv->rx_dmatsk, &status,
(struct bcom_bd **)&bd); (struct bcom_bd **)&bd);
dma_unmap_single(&dev->dev, bd->skb_pa, skb->len, DMA_FROM_DEVICE); dma_unmap_single(&dev->dev, bd->skb_pa, rskb->len, DMA_FROM_DEVICE);
/* Test for errors in received frame */ /* Test for errors in received frame */
if (status & BCOM_FEC_RX_BD_ERRORS) { if (status & BCOM_FEC_RX_BD_ERRORS) {
...@@ -467,7 +467,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id) ...@@ -467,7 +467,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
bcom_prepare_next_buffer(priv->rx_dmatsk); bcom_prepare_next_buffer(priv->rx_dmatsk);
bd->status = FEC_RX_BUFFER_SIZE; bd->status = FEC_RX_BUFFER_SIZE;
bd->skb_pa = dma_map_single(&dev->dev, rskb->data, bd->skb_pa = dma_map_single(&dev->dev, skb->data,
FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE); FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
bcom_submit_next_buffer(priv->rx_dmatsk, skb); bcom_submit_next_buffer(priv->rx_dmatsk, skb);
......
...@@ -696,7 +696,7 @@ int startup_gfar(struct net_device *dev) ...@@ -696,7 +696,7 @@ int startup_gfar(struct net_device *dev)
{ {
struct txbd8 *txbdp; struct txbd8 *txbdp;
struct rxbd8 *rxbdp; struct rxbd8 *rxbdp;
dma_addr_t addr; dma_addr_t addr = 0;
unsigned long vaddr; unsigned long vaddr;
int i; int i;
struct gfar_private *priv = netdev_priv(dev); struct gfar_private *priv = netdev_priv(dev);
......
...@@ -586,7 +586,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) ...@@ -586,7 +586,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
/* CRC error flagged */ /* CRC error flagged */
mac->netdev->stats.rx_errors++; mac->netdev->stats.rx_errors++;
mac->netdev->stats.rx_crc_errors++; mac->netdev->stats.rx_crc_errors++;
dev_kfree_skb_irq(skb); /* No need to free skb, it'll be reused */
goto next; goto next;
} }
...@@ -1362,7 +1362,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1362,7 +1362,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netif_napi_add(dev, &mac->napi, pasemi_mac_poll, 64); netif_napi_add(dev, &mac->napi, pasemi_mac_poll, 64);
dev->features = NETIF_F_HW_CSUM | NETIF_F_LLTX | NETIF_F_SG; dev->features = NETIF_F_IP_CSUM | NETIF_F_LLTX | NETIF_F_SG;
/* These should come out of the device tree eventually */ /* These should come out of the device tree eventually */
mac->dma_txch = index; mac->dma_txch = index;
......
...@@ -91,9 +91,12 @@ int mdiobus_register(struct mii_bus *bus) ...@@ -91,9 +91,12 @@ int mdiobus_register(struct mii_bus *bus)
err = device_register(&phydev->dev); err = device_register(&phydev->dev);
if (err) if (err) {
printk(KERN_ERR "phy %d failed to register\n", printk(KERN_ERR "phy %d failed to register\n",
i); i);
phy_device_free(phydev);
phydev = NULL;
}
} }
bus->phy_map[i] = phydev; bus->phy_map[i] = phydev;
...@@ -110,10 +113,8 @@ void mdiobus_unregister(struct mii_bus *bus) ...@@ -110,10 +113,8 @@ void mdiobus_unregister(struct mii_bus *bus)
int i; int i;
for (i = 0; i < PHY_MAX_ADDR; i++) { for (i = 0; i < PHY_MAX_ADDR; i++) {
if (bus->phy_map[i]) { if (bus->phy_map[i])
device_unregister(&bus->phy_map[i]->dev); device_unregister(&bus->phy_map[i]->dev);
kfree(bus->phy_map[i]);
}
} }
} }
EXPORT_SYMBOL(mdiobus_unregister); EXPORT_SYMBOL(mdiobus_unregister);
......
...@@ -44,6 +44,16 @@ static struct phy_driver genphy_driver; ...@@ -44,6 +44,16 @@ static struct phy_driver genphy_driver;
extern int mdio_bus_init(void); extern int mdio_bus_init(void);
extern void mdio_bus_exit(void); extern void mdio_bus_exit(void);
void phy_device_free(struct phy_device *phydev)
{
kfree(phydev);
}
static void phy_device_release(struct device *dev)
{
phy_device_free(to_phy_device(dev));
}
struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id) struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
{ {
struct phy_device *dev; struct phy_device *dev;
...@@ -54,6 +64,8 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id) ...@@ -54,6 +64,8 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
if (NULL == dev) if (NULL == dev)
return (struct phy_device*) PTR_ERR((void*)-ENOMEM); return (struct phy_device*) PTR_ERR((void*)-ENOMEM);
dev->dev.release = phy_device_release;
dev->speed = 0; dev->speed = 0;
dev->duplex = -1; dev->duplex = -1;
dev->pause = dev->asym_pause = 0; dev->pause = dev->asym_pause = 0;
......
...@@ -2906,16 +2906,14 @@ static void sky2_restart(struct work_struct *work) ...@@ -2906,16 +2906,14 @@ static void sky2_restart(struct work_struct *work)
int i, err; int i, err;
rtnl_lock(); rtnl_lock();
sky2_write32(hw, B0_IMSK, 0);
sky2_read32(hw, B0_IMSK);
napi_disable(&hw->napi);
for (i = 0; i < hw->ports; i++) { for (i = 0; i < hw->ports; i++) {
dev = hw->dev[i]; dev = hw->dev[i];
if (netif_running(dev)) if (netif_running(dev))
sky2_down(dev); sky2_down(dev);
} }
napi_disable(&hw->napi);
sky2_write32(hw, B0_IMSK, 0);
sky2_reset(hw); sky2_reset(hw);
sky2_write32(hw, B0_IMSK, Y2_IS_BASE); sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
napi_enable(&hw->napi); napi_enable(&hw->napi);
......
...@@ -1299,9 +1299,9 @@ smc911x_rx_dma_irq(int dma, void *data) ...@@ -1299,9 +1299,9 @@ smc911x_rx_dma_irq(int dma, void *data)
PRINT_PKT(skb->data, skb->len); PRINT_PKT(skb->data, skb->len);
dev->last_rx = jiffies; dev->last_rx = jiffies;
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb);
dev->stats.rx_packets++; dev->stats.rx_packets++;
dev->stats.rx_bytes += skb->len; dev->stats.rx_bytes += skb->len;
netif_rx(skb);
spin_lock_irqsave(&lp->lock, flags); spin_lock_irqsave(&lp->lock, flags);
pkts = (SMC_GET_RX_FIFO_INF() & RX_FIFO_INF_RXSUSED_) >> 16; pkts = (SMC_GET_RX_FIFO_INF() & RX_FIFO_INF_RXSUSED_) >> 16;
......
...@@ -403,6 +403,7 @@ int phy_mii_ioctl(struct phy_device *phydev, ...@@ -403,6 +403,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
int phy_start_interrupts(struct phy_device *phydev); int phy_start_interrupts(struct phy_device *phydev);
void phy_print_status(struct phy_device *phydev); void phy_print_status(struct phy_device *phydev);
struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id); struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id);
void phy_device_free(struct phy_device *phydev);
extern struct bus_type mdio_bus_type; extern struct bus_type mdio_bus_type;
#endif /* __PHY_H */ #endif /* __PHY_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment