virt_to_page/pci_map_page vs. pci_map_single

From: Jamie Wellnitz (Jamie.Wellnitz_at_emulex.com)
Date: 11/02/03

  • Next message: Jose Luis Domingo Lopez: "Re: Bkbits down?"
    Date:	Sun, 2 Nov 2003 13:12:24 -0500
    To: linux-kernel@vger.kernel.org
    
    

    I see code similar to the following in a few drivers (qlogicfc,
    sym53c8xx, acenic does something similar):

    page = virt_to_page(buffer);
    offset = ((unsigned long)buffer & ~PAGE_MASK);
    busaddr = pci_map_page(pci_dev, page, offset, len, direction);

    How is this preferable to:

    pci_map_single( pci_dev, buffer, len, direction);

    ?

    pci_map_single can't handle highmem pages (because they don't have a
    kernel virtual address) but doesn't virt_to_page suffer from the same
    limitation? Is there some benefit on architectures that don't have
    highmem?

    Thanks,
    Jamie Wellnitz
    Jamie.Wellnitz@emulex.com
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Jose Luis Domingo Lopez: "Re: Bkbits down?"

    Relevant Pages

    • [PATCH] Wrong assumption in set_bh_page()
      ... This assumption is wrong - the highmem page could be ... offset for a highmem page, but this is a bug waiting to happen. ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [BK PATCHES] ide-2.6 update
      ... The first 'grep' line of the patch is found at an offset of about +180 ... What src tree is this to be applied to? ... Copyright 2004 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] anobjrmap 1/6 objrmap
      ... > Unable to handle kernel NULL pointer dereference at virtual address 00000003 ... I can't see any dereference at 0x3 offset either, ... explicit regparm, old compiler miscompiles regparm. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Linux v2.6.14-rc4
      ... lib/iomap.c versions assume that PIO space needs different low-level ... primitives for access and can be shifted outside of iomem space. ... There we have ioport_mapadd offset to port number and io... ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: cryptoapi highmem bug
      ... > someone noticed strange corruptions with dm-crypt and highmem. ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)