Lines Matching +full:out +full:- +full:of +full:- +full:reset
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
8 * COPYING in the main directory of this source tree, or the
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
44 void __iomem *reset; in mlx4_reset() local
65 * Reset the chip. This is somewhat ugly because we have to in mlx4_reset()
66 * save off the PCI header before reset and then restore it in mlx4_reset()
74 err = -ENOMEM; in mlx4_reset()
76 goto out; in mlx4_reset()
79 pcie_cap = pci_pcie_cap(dev->persist->pdev); in mlx4_reset()
84 if (pci_read_config_dword(dev->persist->pdev, i * 4, in mlx4_reset()
86 err = -ENODEV; in mlx4_reset()
88 goto out; in mlx4_reset()
92 reset = ioremap(pci_resource_start(dev->persist->pdev, 0) + in mlx4_reset()
95 if (!reset) { in mlx4_reset()
96 err = -ENOMEM; in mlx4_reset()
97 mlx4_err(dev, "Couldn't map HCA reset register, aborting\n"); in mlx4_reset()
98 goto out; in mlx4_reset()
101 /* grab HW semaphore to lock out flash updates */ in mlx4_reset()
104 sem = readl(reset + MLX4_SEM_OFFSET); in mlx4_reset()
113 err = -EAGAIN; in mlx4_reset()
114 iounmap(reset); in mlx4_reset()
115 goto out; in mlx4_reset()
118 /* actually hit reset */ in mlx4_reset()
119 writel(MLX4_RESET_VALUE, reset + MLX4_RESET_OFFSET); in mlx4_reset()
120 iounmap(reset); in mlx4_reset()
127 if (!pci_read_config_word(dev->persist->pdev, PCI_VENDOR_ID, in mlx4_reset()
135 err = -ENODEV; in mlx4_reset()
136 mlx4_err(dev, "PCI device did not come back after reset, aborting\n"); in mlx4_reset()
137 goto out; in mlx4_reset()
143 if (pcie_capability_write_word(dev->persist->pdev, in mlx4_reset()
146 err = -ENODEV; in mlx4_reset()
148 goto out; in mlx4_reset()
151 if (pcie_capability_write_word(dev->persist->pdev, in mlx4_reset()
154 err = -ENODEV; in mlx4_reset()
156 goto out; in mlx4_reset()
164 if (pci_write_config_dword(dev->persist->pdev, i * 4, in mlx4_reset()
166 err = -ENODEV; in mlx4_reset()
169 goto out; in mlx4_reset()
173 if (pci_write_config_dword(dev->persist->pdev, PCI_COMMAND, in mlx4_reset()
175 err = -ENODEV; in mlx4_reset()
177 goto out; in mlx4_reset()
180 out: in mlx4_reset()