summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/xen/xen-pciback/pci_stub.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index e5ff09d8a242..843a2baffc2b 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -631,10 +631,12 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev,
631{ 631{
632 pci_ers_result_t res = result; 632 pci_ers_result_t res = result;
633 struct xen_pcie_aer_op *aer_op; 633 struct xen_pcie_aer_op *aer_op;
634 struct xen_pcibk_device *pdev = psdev->pdev;
635 struct xen_pci_sharedinfo *sh_info = pdev->sh_info;
634 int ret; 636 int ret;
635 637
636 /*with PV AER drivers*/ 638 /*with PV AER drivers*/
637 aer_op = &(psdev->pdev->sh_info->aer_op); 639 aer_op = &(sh_info->aer_op);
638 aer_op->cmd = aer_cmd ; 640 aer_op->cmd = aer_cmd ;
639 /*useful for error_detected callback*/ 641 /*useful for error_detected callback*/
640 aer_op->err = state; 642 aer_op->err = state;
@@ -655,36 +657,36 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev,
655 * this flag to judge whether we need to check pci-front give aer 657 * this flag to judge whether we need to check pci-front give aer
656 * service ack signal 658 * service ack signal
657 */ 659 */
658 set_bit(_PCIB_op_pending, (unsigned long *)&psdev->pdev->flags); 660 set_bit(_PCIB_op_pending, (unsigned long *)&pdev->flags);
659 661
660 /*It is possible that a pcifront conf_read_write ops request invokes 662 /*It is possible that a pcifront conf_read_write ops request invokes
661 * the callback which cause the spurious execution of wake_up. 663 * the callback which cause the spurious execution of wake_up.
662 * Yet it is harmless and better than a spinlock here 664 * Yet it is harmless and better than a spinlock here
663 */ 665 */
664 set_bit(_XEN_PCIB_active, 666 set_bit(_XEN_PCIB_active,
665 (unsigned long *)&psdev->pdev->sh_info->flags); 667 (unsigned long *)&sh_info->flags);
666 wmb(); 668 wmb();
667 notify_remote_via_irq(psdev->pdev->evtchn_irq); 669 notify_remote_via_irq(pdev->evtchn_irq);
668 670
669 ret = wait_event_timeout(xen_pcibk_aer_wait_queue, 671 ret = wait_event_timeout(xen_pcibk_aer_wait_queue,
670 !(test_bit(_XEN_PCIB_active, (unsigned long *) 672 !(test_bit(_XEN_PCIB_active, (unsigned long *)
671 &psdev->pdev->sh_info->flags)), 300*HZ); 673 &sh_info->flags)), 300*HZ);
672 674
673 if (!ret) { 675 if (!ret) {
674 if (test_bit(_XEN_PCIB_active, 676 if (test_bit(_XEN_PCIB_active,
675 (unsigned long *)&psdev->pdev->sh_info->flags)) { 677 (unsigned long *)&sh_info->flags)) {
676 dev_err(&psdev->dev->dev, 678 dev_err(&psdev->dev->dev,
677 "pcifront aer process not responding!\n"); 679 "pcifront aer process not responding!\n");
678 clear_bit(_XEN_PCIB_active, 680 clear_bit(_XEN_PCIB_active,
679 (unsigned long *)&psdev->pdev->sh_info->flags); 681 (unsigned long *)&sh_info->flags);
680 aer_op->err = PCI_ERS_RESULT_NONE; 682 aer_op->err = PCI_ERS_RESULT_NONE;
681 return res; 683 return res;
682 } 684 }
683 } 685 }
684 clear_bit(_PCIB_op_pending, (unsigned long *)&psdev->pdev->flags); 686 clear_bit(_PCIB_op_pending, (unsigned long *)&pdev->flags);
685 687
686 if (test_bit(_XEN_PCIF_active, 688 if (test_bit(_XEN_PCIF_active,
687 (unsigned long *)&psdev->pdev->sh_info->flags)) { 689 (unsigned long *)&sh_info->flags)) {
688 dev_dbg(&psdev->dev->dev, 690 dev_dbg(&psdev->dev->dev,
689 "schedule pci_conf service in " DRV_NAME "\n"); 691 "schedule pci_conf service in " DRV_NAME "\n");
690 xen_pcibk_test_and_schedule_op(psdev->pdev); 692 xen_pcibk_test_and_schedule_op(psdev->pdev);