Lines 203-209
static void pcie_pme_handle_request(struct pci_dev *port, u16 req_id)
Link Here
|
203 |
|
203 |
|
204 |
out: |
204 |
out: |
205 |
if (!found) |
205 |
if (!found) |
206 |
pci_info(port, "Spurious native interrupt!\n"); |
206 |
pci_info(port, "Spurious native interrupt from device %02x:%02x.%d!\n", |
|
|
207 |
busnr, PCI_SLOT(devfn), PCI_FUNC(devfn)); |
207 |
} |
208 |
} |
208 |
|
209 |
|
209 |
/** |
210 |
/** |
Lines 215-221
static void pcie_pme_work_fn(struct work_struct *work)
Link Here
|
215 |
struct pcie_pme_service_data *data = |
216 |
struct pcie_pme_service_data *data = |
216 |
container_of(work, struct pcie_pme_service_data, work); |
217 |
container_of(work, struct pcie_pme_service_data, work); |
217 |
struct pci_dev *port = data->srv->port; |
218 |
struct pci_dev *port = data->srv->port; |
|
|
219 |
int count = 0; |
218 |
u32 rtsta; |
220 |
u32 rtsta; |
|
|
221 |
int ret; |
219 |
|
222 |
|
220 |
spin_lock_irq(&data->lock); |
223 |
spin_lock_irq(&data->lock); |
221 |
|
224 |
|
Lines 223-229
static void pcie_pme_work_fn(struct work_struct *work)
Link Here
|
223 |
if (data->noirq) |
226 |
if (data->noirq) |
224 |
break; |
227 |
break; |
225 |
|
228 |
|
226 |
pcie_capability_read_dword(port, PCI_EXP_RTSTA, &rtsta); |
229 |
if (count++ > 5000) { |
|
|
230 |
dev_info(&port->dev, "breaking out of PME polling loop\n"); |
231 |
break; |
232 |
} |
233 |
|
234 |
ret = pcie_capability_read_dword(port, PCI_EXP_RTSTA, &rtsta); |
235 |
dev_info(&port->dev, "ret=%d, rtsta=0x%08x\n", ret, rtsta); |
227 |
if (rtsta == (u32) ~0) |
236 |
if (rtsta == (u32) ~0) |
228 |
break; |
237 |
break; |
229 |
|
238 |
|
Lines 233-238
static void pcie_pme_work_fn(struct work_struct *work)
Link Here
|
233 |
* pending PMEs, the status will be set again. |
242 |
* pending PMEs, the status will be set again. |
234 |
*/ |
243 |
*/ |
235 |
pcie_clear_root_pme_status(port); |
244 |
pcie_clear_root_pme_status(port); |
|
|
245 |
ret = pcie_capability_read_dword(port, PCI_EXP_RTSTA, &rtsta); |
246 |
dev_info(&port->dev, "after clearing: ret=%d, rtsta=0x%08x\n", ret, rtsta); |
236 |
|
247 |
|
237 |
spin_unlock_irq(&data->lock); |
248 |
spin_unlock_irq(&data->lock); |
238 |
pcie_pme_handle_request(port, rtsta & 0xffff); |
249 |
pcie_pme_handle_request(port, rtsta & 0xffff); |
Lines 386-391
static int pcie_pme_suspend(struct pcie_device *srv)
Link Here
|
386 |
bool wakeup; |
397 |
bool wakeup; |
387 |
int ret; |
398 |
int ret; |
388 |
|
399 |
|
|
|
400 |
dev_info(&srv->port->dev, "PME suspend\n"); |
401 |
|
389 |
if (device_may_wakeup(&port->dev)) { |
402 |
if (device_may_wakeup(&port->dev)) { |
390 |
wakeup = true; |
403 |
wakeup = true; |
391 |
} else { |
404 |
} else { |
Lines 414-419
static int pcie_pme_resume(struct pcie_device *srv)
Link Here
|
414 |
{ |
427 |
{ |
415 |
struct pcie_pme_service_data *data = get_service_data(srv); |
428 |
struct pcie_pme_service_data *data = get_service_data(srv); |
416 |
|
429 |
|
|
|
430 |
dev_info(&srv->port->dev, "PME resume\n"); |
431 |
|
417 |
spin_lock_irq(&data->lock); |
432 |
spin_lock_irq(&data->lock); |
418 |
if (data->noirq) { |
433 |
if (data->noirq) { |
419 |
struct pci_dev *port = srv->port; |
434 |
struct pci_dev *port = srv->port; |