Lines Matching +full:out +full:- +full:of +full:- +full:reset

4  * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
7 * COPYING in the main directory of this source tree, or the
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
63 * Reset the chip. This is somewhat ugly because we have to in mthca_reset()
64 * save off the PCI header before reset and then restore it in mthca_reset()
68 * To make matters worse, for Tavor (PCI-X HCA) we have to in mthca_reset()
73 if (!(mdev->mthca_flags & MTHCA_FLAG_PCIE)) { in mthca_reset()
74 /* Look for the bridge -- its device ID will be 2 more in mthca_reset()
77 while ((bridge = pci_get_device(mdev->pdev->vendor, in mthca_reset()
78 mdev->pdev->device + 2, in mthca_reset()
80 if (bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE && in mthca_reset()
81 bridge->subordinate == mdev->pdev->bus) { in mthca_reset()
90 * Didn't find a bridge for a Tavor device -- in mthca_reset()
91 * assume we're in no-bridge mode and hope for in mthca_reset()
95 pci_name(mdev->pdev)); in mthca_reset()
98 mthca_warn(mdev, "Reset on PCI-X is not supported.\n"); in mthca_reset()
99 goto out; in mthca_reset()
107 err = -ENOMEM; in mthca_reset()
110 goto out; in mthca_reset()
116 if (pci_read_config_dword(mdev->pdev, i * 4, hca_header + i)) { in mthca_reset()
117 err = -ENODEV; in mthca_reset()
120 goto out; in mthca_reset()
124 hca_pcix_cap = pci_find_capability(mdev->pdev, PCI_CAP_ID_PCIX); in mthca_reset()
125 hca_pcie_cap = pci_find_capability(mdev->pdev, PCI_CAP_ID_EXP); in mthca_reset()
131 err = -ENOMEM; in mthca_reset()
134 goto out; in mthca_reset()
141 err = -ENODEV; in mthca_reset()
144 goto out; in mthca_reset()
149 err = -ENODEV; in mthca_reset()
151 "PCI-X capability, aborting.\n"); in mthca_reset()
152 goto out; in mthca_reset()
157 /* actually hit reset */ in mthca_reset()
159 void __iomem *reset = ioremap(pci_resource_start(mdev->pdev, 0) + in mthca_reset() local
162 if (!reset) { in mthca_reset()
163 err = -ENOMEM; in mthca_reset()
164 mthca_err(mdev, "Couldn't map HCA reset register, " in mthca_reset()
166 goto out; in mthca_reset()
169 writel(MTHCA_RESET_VALUE, reset); in mthca_reset()
170 iounmap(reset); in mthca_reset()
182 if (pci_read_config_dword(bridge ? bridge : mdev->pdev, 0, &v)) { in mthca_reset()
183 err = -ENODEV; in mthca_reset()
184 mthca_err(mdev, "Couldn't access HCA after reset, " in mthca_reset()
186 goto out; in mthca_reset()
195 err = -ENODEV; in mthca_reset()
196 mthca_err(mdev, "PCI device did not come back after reset, " in mthca_reset()
198 goto out; in mthca_reset()
207 err = -ENODEV; in mthca_reset()
210 goto out; in mthca_reset()
214 err = -ENODEV; in mthca_reset()
217 goto out; in mthca_reset()
228 err = -ENODEV; in mthca_reset()
231 goto out; in mthca_reset()
237 err = -ENODEV; in mthca_reset()
240 goto out; in mthca_reset()
246 if (pci_write_config_dword(mdev->pdev, hca_pcix_cap, in mthca_reset()
248 err = -ENODEV; in mthca_reset()
249 mthca_err(mdev, "Couldn't restore HCA PCI-X " in mthca_reset()
251 goto out; in mthca_reset()
257 if (pci_write_config_word(mdev->pdev, hca_pcie_cap + PCI_EXP_DEVCTL, in mthca_reset()
259 err = -ENODEV; in mthca_reset()
262 goto out; in mthca_reset()
265 if (pci_write_config_word(mdev->pdev, hca_pcie_cap + PCI_EXP_LNKCTL, in mthca_reset()
267 err = -ENODEV; in mthca_reset()
270 goto out; in mthca_reset()
278 if (pci_write_config_dword(mdev->pdev, i * 4, hca_header[i])) { in mthca_reset()
279 err = -ENODEV; in mthca_reset()
282 goto out; in mthca_reset()
286 if (pci_write_config_dword(mdev->pdev, PCI_COMMAND, in mthca_reset()
288 err = -ENODEV; in mthca_reset()
291 goto out; in mthca_reset()
294 out: in mthca_reset()