Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71240
b: refs/heads/master
c: 7df7cf0
h: refs/heads/master
v: v3
  • Loading branch information
Shannon Nelson authored and Linus Torvalds committed Oct 18, 2007
1 parent fa3e9f3 commit 5e25d36
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d8c98618f4bb8161cc0c14e110b07ba37249332b
refs/heads/master: 7df7cf0676060d778486359676734447347e1caf
23 changes: 6 additions & 17 deletions trunk/drivers/dma/ioat.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ struct ioat_device {

static int __devinit ioat_probe(struct pci_dev *pdev,
const struct pci_device_id *id);
#ifdef IOAT_DMA_REMOVE
static void __devexit ioat_remove(struct pci_dev *pdev);
#endif

static int ioat_dca_enabled = 1;
module_param(ioat_dca_enabled, int, 0644);
Expand Down Expand Up @@ -100,14 +98,12 @@ static void ioat_shutdown_functionality(struct pci_dev *pdev)

}

static struct pci_driver ioat_pci_drv = {
static struct pci_driver ioat_pci_driver = {
.name = "ioatdma",
.id_table = ioat_pci_tbl,
.probe = ioat_probe,
.shutdown = ioat_shutdown_functionality,
#ifdef IOAT_DMA_REMOVE
.remove = __devexit_p(ioat_remove),
#endif
};

static int __devinit ioat_probe(struct pci_dev *pdev,
Expand All @@ -122,7 +118,7 @@ static int __devinit ioat_probe(struct pci_dev *pdev,
if (err)
goto err_enable_device;

err = pci_request_regions(pdev, ioat_pci_drv.name);
err = pci_request_regions(pdev, ioat_pci_driver.name);
if (err)
goto err_request_regions;

Expand Down Expand Up @@ -176,13 +172,11 @@ static int __devinit ioat_probe(struct pci_dev *pdev,
return err;
}

#ifdef IOAT_DMA_REMOVE
/*
* It is unsafe to remove this module: if removed while a requested
* dma is outstanding, esp. from tcp, it is possible to hang while
* waiting for something that will never finish, thus hanging at
* least one cpu. However, if you're feeling lucky and need to do
* some testing, this usually works just fine.
* waiting for something that will never finish. However, if you're
* feeling lucky, this usually works just fine.
*/
static void __devexit ioat_remove(struct pci_dev *pdev)
{
Expand All @@ -191,21 +185,16 @@ static void __devexit ioat_remove(struct pci_dev *pdev)
ioat_shutdown_functionality(pdev);

kfree(device);

iounmap(device->iobase);
pci_release_regions(pdev);
pci_disable_device(pdev);
}
#endif

static int __init ioat_init_module(void)
{
return pci_register_driver(&ioat_pci_drv);
return pci_register_driver(&ioat_pci_driver);
}
module_init(ioat_init_module);

static void __exit ioat_exit_module(void)
{
pci_unregister_driver(&ioat_pci_drv);
pci_unregister_driver(&ioat_pci_driver);
}
module_exit(ioat_exit_module);
5 changes: 4 additions & 1 deletion trunk/drivers/dma/ioat_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,6 @@ struct ioatdma_device *ioat_dma_probe(struct pci_dev *pdev,
err_dma_pool:
kfree(device);
err_kzalloc:
iounmap(iobase);
dev_err(&device->pdev->dev,
"ioatdma: Intel(R) I/OAT DMA Engine initialization failed\n");
return NULL;
Expand All @@ -949,6 +948,10 @@ void ioat_dma_remove(struct ioatdma_device *device)
pci_pool_destroy(device->dma_pool);
pci_pool_destroy(device->completion_pool);

iounmap(device->reg_base);
pci_release_regions(device->pdev);
pci_disable_device(device->pdev);

list_for_each_entry_safe(chan, _chan,
&device->common.channels, device_node) {
ioat_chan = to_ioat_chan(chan);
Expand Down

0 comments on commit 5e25d36

Please sign in to comment.