pci.c (c81545f991a6612d3bdab18a71b3487023ec6b69) | pci.c (d09f2b45f346f0a9e5e1b5fcea531b1b393671dc) |
---|---|
1/* 2 * NVM Express device driver 3 * Copyright (c) 2011-2014, Intel Corporation. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms and conditions of the GNU General Public License, 7 * version 2, as published by the Free Software Foundation. 8 * --- 2121 unchanged lines hidden (view full) --- 2130 if (dev->ctrl.hmpre) 2131 nvme_setup_host_mem(dev); 2132 2133 result = nvme_setup_io_queues(dev); 2134 if (result) 2135 goto out; 2136 2137 /* | 1/* 2 * NVM Express device driver 3 * Copyright (c) 2011-2014, Intel Corporation. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms and conditions of the GNU General Public License, 7 * version 2, as published by the Free Software Foundation. 8 * --- 2121 unchanged lines hidden (view full) --- 2130 if (dev->ctrl.hmpre) 2131 nvme_setup_host_mem(dev); 2132 2133 result = nvme_setup_io_queues(dev); 2134 if (result) 2135 goto out; 2136 2137 /* |
2138 * A controller that can not execute IO typically requires user 2139 * intervention to correct. For such degraded controllers, the driver 2140 * should not submit commands the user did not request, so skip 2141 * registering for asynchronous event notification on this condition. 2142 */ 2143 if (dev->online_queues > 1) 2144 nvme_queue_async_events(&dev->ctrl); 2145 2146 /* | |
2147 * Keep the controller around but remove all namespaces if we don't have 2148 * any working I/O queue. 2149 */ 2150 if (dev->online_queues < 2) { 2151 dev_warn(dev->ctrl.device, "IO queues not created\n"); 2152 nvme_kill_queues(&dev->ctrl); 2153 nvme_remove_namespaces(&dev->ctrl); 2154 } else { 2155 nvme_start_queues(&dev->ctrl); 2156 nvme_wait_freeze(&dev->ctrl); 2157 nvme_dev_add(dev); 2158 nvme_unfreeze(&dev->ctrl); 2159 } 2160 2161 if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_LIVE)) { 2162 dev_warn(dev->ctrl.device, "failed to mark controller live\n"); 2163 goto out; 2164 } 2165 | 2138 * Keep the controller around but remove all namespaces if we don't have 2139 * any working I/O queue. 2140 */ 2141 if (dev->online_queues < 2) { 2142 dev_warn(dev->ctrl.device, "IO queues not created\n"); 2143 nvme_kill_queues(&dev->ctrl); 2144 nvme_remove_namespaces(&dev->ctrl); 2145 } else { 2146 nvme_start_queues(&dev->ctrl); 2147 nvme_wait_freeze(&dev->ctrl); 2148 nvme_dev_add(dev); 2149 nvme_unfreeze(&dev->ctrl); 2150 } 2151 2152 if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_LIVE)) { 2153 dev_warn(dev->ctrl.device, "failed to mark controller live\n"); 2154 goto out; 2155 } 2156 |
2166 if (dev->online_queues > 1) 2167 nvme_queue_scan(&dev->ctrl); | 2157 nvme_start_ctrl(&dev->ctrl); |
2168 return; 2169 2170 out: 2171 nvme_remove_dead_ctrl(dev, result); 2172} 2173 2174static void nvme_remove_dead_ctrl_work(struct work_struct *work) 2175{ --- 160 unchanged lines hidden (view full) --- 2336 pci_set_drvdata(pdev, NULL); 2337 2338 if (!pci_device_is_present(pdev)) { 2339 nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DEAD); 2340 nvme_dev_disable(dev, false); 2341 } 2342 2343 flush_work(&dev->ctrl.reset_work); | 2158 return; 2159 2160 out: 2161 nvme_remove_dead_ctrl(dev, result); 2162} 2163 2164static void nvme_remove_dead_ctrl_work(struct work_struct *work) 2165{ --- 160 unchanged lines hidden (view full) --- 2326 pci_set_drvdata(pdev, NULL); 2327 2328 if (!pci_device_is_present(pdev)) { 2329 nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DEAD); 2330 nvme_dev_disable(dev, false); 2331 } 2332 2333 flush_work(&dev->ctrl.reset_work); |
2344 nvme_uninit_ctrl(&dev->ctrl); | 2334 nvme_stop_ctrl(&dev->ctrl); 2335 nvme_remove_namespaces(&dev->ctrl); |
2345 nvme_dev_disable(dev, true); 2346 nvme_free_host_mem(dev); 2347 nvme_dev_remove_admin(dev); 2348 nvme_free_queues(dev, 0); | 2336 nvme_dev_disable(dev, true); 2337 nvme_free_host_mem(dev); 2338 nvme_dev_remove_admin(dev); 2339 nvme_free_queues(dev, 0); |
2340 nvme_uninit_ctrl(&dev->ctrl); |
|
2349 nvme_release_prp_pools(dev); 2350 nvme_dev_unmap(dev); 2351 nvme_put_ctrl(&dev->ctrl); 2352} 2353 2354static int nvme_pci_sriov_configure(struct pci_dev *pdev, int numvfs) 2355{ 2356 int ret = 0; --- 143 unchanged lines hidden --- | 2341 nvme_release_prp_pools(dev); 2342 nvme_dev_unmap(dev); 2343 nvme_put_ctrl(&dev->ctrl); 2344} 2345 2346static int nvme_pci_sriov_configure(struct pci_dev *pdev, int numvfs) 2347{ 2348 int ret = 0; --- 143 unchanged lines hidden --- |