From 5e2a06489e4d4d85ca4ca20af23f213e95c2fbeb Mon Sep 17 00:00:00 2001 From: David Miller Date: Wed, 24 Oct 2007 08:44:21 +0200 Subject: SG build fix Signed-off-by: David S. Miller Signed-off-by: Jens Axboe --- arch/sparc64/kernel/iommu_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/sparc64/kernel/iommu_common.c b/arch/sparc64/kernel/iommu_common.c index b70324e0d83d..efd5dff85f60 100644 --- a/arch/sparc64/kernel/iommu_common.c +++ b/arch/sparc64/kernel/iommu_common.c @@ -234,7 +234,7 @@ unsigned long prepare_sg(struct scatterlist *sg, int nents) dma_sg->dma_length = dent_len; if (dma_sg != sg) { - dma_sg = next_sg(dma_sg); + dma_sg = sg_next(dma_sg); dma_sg->dma_length = 0; } -- cgit v1.2.3 From d91c5e8839791b27672277e81451873499bc517e Mon Sep 17 00:00:00 2001 From: David Miller Date: Wed, 24 Oct 2007 08:46:01 +0200 Subject: More SG build fixes Signed-off-by: Jens Axboe --- arch/sparc64/kernel/ldc.c | 2 +- drivers/block/sunvdc.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/sparc64/kernel/ldc.c b/arch/sparc64/kernel/ldc.c index c8313cb60f0a..217478a94128 100644 --- a/arch/sparc64/kernel/ldc.c +++ b/arch/sparc64/kernel/ldc.c @@ -2121,7 +2121,7 @@ int ldc_map_sg(struct ldc_channel *lp, state.nc = 0; for (i = 0; i < num_sg; i++) - fill_cookies(&state, page_to_pfn(sg[i].page) << PAGE_SHIFT, + fill_cookies(&state, page_to_pfn(sg_page(&sg[i])) << PAGE_SHIFT, sg[i].offset, sg[i].length); return state.nc; diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c index 7276f7d207c2..fac4c6cd04f7 100644 --- a/drivers/block/sunvdc.c +++ b/drivers/block/sunvdc.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 5a1cb47ff4c3fbc8ebdb53c3e4f2a1dec466b339 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 24 Oct 2007 08:55:40 +0200 Subject: m68k: sg fallout Signed-off-by: Geert Uytterhoeven Signed-off-by: Jens Axboe --- arch/m68k/kernel/dma.c | 2 +- drivers/scsi/atari_NCR5380.c | 5 ++--- drivers/scsi/sun3x_esp.c | 4 ++-- net/ieee80211/ieee80211_crypt_tkip.c | 2 +- net/ieee80211/ieee80211_crypt_wep.c | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) (limited to 'arch') diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c index ef490e1ce600..6f8c080dd9f9 100644 --- a/arch/m68k/kernel/dma.c +++ b/arch/m68k/kernel/dma.c @@ -9,10 +9,10 @@ #include #include #include +#include #include #include -#include void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t flag) diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index d1780980fb20..a9680b5e8ac6 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c @@ -477,10 +477,9 @@ static void merge_contiguous_buffers(Scsi_Cmnd *cmd) for (endaddr = virt_to_phys(cmd->SCp.ptr + cmd->SCp.this_residual - 1) + 1; cmd->SCp.buffers_residual && - virt_to_phys(page_address(cmd->SCp.buffer[1].page) + - cmd->SCp.buffer[1].offset) == endaddr;) { + virt_to_phys(sg_virt(&cmd->SCp.buffer[1])) == endaddr;) { MER_PRINTK("VTOP(%p) == %08lx -> merging\n", - page_address(cmd->SCp.buffer[1].page), endaddr); + page_address(sg_page(&cmd->SCp.buffer[1])), endaddr); #if (NDEBUG & NDEBUG_MERGING) ++cnt; #endif diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c index 80fb3f88af2e..1bc41907a038 100644 --- a/drivers/scsi/sun3x_esp.c +++ b/drivers/scsi/sun3x_esp.c @@ -332,8 +332,8 @@ static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp) struct scatterlist *sg = sp->SCp.buffer; while (sz >= 0) { - sg[sz].dma_address = dvma_map((unsigned long)page_address(sg[sz].page) + - sg[sz].offset, sg[sz].length); + sg[sz].dma_address = dvma_map((unsigned long)sg_virt(&sg[sz]), + sg[sz].length); sz--; } sp->SCp.ptr=(char *)((unsigned long)sp->SCp.buffer->dma_address); diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c index 811777682e2b..74d017520a23 100644 --- a/net/ieee80211/ieee80211_crypt_tkip.c +++ b/net/ieee80211/ieee80211_crypt_tkip.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include MODULE_AUTHOR("Jouni Malinen"); diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c index 9693429489ed..866fc04c44f9 100644 --- a/net/ieee80211/ieee80211_crypt_wep.c +++ b/net/ieee80211/ieee80211_crypt_wep.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include MODULE_AUTHOR("Jouni Malinen"); -- cgit v1.2.3 From 23464ffa47689e46985fb10ae9e34bbc9e83f387 Mon Sep 17 00:00:00 2001 From: WANG Cong Date: Wed, 24 Oct 2007 13:07:11 +0200 Subject: arch/um/drivers/ubd_kern.c: fix a building error Fix this uml building error: arch/um/drivers/ubd_kern.c: In function 'do_ubd_request': arch/um/drivers/ubd_kern.c:1118: error: implicit declaration of function 'sg_page' arch/um/drivers/ubd_kern.c:1118: warning: passing argument 6 of 'prepare_request' makes pointer from integer without a cast make[1]: *** [arch/um/drivers/ubd_kern.o] Error 1 make: *** [arch/um/drivers] Error 2 Signed-off-by: WANG Cong Add sg_init_table() call as well. Signed-off-by: Jens Axboe --- arch/um/drivers/ubd_kern.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch') diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 3a8cd3dfb51c..e184b44b1011 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -35,6 +35,7 @@ #include "linux/genhd.h" #include "linux/spinlock.h" #include "linux/platform_device.h" +#include "linux/scatterlist.h" #include "asm/segment.h" #include "asm/uaccess.h" #include "asm/irq.h" @@ -704,6 +705,7 @@ static int ubd_add(int n, char **error_out) ubd_dev->size = ROUND_BLOCK(ubd_dev->size); INIT_LIST_HEAD(&ubd_dev->restart); + sg_init_table(&ubd_dev->sg, MAX_SG); err = -ENOMEM; ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock); -- cgit v1.2.3 From 82861924a5f26208c8421a799a4e8724d48eb560 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Wed, 24 Oct 2007 14:09:25 +0200 Subject: blackfin: fix sg fallout Signed-off-by: Adrian Bunk Signed-off-by: Jens Axboe --- arch/blackfin/kernel/dma-mapping.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c index a16cb03c5291..d6b61d56b656 100644 --- a/arch/blackfin/kernel/dma-mapping.c +++ b/arch/blackfin/kernel/dma-mapping.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From e88a39dee10d3a506ed8c4ba78cde0dd76a6fc83 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Thu, 25 Oct 2007 09:13:32 +0200 Subject: x86: pci-gart fix map_sg could copy the last sg element to another position (if merging some elements). It breaks sg chaining. This copies only dma_address/length instead of the whole sg element. Signed-off-by: FUJITA Tomonori Signed-off-by: Jens Axboe --- arch/x86/kernel/pci-gart_64.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index c56e9ee64964..ae7e0161ce46 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c @@ -338,7 +338,6 @@ static int __dma_map_cont(struct scatterlist *start, int nelems, BUG_ON(s != start && s->offset); if (s == start) { - *sout = *s; sout->dma_address = iommu_bus_base; sout->dma_address += iommu_page*PAGE_SIZE + s->offset; sout->dma_length = s->length; @@ -365,7 +364,7 @@ static inline int dma_map_cont(struct scatterlist *start, int nelems, { if (!need) { BUG_ON(nelems != 1); - *sout = *start; + sout->dma_address = start->dma_address; sout->dma_length = start->length; return 0; } -- cgit v1.2.3