Lines Matching refs:dev

61 	struct mthca_dev *dev, *tmpdev;  in catas_reset()  local
71 list_for_each_entry_safe(dev, tmpdev, &tlist, catas_err.list) { in catas_reset()
72 struct pci_dev *pdev = dev->pdev; in catas_reset()
73 ret = __mthca_restart_one(dev->pdev); in catas_reset()
87 static void handle_catas(struct mthca_dev *dev) in handle_catas() argument
94 event.device = &dev->ib_dev; in handle_catas()
97 dev->active = false; in handle_catas()
101 switch (swab32(readl(dev->catas_err.map)) >> 24) { in handle_catas()
119 mthca_err(dev, "Catastrophic error detected: %s\n", type); in handle_catas()
120 for (i = 0; i < dev->catas_err.size; ++i) in handle_catas()
121 mthca_err(dev, " buf[%02x]: %08x\n", in handle_catas()
122 i, swab32(readl(dev->catas_err.map + i))); in handle_catas()
128 list_add(&dev->catas_err.list, &catas_list); in handle_catas()
135 struct mthca_dev *dev = from_timer(dev, t, catas_err.timer); in poll_catas() local
138 for (i = 0; i < dev->catas_err.size; ++i) in poll_catas()
139 if (readl(dev->catas_err.map + i)) { in poll_catas()
140 handle_catas(dev); in poll_catas()
144 mod_timer(&dev->catas_err.timer, in poll_catas()
148 void mthca_start_catas_poll(struct mthca_dev *dev) in mthca_start_catas_poll() argument
152 timer_setup(&dev->catas_err.timer, poll_catas, 0); in mthca_start_catas_poll()
153 dev->catas_err.map = NULL; in mthca_start_catas_poll()
155 addr = pci_resource_start(dev->pdev, 0) + in mthca_start_catas_poll()
156 ((pci_resource_len(dev->pdev, 0) - 1) & in mthca_start_catas_poll()
157 dev->catas_err.addr); in mthca_start_catas_poll()
159 dev->catas_err.map = ioremap(addr, dev->catas_err.size * 4); in mthca_start_catas_poll()
160 if (!dev->catas_err.map) { in mthca_start_catas_poll()
161 mthca_warn(dev, "couldn't map catastrophic error region " in mthca_start_catas_poll()
163 dev->catas_err.size * 4); in mthca_start_catas_poll()
167 dev->catas_err.timer.expires = jiffies + MTHCA_CATAS_POLL_INTERVAL; in mthca_start_catas_poll()
168 INIT_LIST_HEAD(&dev->catas_err.list); in mthca_start_catas_poll()
169 add_timer(&dev->catas_err.timer); in mthca_start_catas_poll()
172 void mthca_stop_catas_poll(struct mthca_dev *dev) in mthca_stop_catas_poll() argument
174 del_timer_sync(&dev->catas_err.timer); in mthca_stop_catas_poll()
176 if (dev->catas_err.map) in mthca_stop_catas_poll()
177 iounmap(dev->catas_err.map); in mthca_stop_catas_poll()
180 list_del(&dev->catas_err.list); in mthca_stop_catas_poll()