]> xenbits.xensource.com Git - people/ssmith/nc2-2.6.27.bak/.git/commitdiff
__gnttab_dma_map_page can be called from a softirq (via the network
authorSteven Smith <ssmith@weybridge.uk.xensource.com>
Thu, 28 May 2009 10:54:19 +0000 (11:54 +0100)
committerSteven Smith <ssmith@weybridge.uk.xensource.com>
Thu, 28 May 2009 10:54:19 +0000 (11:54 +0100)
transmit softirq for example) therefor gnttab_copy_grant_page needs to
take gntab_dma_lock in an interrupt safe manner.

drivers/xen/core/gnttab.c

index e6b4917bbc83dc1be3142fe32c9fec70ce054372..cea08c0cef905e28b2fc169a5732ca166d18c304 100644 (file)
@@ -552,14 +552,14 @@ int gnttab_copy_grant_page(grant_ref_t ref, struct page **pagep)
        mfn = pfn_to_mfn(pfn);
        new_mfn = virt_to_mfn(new_addr);
 
-       write_seqlock(&gnttab_dma_lock);
+       write_seqlock_irq(&gnttab_dma_lock);
 
        /* Make seq visible before checking page_mapped. */
        smp_mb();
 
        /* Has the page been DMA-mapped? */
        if (unlikely(page_mapped(page))) {
-               write_sequnlock(&gnttab_dma_lock);
+               write_sequnlock_irq(&gnttab_dma_lock);
                put_page(new_page);
                err = -EBUSY;
                goto out;
@@ -576,7 +576,7 @@ int gnttab_copy_grant_page(grant_ref_t ref, struct page **pagep)
        BUG_ON(err);
        BUG_ON(unmap.status);
 
-       write_sequnlock(&gnttab_dma_lock);
+       write_sequnlock_irq(&gnttab_dma_lock);
 
        if (!xen_feature(XENFEAT_auto_translated_physmap)) {
                set_phys_to_machine(page_to_pfn(new_page), INVALID_P2M_ENTRY);