Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69450bb5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'sg' of git://git.kernel.dk/linux-2.6-block:
  Add CONFIG_DEBUG_SG sg validation
  Change table chaining layout
  Update arch/ to use sg helpers
  Update swiotlb to use sg helpers
  Update net/ to use sg helpers
  Update fs/ to use sg helpers
  [SG] Update drivers to use sg helpers
  [SG] Update crypto/ to sg helpers
  [SG] Update block layer to use sg helpers
  [SG] Add helpers for manipulating SG entries
parents e38f9817 d6ec0842
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -465,7 +465,7 @@ EXPORT_SYMBOL(pci_free_consistent);
   Write dma_length of each leader with the combined lengths of
   Write dma_length of each leader with the combined lengths of
   the mergable followers.  */
   the mergable followers.  */


#define SG_ENT_VIRT_ADDRESS(SG) (page_address((SG)->page) + (SG)->offset)
#define SG_ENT_VIRT_ADDRESS(SG) (sg_virt((SG)))
#define SG_ENT_PHYS_ADDRESS(SG) __pa(SG_ENT_VIRT_ADDRESS(SG))
#define SG_ENT_PHYS_ADDRESS(SG) __pa(SG_ENT_VIRT_ADDRESS(SG))


static void
static void
+1 −1
Original line number Original line Diff line number Diff line
@@ -442,7 +442,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
	BUG_ON(dir == DMA_NONE);
	BUG_ON(dir == DMA_NONE);


	for (i = 0; i < nents; i++, sg++) {
	for (i = 0; i < nents; i++, sg++) {
		struct page *page = sg->page;
		struct page *page = sg_page(sg);
		unsigned int offset = sg->offset;
		unsigned int offset = sg->offset;
		unsigned int length = sg->length;
		unsigned int length = sg->length;
		void *ptr = page_address(page) + offset;
		void *ptr = page_address(page) + offset;
+1 −2
Original line number Original line Diff line number Diff line
@@ -160,8 +160,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
	BUG_ON(direction == DMA_NONE);
	BUG_ON(direction == DMA_NONE);


	for (i = 0; i < nents; i++, sg++) {
	for (i = 0; i < nents; i++, sg++) {
		sg->dma_address = (dma_addr_t)(page_address(sg->page) +
		sg->dma_address = (dma_addr_t) sg_virt(sg);
					sg->offset);


		invalidate_dcache_range(sg_dma_address(sg),
		invalidate_dcache_range(sg_dma_address(sg),
					sg_dma_address(sg) +
					sg_dma_address(sg) +
+1 −1
Original line number Original line Diff line number Diff line
@@ -246,7 +246,7 @@ static int reserve_sba_gart = 1;
static SBA_INLINE void sba_mark_invalid(struct ioc *, dma_addr_t, size_t);
static SBA_INLINE void sba_mark_invalid(struct ioc *, dma_addr_t, size_t);
static SBA_INLINE void sba_free_range(struct ioc *, dma_addr_t, size_t);
static SBA_INLINE void sba_free_range(struct ioc *, dma_addr_t, size_t);


#define sba_sg_address(sg)	(page_address((sg)->page) + (sg)->offset)
#define sba_sg_address(sg)	sg_virt((sg))


#ifdef FULL_VALID_PDIR
#ifdef FULL_VALID_PDIR
static u64 prefetch_spill_page;
static u64 prefetch_spill_page;
+2 −2
Original line number Original line Diff line number Diff line
@@ -131,7 +131,7 @@ simscsi_sg_readwrite (struct scsi_cmnd *sc, int mode, unsigned long offset)
	stat.fd = desc[sc->device->id];
	stat.fd = desc[sc->device->id];


	scsi_for_each_sg(sc, sl, scsi_sg_count(sc), i) {
	scsi_for_each_sg(sc, sl, scsi_sg_count(sc), i) {
		req.addr = __pa(page_address(sl->page) + sl->offset);
		req.addr = __pa(sg_virt(sl));
		req.len  = sl->length;
		req.len  = sl->length;
		if (DBG)
		if (DBG)
			printk("simscsi_sg_%s @ %lx (off %lx) use_sg=%d len=%d\n",
			printk("simscsi_sg_%s @ %lx (off %lx) use_sg=%d len=%d\n",
@@ -212,7 +212,7 @@ static void simscsi_fillresult(struct scsi_cmnd *sc, char *buf, unsigned len)
		if (!len)
		if (!len)
			break;
			break;
		thislen = min(len, slp->length);
		thislen = min(len, slp->length);
		memcpy(page_address(slp->page) + slp->offset, buf, thislen);
		memcpy(sg_virt(slp), buf, thislen);
		len -= thislen;
		len -= thislen;
	}
	}
}
}
Loading