pci.c (b12994fbfe9362e3b5ed9f360d3cd6fb34d6645a) | pci.c (6f7f0b3df6d49316c6f27390bb5ec250255be548) |
---|---|
1/* 2 * Copyright 2014 IBM Corp. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 */ --- 787 unchanged lines hidden (view full) --- 796 goto err_put1; 797 798 799 if ((rc = cxl_afu_select_best_mode(afu))) 800 goto err_put2; 801 802 adapter->afu[afu->slice] = afu; 803 | 1/* 2 * Copyright 2014 IBM Corp. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 */ --- 787 unchanged lines hidden (view full) --- 796 goto err_put1; 797 798 799 if ((rc = cxl_afu_select_best_mode(afu))) 800 goto err_put2; 801 802 adapter->afu[afu->slice] = afu; 803 |
804 if ((rc = cxl_pci_vphb_add(afu))) 805 dev_info(&afu->dev, "Can't register vPHB\n"); 806 |
|
804 return 0; 805 806err_put2: 807 cxl_sysfs_afu_remove(afu); 808err_put1: 809 device_unregister(&afu->dev); 810 free = false; 811 cxl_debugfs_afu_remove(afu); --- 36 unchanged lines hidden (view full) --- 848{ 849 struct pci_dev *dev = to_pci_dev(adapter->dev.parent); 850 int rc; 851 int i; 852 u32 val; 853 854 dev_info(&dev->dev, "CXL reset\n"); 855 | 807 return 0; 808 809err_put2: 810 cxl_sysfs_afu_remove(afu); 811err_put1: 812 device_unregister(&afu->dev); 813 free = false; 814 cxl_debugfs_afu_remove(afu); --- 36 unchanged lines hidden (view full) --- 851{ 852 struct pci_dev *dev = to_pci_dev(adapter->dev.parent); 853 int rc; 854 int i; 855 u32 val; 856 857 dev_info(&dev->dev, "CXL reset\n"); 858 |
856 for (i = 0; i < adapter->slices; i++) | 859 for (i = 0; i < adapter->slices; i++) { 860 cxl_pci_vphb_remove(adapter->afu[i]); |
857 cxl_remove_afu(adapter->afu[i]); | 861 cxl_remove_afu(adapter->afu[i]); |
862 } |
|
858 859 /* pcie_warm_reset requests a fundamental pci reset which includes a 860 * PERST assert/deassert. PERST triggers a loading of the image 861 * if "user" or "factory" is selected in sysfs */ 862 if ((rc = pci_set_pcie_reset_state(dev, pcie_warm_reset))) { 863 dev_err(&dev->dev, "cxl: pcie_warm_reset failed\n"); 864 return rc; 865 } --- 292 unchanged lines hidden (view full) --- 1158 } 1159 1160 return 0; 1161} 1162 1163static void cxl_remove(struct pci_dev *dev) 1164{ 1165 struct cxl *adapter = pci_get_drvdata(dev); | 863 864 /* pcie_warm_reset requests a fundamental pci reset which includes a 865 * PERST assert/deassert. PERST triggers a loading of the image 866 * if "user" or "factory" is selected in sysfs */ 867 if ((rc = pci_set_pcie_reset_state(dev, pcie_warm_reset))) { 868 dev_err(&dev->dev, "cxl: pcie_warm_reset failed\n"); 869 return rc; 870 } --- 292 unchanged lines hidden (view full) --- 1163 } 1164 1165 return 0; 1166} 1167 1168static void cxl_remove(struct pci_dev *dev) 1169{ 1170 struct cxl *adapter = pci_get_drvdata(dev); |
1166 int afu; | 1171 struct cxl_afu *afu; 1172 int i; |
1167 1168 /* 1169 * Lock to prevent someone grabbing a ref through the adapter list as 1170 * we are removing it 1171 */ | 1173 1174 /* 1175 * Lock to prevent someone grabbing a ref through the adapter list as 1176 * we are removing it 1177 */ |
1172 for (afu = 0; afu < adapter->slices; afu++) 1173 cxl_remove_afu(adapter->afu[afu]); | 1178 for (i = 0; i < adapter->slices; i++) { 1179 afu = adapter->afu[i]; 1180 cxl_pci_vphb_remove(afu); 1181 cxl_remove_afu(afu); 1182 } |
1174 cxl_remove_adapter(adapter); 1175} 1176 1177struct pci_driver cxl_pci_driver = { 1178 .name = "cxl-pci", 1179 .id_table = cxl_pci_tbl, 1180 .probe = cxl_probe, 1181 .remove = cxl_remove, 1182 .shutdown = cxl_remove, 1183}; | 1183 cxl_remove_adapter(adapter); 1184} 1185 1186struct pci_driver cxl_pci_driver = { 1187 .name = "cxl-pci", 1188 .id_table = cxl_pci_tbl, 1189 .probe = cxl_probe, 1190 .remove = cxl_remove, 1191 .shutdown = cxl_remove, 1192}; |