diff options
Diffstat (limited to 'drivers/xen/platform-pci.c')
| -rw-r--r-- | drivers/xen/platform-pci.c | 15 | 
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c index 99db9e1eb8b..3454973dc3b 100644 --- a/drivers/xen/platform-pci.c +++ b/drivers/xen/platform-pci.c @@ -45,7 +45,7 @@ static unsigned long platform_mmio_alloc;  static unsigned long platform_mmiolen;  static uint64_t callback_via; -unsigned long alloc_xen_mmio(unsigned long len) +static unsigned long alloc_xen_mmio(unsigned long len)  {  	unsigned long addr; @@ -84,7 +84,7 @@ static irqreturn_t do_hvm_evtchn_intr(int irq, void *dev_id)  static int xen_allocate_irq(struct pci_dev *pdev)  {  	return request_irq(pdev->irq, do_hvm_evtchn_intr, -			IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TRIGGER_RISING, +			IRQF_NOBALANCING | IRQF_TRIGGER_RISING,  			"xen-platform-pci", pdev);  } @@ -108,6 +108,7 @@ static int platform_pci_init(struct pci_dev *pdev,  	long ioaddr;  	long mmio_addr, mmio_len;  	unsigned int max_nr_gframes; +	unsigned long grant_frames;  	if (!xen_domain())  		return -ENODEV; @@ -154,13 +155,17 @@ static int platform_pci_init(struct pci_dev *pdev,  	}  	max_nr_gframes = gnttab_max_grant_frames(); -	xen_hvm_resume_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes); -	ret = gnttab_init(); +	grant_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes); +	ret = gnttab_setup_auto_xlat_frames(grant_frames);  	if (ret)  		goto out; +	ret = gnttab_init(); +	if (ret) +		goto grant_out;  	xenbus_probe(NULL);  	return 0; - +grant_out: +	gnttab_free_auto_xlat_frames();  out:  	pci_release_region(pdev, 0);  mem_out:  | 
