aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/main.c
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2007-07-12 10:50:45 -0400
committerRoland Dreier <rolandd@cisco.com>2007-07-17 21:37:42 -0400
commitee49bd9397cd2b8fe7a1962505d81c1d0a1366fc (patch)
tree064800f1ebcf6c2586f6727aa03c85e875b96289 /drivers/net/mlx4/main.c
parent41179e2de6962b46d1d9f2b4437243ac740efdec (diff)
mlx4_core: Reset device when internal error is detected
Reset the device when an internal error is detected. Also, detect errors by polling the error buffer rather than using interrupts. This is more robust and doesn't depend on MSI-X. Remove the old interrupt handler entirely, since we don't want to support two mechanisms for detecting internal errors. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4/main.c')
-rw-r--r--drivers/net/mlx4/main.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index a4f2e0475a71..e8f45e6aa95b 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -583,13 +583,11 @@ static int __devinit mlx4_setup_hca(struct mlx4_dev *dev)
583 goto err_pd_table_free; 583 goto err_pd_table_free;
584 } 584 }
585 585
586 mlx4_map_catas_buf(dev);
587
588 err = mlx4_init_eq_table(dev); 586 err = mlx4_init_eq_table(dev);
589 if (err) { 587 if (err) {
590 mlx4_err(dev, "Failed to initialize " 588 mlx4_err(dev, "Failed to initialize "
591 "event queue table, aborting.\n"); 589 "event queue table, aborting.\n");
592 goto err_catas_buf; 590 goto err_mr_table_free;
593 } 591 }
594 592
595 err = mlx4_cmd_use_events(dev); 593 err = mlx4_cmd_use_events(dev);
@@ -659,8 +657,7 @@ err_cmd_poll:
659err_eq_table_free: 657err_eq_table_free:
660 mlx4_cleanup_eq_table(dev); 658 mlx4_cleanup_eq_table(dev);
661 659
662err_catas_buf: 660err_mr_table_free:
663 mlx4_unmap_catas_buf(dev);
664 mlx4_cleanup_mr_table(dev); 661 mlx4_cleanup_mr_table(dev);
665 662
666err_pd_table_free: 663err_pd_table_free:
@@ -836,9 +833,6 @@ err_cleanup:
836 mlx4_cleanup_cq_table(dev); 833 mlx4_cleanup_cq_table(dev);
837 mlx4_cmd_use_polling(dev); 834 mlx4_cmd_use_polling(dev);
838 mlx4_cleanup_eq_table(dev); 835 mlx4_cleanup_eq_table(dev);
839
840 mlx4_unmap_catas_buf(dev);
841
842 mlx4_cleanup_mr_table(dev); 836 mlx4_cleanup_mr_table(dev);
843 mlx4_cleanup_pd_table(dev); 837 mlx4_cleanup_pd_table(dev);
844 mlx4_cleanup_uar_table(dev); 838 mlx4_cleanup_uar_table(dev);
@@ -885,9 +879,6 @@ static void __devexit mlx4_remove_one(struct pci_dev *pdev)
885 mlx4_cleanup_cq_table(dev); 879 mlx4_cleanup_cq_table(dev);
886 mlx4_cmd_use_polling(dev); 880 mlx4_cmd_use_polling(dev);
887 mlx4_cleanup_eq_table(dev); 881 mlx4_cleanup_eq_table(dev);
888
889 mlx4_unmap_catas_buf(dev);
890
891 mlx4_cleanup_mr_table(dev); 882 mlx4_cleanup_mr_table(dev);
892 mlx4_cleanup_pd_table(dev); 883 mlx4_cleanup_pd_table(dev);
893 884
@@ -908,6 +899,12 @@ static void __devexit mlx4_remove_one(struct pci_dev *pdev)
908 } 899 }
909} 900}
910 901
902int mlx4_restart_one(struct pci_dev *pdev)
903{
904 mlx4_remove_one(pdev);
905 return mlx4_init_one(pdev, NULL);
906}
907
911static struct pci_device_id mlx4_pci_table[] = { 908static struct pci_device_id mlx4_pci_table[] = {
912 { PCI_VDEVICE(MELLANOX, 0x6340) }, /* MT25408 "Hermon" SDR */ 909 { PCI_VDEVICE(MELLANOX, 0x6340) }, /* MT25408 "Hermon" SDR */
913 { PCI_VDEVICE(MELLANOX, 0x634a) }, /* MT25408 "Hermon" DDR */ 910 { PCI_VDEVICE(MELLANOX, 0x634a) }, /* MT25408 "Hermon" DDR */
@@ -930,6 +927,10 @@ static int __init mlx4_init(void)
930{ 927{
931 int ret; 928 int ret;
932 929
930 ret = mlx4_catas_init();
931 if (ret)
932 return ret;
933
933 ret = pci_register_driver(&mlx4_driver); 934 ret = pci_register_driver(&mlx4_driver);
934 return ret < 0 ? ret : 0; 935 return ret < 0 ? ret : 0;
935} 936}
@@ -937,6 +938,7 @@ static int __init mlx4_init(void)
937static void __exit mlx4_cleanup(void) 938static void __exit mlx4_cleanup(void)
938{ 939{
939 pci_unregister_driver(&mlx4_driver); 940 pci_unregister_driver(&mlx4_driver);
941 mlx4_catas_cleanup();
940} 942}
941 943
942module_init(mlx4_init); 944module_init(mlx4_init);