Commit 8b92757d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] e100 deadlock fix

Revert my version of this fix and apply Scott's version, which was acked by
the e100 maintainers.

Also, initialise the spinlocks before calling e100_hw_reset(), so things don't
instantly deadlock on SMP.
Signed-off-by: default avatarScott Feldman <sfeldma@pobox.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ceaa57fe
...@@ -2204,33 +2204,38 @@ static int __devinit e100_probe(struct pci_dev *pdev, ...@@ -2204,33 +2204,38 @@ static int __devinit e100_probe(struct pci_dev *pdev,
goto err_out_disable_pdev; goto err_out_disable_pdev;
} }
nic->csr = ioremap(pci_resource_start(pdev, 0), sizeof(struct csr));
if(!nic->csr) {
DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
err = -ENOMEM;
goto err_out_free_res;
}
e100_hw_reset(nic);
pci_set_master(pdev);
if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) { if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) {
DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n"); DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n");
goto err_out_iounmap; goto err_out_free_res;
} }
SET_MODULE_OWNER(netdev); SET_MODULE_OWNER(netdev);
SET_NETDEV_DEV(netdev, &pdev->dev); SET_NETDEV_DEV(netdev, &pdev->dev);
nic->csr = ioremap(pci_resource_start(pdev, 0), sizeof(struct csr));
if(!nic->csr) {
DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
err = -ENOMEM;
goto err_out_free_res;
}
if(ent->driver_data) if(ent->driver_data)
nic->flags |= ich; nic->flags |= ich;
else else
nic->flags &= ~ich; nic->flags &= ~ich;
e100_get_defaults(nic);
spin_lock_init(&nic->cb_lock); spin_lock_init(&nic->cb_lock);
spin_lock_init(&nic->cmd_lock); spin_lock_init(&nic->cmd_lock);
/* Reset the device before pci_set_master() in case device is in some
* funky state and has an interrupt pending - hint: we don't have the
* interrupt handler registered yet. */
e100_hw_reset(nic);
pci_set_master(pdev);
init_timer(&nic->watchdog); init_timer(&nic->watchdog);
nic->watchdog.function = e100_watchdog; nic->watchdog.function = e100_watchdog;
nic->watchdog.data = (unsigned long)nic; nic->watchdog.data = (unsigned long)nic;
...@@ -2243,8 +2248,6 @@ static int __devinit e100_probe(struct pci_dev *pdev, ...@@ -2243,8 +2248,6 @@ static int __devinit e100_probe(struct pci_dev *pdev,
goto err_out_iounmap; goto err_out_iounmap;
} }
e100_get_defaults(nic);
e100_hw_reset(nic);
e100_phy_init(nic); e100_phy_init(nic);
if((err = e100_eeprom_load(nic))) if((err = e100_eeprom_load(nic)))
......
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