All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD
@ 2010-05-31  6:59 FUJITA Tomonori
  2010-05-31  6:59 ` [PATCH -mm 1/3] aha1532: remove ISA_DMA_THRESHOLD usage FUJITA Tomonori
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: FUJITA Tomonori @ 2010-05-31  6:59 UTC (permalink / raw)
  To: akpm; +Cc: jens.axboe, James.Bottomley, linux-kernel, linux-arch

This patchset removes useless ISA_DMA_THRESHOLD:

- ISA_DMA_THRESHOLD is irrelevant to the majority of architectures but
  they have to define it.

- ISA_DMA_THRESHOLD definition is inconsistent on architectures; ISA
  DMA addressing restriction, DMA addressing restriction or something
  else.

- Everyone (except for SCSI) uses dma_mask instead of ancient
  ISA_DMA_THRESHOLD.

Only SCSI uses ISA_DMA_THRESHOLD for ancient drivers with non-zero
unchecked_isa_dma. We can safely remove ISA_DMA_THRESHOLD usage in
SCSI. So we can clean up ISA_DMA_THRESHOLD on the whole tree.

=
 arch/alpha/include/asm/scatterlist.h      |    2 --
 arch/avr32/include/asm/scatterlist.h      |    2 --
 arch/blackfin/include/asm/scatterlist.h   |    2 --
 arch/cris/include/asm/scatterlist.h       |    2 --
 arch/frv/include/asm/scatterlist.h        |    2 --
 arch/h8300/include/asm/scatterlist.h      |    2 --
 arch/ia64/include/asm/scatterlist.h       |    9 ---------
 arch/m32r/include/asm/scatterlist.h       |    2 --
 arch/m68k/include/asm/scatterlist.h       |    3 ---
 arch/microblaze/include/asm/scatterlist.h |    2 --
 arch/mips/include/asm/scatterlist.h       |    2 --
 arch/mn10300/include/asm/scatterlist.h    |    2 --
 arch/parisc/include/asm/scatterlist.h     |    1 -
 arch/powerpc/include/asm/scatterlist.h    |    3 ---
 arch/s390/include/asm/scatterlist.h       |    2 --
 arch/score/include/asm/scatterlist.h      |    2 --
 arch/sh/include/asm/scatterlist.h         |    2 --
 arch/sparc/include/asm/scatterlist.h      |    1 -
 arch/x86/include/asm/scatterlist.h        |    1 -
 arch/xtensa/include/asm/scatterlist.h     |    2 --
 drivers/scsi/aha1542.c                    |    9 ---------
 include/linux/blkdev.h                    |    2 +-
 22 files changed, 1 insertions(+), 56 deletions(-)




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH -mm 1/3] aha1532: remove ISA_DMA_THRESHOLD usage
  2010-05-31  6:59 [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD FUJITA Tomonori
@ 2010-05-31  6:59 ` FUJITA Tomonori
  2010-05-31  6:59 ` [PATCH -mm 2/3] block: kill " FUJITA Tomonori
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: FUJITA Tomonori @ 2010-05-31  6:59 UTC (permalink / raw)
  To: akpm
  Cc: jens.axboe, James.Bottomley, linux-kernel, linux-arch, FUJITA Tomonori

We can safely remove ISA_DMA_THRESHOLD usage in aha1532. aha1532 uses
ISA_DMA_THRESHOLD to see if:

- the buffers in scatter/list are below 16MB.
- scsi_host is below 16MB.

Both checkings were added in the ancient times but aren't necessary
nowadays since we properly bounce the buffers and allocate scsi_host
below 16MB with non-zero unchecked_isa_dma.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 drivers/scsi/aha1542.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 2a8cf13..f6175ed 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -691,8 +691,6 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 		}
 		scsi_for_each_sg(SCpnt, sg, sg_count, i) {
 			any2scsi(cptr[i].dataptr, SCSI_SG_PA(sg));
-			if (SCSI_SG_PA(sg) + sg->length - 1 > ISA_DMA_THRESHOLD)
-				BAD_SG_DMA(SCpnt, scsi_sglist(SCpnt), sg_count, i);
 			any2scsi(cptr[i].datalen, sg->length);
 		};
 		any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain));
@@ -1133,16 +1131,9 @@ static int __init aha1542_detect(struct scsi_host_template * tpnt)
 				release_region(bases[indx], 4);
 				continue;
 			}
-			/* For now we do this - until kmalloc is more intelligent
-			   we are resigned to stupid hacks like this */
-			if (SCSI_BUF_PA(shpnt) >= ISA_DMA_THRESHOLD) {
-				printk(KERN_ERR "Invalid address for shpnt with 1542.\n");
-				goto unregister;
-			}
 			if (!aha1542_test_port(bases[indx], shpnt))
 				goto unregister;
 
-
 			base_io = bases[indx];
 
 			/* Set the Bus on/off-times as not to ruin floppy performance */
-- 
1.6.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH -mm 2/3] block: kill ISA_DMA_THRESHOLD usage
  2010-05-31  6:59 [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD FUJITA Tomonori
  2010-05-31  6:59 ` [PATCH -mm 1/3] aha1532: remove ISA_DMA_THRESHOLD usage FUJITA Tomonori
@ 2010-05-31  6:59 ` FUJITA Tomonori
  2010-05-31  6:59 ` [PATCH -mm 3/3] remove needless ISA_DMA_THRESHOLD FUJITA Tomonori
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: FUJITA Tomonori @ 2010-05-31  6:59 UTC (permalink / raw)
  To: akpm
  Cc: jens.axboe, James.Bottomley, linux-kernel, linux-arch, FUJITA Tomonori

block uses ISA_DMA_THRESHOLD for BLK_BOUNCE_ISA. Only SCSI uses
ISA_DMA_THRESHOLD for ancient drivers with non-zero
unchecked_isa_dma. Nowadays drivers (and subsystems) use dma_mask
properly instead of ISA_DMA_THRESHOLD.

Documentation/scsi/scsi_mid_low_api.txt says:

unchecked_isa_dma - 1=>only use bottom 16 MB of ram (ISA DMA addressing
                   restriction), 0=>can use full 32 bit (or better) DMA
                   address space

So block simply uses DMA_BIT_MASK(24) for BLK_BOUNCE_ISA for SCSI.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 include/linux/blkdev.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 8b7f5e0..f95bdd1 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -709,7 +709,7 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn;
 #define BLK_BOUNCE_HIGH		-1ULL
 #endif
 #define BLK_BOUNCE_ANY		(-1ULL)
-#define BLK_BOUNCE_ISA		(ISA_DMA_THRESHOLD)
+#define BLK_BOUNCE_ISA		(DMA_BIT_MASK(24))
 
 /*
  * default timeout for SG_IO if none specified
-- 
1.6.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH -mm 3/3] remove needless ISA_DMA_THRESHOLD
  2010-05-31  6:59 [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD FUJITA Tomonori
  2010-05-31  6:59 ` [PATCH -mm 1/3] aha1532: remove ISA_DMA_THRESHOLD usage FUJITA Tomonori
  2010-05-31  6:59 ` [PATCH -mm 2/3] block: kill " FUJITA Tomonori
@ 2010-05-31  6:59 ` FUJITA Tomonori
  2010-06-01 18:24 ` [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD Jens Axboe
  2010-06-01 18:51 ` [PATCH -mm 3/3] remove needless ISA_DMA_THRESHOLD David Howells
  4 siblings, 0 replies; 11+ messages in thread
From: FUJITA Tomonori @ 2010-05-31  6:59 UTC (permalink / raw)
  To: akpm
  Cc: jens.axboe, James.Bottomley, linux-kernel, linux-arch, FUJITA Tomonori

Architectures don't need to define ISA_DMA_THRESHOLD anymore.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 arch/alpha/include/asm/scatterlist.h      |    2 --
 arch/avr32/include/asm/scatterlist.h      |    2 --
 arch/blackfin/include/asm/scatterlist.h   |    2 --
 arch/cris/include/asm/scatterlist.h       |    2 --
 arch/frv/include/asm/scatterlist.h        |    2 --
 arch/h8300/include/asm/scatterlist.h      |    2 --
 arch/ia64/include/asm/scatterlist.h       |    9 ---------
 arch/m32r/include/asm/scatterlist.h       |    2 --
 arch/m68k/include/asm/scatterlist.h       |    3 ---
 arch/microblaze/include/asm/scatterlist.h |    2 --
 arch/mips/include/asm/scatterlist.h       |    2 --
 arch/mn10300/include/asm/scatterlist.h    |    2 --
 arch/parisc/include/asm/scatterlist.h     |    1 -
 arch/powerpc/include/asm/scatterlist.h    |    3 ---
 arch/s390/include/asm/scatterlist.h       |    2 --
 arch/score/include/asm/scatterlist.h      |    2 --
 arch/sh/include/asm/scatterlist.h         |    2 --
 arch/sparc/include/asm/scatterlist.h      |    1 -
 arch/x86/include/asm/scatterlist.h        |    1 -
 arch/xtensa/include/asm/scatterlist.h     |    2 --
 20 files changed, 0 insertions(+), 46 deletions(-)

diff --git a/arch/alpha/include/asm/scatterlist.h b/arch/alpha/include/asm/scatterlist.h
index 5728c52..017d747 100644
--- a/arch/alpha/include/asm/scatterlist.h
+++ b/arch/alpha/include/asm/scatterlist.h
@@ -3,6 +3,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD (~0UL)
-
 #endif /* !(_ALPHA_SCATTERLIST_H) */
diff --git a/arch/avr32/include/asm/scatterlist.h b/arch/avr32/include/asm/scatterlist.h
index 06394e5..a5902d9 100644
--- a/arch/avr32/include/asm/scatterlist.h
+++ b/arch/avr32/include/asm/scatterlist.h
@@ -3,6 +3,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD (0xffffffff)
-
 #endif /* __ASM_AVR32_SCATTERLIST_H */
diff --git a/arch/blackfin/include/asm/scatterlist.h b/arch/blackfin/include/asm/scatterlist.h
index 64d41d3..d177a15 100644
--- a/arch/blackfin/include/asm/scatterlist.h
+++ b/arch/blackfin/include/asm/scatterlist.h
@@ -3,6 +3,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD	(0xffffffff)
-
 #endif				/* !(_BLACKFIN_SCATTERLIST_H) */
diff --git a/arch/cris/include/asm/scatterlist.h b/arch/cris/include/asm/scatterlist.h
index 249a784..f11f8f4 100644
--- a/arch/cris/include/asm/scatterlist.h
+++ b/arch/cris/include/asm/scatterlist.h
@@ -3,6 +3,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD (0x1fffffff)
-
 #endif /* !(__ASM_CRIS_SCATTERLIST_H) */
diff --git a/arch/frv/include/asm/scatterlist.h b/arch/frv/include/asm/scatterlist.h
index 1614bfd..0e5eb30 100644
--- a/arch/frv/include/asm/scatterlist.h
+++ b/arch/frv/include/asm/scatterlist.h
@@ -3,6 +3,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD (0xffffffffUL)
-
 #endif /* !_ASM_SCATTERLIST_H */
diff --git a/arch/h8300/include/asm/scatterlist.h b/arch/h8300/include/asm/scatterlist.h
index de08a4a..82130ed 100644
--- a/arch/h8300/include/asm/scatterlist.h
+++ b/arch/h8300/include/asm/scatterlist.h
@@ -3,6 +3,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD	(0xffffffff)
-
 #endif /* !(_H8300_SCATTERLIST_H) */
diff --git a/arch/ia64/include/asm/scatterlist.h b/arch/ia64/include/asm/scatterlist.h
index f299a4f..08fd93b 100644
--- a/arch/ia64/include/asm/scatterlist.h
+++ b/arch/ia64/include/asm/scatterlist.h
@@ -2,15 +2,6 @@
 #define _ASM_IA64_SCATTERLIST_H
 
 #include <asm-generic/scatterlist.h>
-/*
- * It used to be that ISA_DMA_THRESHOLD had something to do with the
- * DMA-limits of ISA-devices.  Nowadays, its only remaining use (apart
- * from the aha1542.c driver, which isn't 64-bit clean anyhow) is to
- * tell the block-layer (via BLK_BOUNCE_ISA) what the max. physical
- * address of a page is that is allocated with GFP_DMA.  On IA-64,
- * that's 4GB - 1.
- */
-#define ISA_DMA_THRESHOLD	0xffffffff
 #define ARCH_HAS_SG_CHAIN
 
 #endif /* _ASM_IA64_SCATTERLIST_H */
diff --git a/arch/m32r/include/asm/scatterlist.h b/arch/m32r/include/asm/scatterlist.h
index aeeddd8..7370b8b 100644
--- a/arch/m32r/include/asm/scatterlist.h
+++ b/arch/m32r/include/asm/scatterlist.h
@@ -3,6 +3,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD (0x1fffffff)
-
 #endif /* _ASM_M32R_SCATTERLIST_H */
diff --git a/arch/m68k/include/asm/scatterlist.h b/arch/m68k/include/asm/scatterlist.h
index 175da06..3125054 100644
--- a/arch/m68k/include/asm/scatterlist.h
+++ b/arch/m68k/include/asm/scatterlist.h
@@ -3,7 +3,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-/* This is bogus and should go away. */
-#define ISA_DMA_THRESHOLD (0x00ffffff)
-
 #endif /* !(_M68K_SCATTERLIST_H) */
diff --git a/arch/microblaze/include/asm/scatterlist.h b/arch/microblaze/include/asm/scatterlist.h
index dc4a890..35d786f 100644
--- a/arch/microblaze/include/asm/scatterlist.h
+++ b/arch/microblaze/include/asm/scatterlist.h
@@ -1,3 +1 @@
 #include <asm-generic/scatterlist.h>
-
-#define ISA_DMA_THRESHOLD	(~0UL)
diff --git a/arch/mips/include/asm/scatterlist.h b/arch/mips/include/asm/scatterlist.h
index 9af65e7..7ee0e64 100644
--- a/arch/mips/include/asm/scatterlist.h
+++ b/arch/mips/include/asm/scatterlist.h
@@ -3,6 +3,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD (0x00ffffffUL)
-
 #endif /* __ASM_SCATTERLIST_H */
diff --git a/arch/mn10300/include/asm/scatterlist.h b/arch/mn10300/include/asm/scatterlist.h
index 7bd00b9..7baa400 100644
--- a/arch/mn10300/include/asm/scatterlist.h
+++ b/arch/mn10300/include/asm/scatterlist.h
@@ -13,6 +13,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD (0x00ffffff)
-
 #endif /* _ASM_SCATTERLIST_H */
diff --git a/arch/parisc/include/asm/scatterlist.h b/arch/parisc/include/asm/scatterlist.h
index 2c3b79b..8bf1f0d 100644
--- a/arch/parisc/include/asm/scatterlist.h
+++ b/arch/parisc/include/asm/scatterlist.h
@@ -5,7 +5,6 @@
 #include <asm/types.h>
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD (~0UL)
 #define sg_virt_addr(sg) ((unsigned long)sg_virt(sg))
 
 #endif /* _ASM_PARISC_SCATTERLIST_H */
diff --git a/arch/powerpc/include/asm/scatterlist.h b/arch/powerpc/include/asm/scatterlist.h
index 34cc78f..de1f620 100644
--- a/arch/powerpc/include/asm/scatterlist.h
+++ b/arch/powerpc/include/asm/scatterlist.h
@@ -12,9 +12,6 @@
 #include <asm/dma.h>
 #include <asm-generic/scatterlist.h>
 
-#ifdef __powerpc64__
-#define ISA_DMA_THRESHOLD	(~0UL)
-#endif
 #define ARCH_HAS_SG_CHAIN
 
 #endif /* _ASM_POWERPC_SCATTERLIST_H */
diff --git a/arch/s390/include/asm/scatterlist.h b/arch/s390/include/asm/scatterlist.h
index be44d94..35d786f 100644
--- a/arch/s390/include/asm/scatterlist.h
+++ b/arch/s390/include/asm/scatterlist.h
@@ -1,3 +1 @@
-#define ISA_DMA_THRESHOLD	(~0UL)
-
 #include <asm-generic/scatterlist.h>
diff --git a/arch/score/include/asm/scatterlist.h b/arch/score/include/asm/scatterlist.h
index 4fa1a66..9f533b8 100644
--- a/arch/score/include/asm/scatterlist.h
+++ b/arch/score/include/asm/scatterlist.h
@@ -1,8 +1,6 @@
 #ifndef _ASM_SCORE_SCATTERLIST_H
 #define _ASM_SCORE_SCATTERLIST_H
 
-#define ISA_DMA_THRESHOLD	(~0UL)
-
 #include <asm-generic/scatterlist.h>
 
 #endif /* _ASM_SCORE_SCATTERLIST_H */
diff --git a/arch/sh/include/asm/scatterlist.h b/arch/sh/include/asm/scatterlist.h
index e38d1d4..98dfc35 100644
--- a/arch/sh/include/asm/scatterlist.h
+++ b/arch/sh/include/asm/scatterlist.h
@@ -1,8 +1,6 @@
 #ifndef __ASM_SH_SCATTERLIST_H
 #define __ASM_SH_SCATTERLIST_H
 
-#define ISA_DMA_THRESHOLD	phys_addr_mask()
-
 #include <asm-generic/scatterlist.h>
 
 #endif /* __ASM_SH_SCATTERLIST_H */
diff --git a/arch/sparc/include/asm/scatterlist.h b/arch/sparc/include/asm/scatterlist.h
index 433e45f..92bb638 100644
--- a/arch/sparc/include/asm/scatterlist.h
+++ b/arch/sparc/include/asm/scatterlist.h
@@ -3,7 +3,6 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD	(~0UL)
 #define ARCH_HAS_SG_CHAIN
 
 #endif /* !(_SPARC_SCATTERLIST_H) */
diff --git a/arch/x86/include/asm/scatterlist.h b/arch/x86/include/asm/scatterlist.h
index fb0b187..4240878 100644
--- a/arch/x86/include/asm/scatterlist.h
+++ b/arch/x86/include/asm/scatterlist.h
@@ -3,7 +3,6 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD (0x00ffffff)
 #define ARCH_HAS_SG_CHAIN
 
 #endif /* _ASM_X86_SCATTERLIST_H */
diff --git a/arch/xtensa/include/asm/scatterlist.h b/arch/xtensa/include/asm/scatterlist.h
index b1f9fdc..a0421a6 100644
--- a/arch/xtensa/include/asm/scatterlist.h
+++ b/arch/xtensa/include/asm/scatterlist.h
@@ -13,6 +13,4 @@
 
 #include <asm-generic/scatterlist.h>
 
-#define ISA_DMA_THRESHOLD (~0UL)
-
 #endif	/* _XTENSA_SCATTERLIST_H */
-- 
1.6.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD
  2010-05-31  6:59 [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD FUJITA Tomonori
                   ` (2 preceding siblings ...)
  2010-05-31  6:59 ` [PATCH -mm 3/3] remove needless ISA_DMA_THRESHOLD FUJITA Tomonori
@ 2010-06-01 18:24 ` Jens Axboe
  2010-06-01 18:34   ` James Bottomley
  2010-06-02  2:30   ` FUJITA Tomonori
  2010-06-01 18:51 ` [PATCH -mm 3/3] remove needless ISA_DMA_THRESHOLD David Howells
  4 siblings, 2 replies; 11+ messages in thread
From: Jens Axboe @ 2010-06-01 18:24 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: akpm, James.Bottomley, linux-kernel, linux-arch

On Mon, May 31 2010, FUJITA Tomonori wrote:
> This patchset removes useless ISA_DMA_THRESHOLD:
> 
> - ISA_DMA_THRESHOLD is irrelevant to the majority of architectures but
>   they have to define it.
> 
> - ISA_DMA_THRESHOLD definition is inconsistent on architectures; ISA
>   DMA addressing restriction, DMA addressing restriction or something
>   else.
> 
> - Everyone (except for SCSI) uses dma_mask instead of ancient
>   ISA_DMA_THRESHOLD.
> 
> Only SCSI uses ISA_DMA_THRESHOLD for ancient drivers with non-zero
> unchecked_isa_dma. We can safely remove ISA_DMA_THRESHOLD usage in
> SCSI. So we can clean up ISA_DMA_THRESHOLD on the whole tree.

Looks good. James, it's probably easier if I just carry this patch set.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD
  2010-06-01 18:24 ` [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD Jens Axboe
@ 2010-06-01 18:34   ` James Bottomley
  2010-06-02  2:30   ` FUJITA Tomonori
  1 sibling, 0 replies; 11+ messages in thread
From: James Bottomley @ 2010-06-01 18:34 UTC (permalink / raw)
  To: Jens Axboe; +Cc: FUJITA Tomonori, akpm, linux-kernel, linux-arch

On Tue, 2010-06-01 at 20:24 +0200, Jens Axboe wrote:
> On Mon, May 31 2010, FUJITA Tomonori wrote:
> > This patchset removes useless ISA_DMA_THRESHOLD:
> > 
> > - ISA_DMA_THRESHOLD is irrelevant to the majority of architectures but
> >   they have to define it.
> > 
> > - ISA_DMA_THRESHOLD definition is inconsistent on architectures; ISA
> >   DMA addressing restriction, DMA addressing restriction or something
> >   else.
> > 
> > - Everyone (except for SCSI) uses dma_mask instead of ancient
> >   ISA_DMA_THRESHOLD.
> > 
> > Only SCSI uses ISA_DMA_THRESHOLD for ancient drivers with non-zero
> > unchecked_isa_dma. We can safely remove ISA_DMA_THRESHOLD usage in
> > SCSI. So we can clean up ISA_DMA_THRESHOLD on the whole tree.
> 
> Looks good. James, it's probably easier if I just carry this patch set.

Sure, acked by me.

James




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH -mm 3/3] remove needless ISA_DMA_THRESHOLD
  2010-05-31  6:59 [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD FUJITA Tomonori
                   ` (3 preceding siblings ...)
  2010-06-01 18:24 ` [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD Jens Axboe
@ 2010-06-01 18:51 ` David Howells
  4 siblings, 0 replies; 11+ messages in thread
From: David Howells @ 2010-06-01 18:51 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: dhowells, akpm, jens.axboe, James.Bottomley, linux-kernel, linux-arch

FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:

> Architectures don't need to define ISA_DMA_THRESHOLD anymore.
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

Acked-by: David Howells <dhowells@redhat.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD
  2010-06-01 18:24 ` [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD Jens Axboe
  2010-06-01 18:34   ` James Bottomley
@ 2010-06-02  2:30   ` FUJITA Tomonori
  2010-06-02  6:18     ` Jens Axboe
  1 sibling, 1 reply; 11+ messages in thread
From: FUJITA Tomonori @ 2010-06-02  2:30 UTC (permalink / raw)
  To: jaxboe; +Cc: fujita.tomonori, akpm, James.Bottomley, linux-kernel, linux-arch

On Tue, 1 Jun 2010 20:24:52 +0200
Jens Axboe <jaxboe@fusionio.com> wrote:

> On Mon, May 31 2010, FUJITA Tomonori wrote:
> > This patchset removes useless ISA_DMA_THRESHOLD:
> > 
> > - ISA_DMA_THRESHOLD is irrelevant to the majority of architectures but
> >   they have to define it.
> > 
> > - ISA_DMA_THRESHOLD definition is inconsistent on architectures; ISA
> >   DMA addressing restriction, DMA addressing restriction or something
> >   else.
> > 
> > - Everyone (except for SCSI) uses dma_mask instead of ancient
> >   ISA_DMA_THRESHOLD.
> > 
> > Only SCSI uses ISA_DMA_THRESHOLD for ancient drivers with non-zero
> > unchecked_isa_dma. We can safely remove ISA_DMA_THRESHOLD usage in
> > SCSI. So we can clean up ISA_DMA_THRESHOLD on the whole tree.
> 
> Looks good. James, it's probably easier if I just carry this patch set.

Thanks,

Any tree works for me, I thought about -mm though.

Can you replace [1/3] with the following?

I fixed the subject and the body, s/aha1532/aha1542/;

Somehow I forgot to remove unused BAD_SG_DMA().

=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH 1/3] aha1542: remove ISA_DMA_THRESHOLD usage

We can safely remove ISA_DMA_THRESHOLD usage in aha1542. aha1542 uses
ISA_DMA_THRESHOLD to see if:

- the buffers in scatter/list are below 16MB.
- scsi_host is below 16MB.

Both checkings were added in the ancient times but aren't necessary
nowadays since we properly bounce the buffers and allocate scsi_host
below 16MB with non-zero unchecked_isa_dma.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 drivers/scsi/aha1542.c |   25 -------------------------
 1 files changed, 0 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 2a8cf13..4f785f2 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -52,22 +52,6 @@
 #define SCSI_BUF_PA(address)	isa_virt_to_bus(address)
 #define SCSI_SG_PA(sgent)	(isa_page_to_bus(sg_page((sgent))) + (sgent)->offset)
 
-static void BAD_SG_DMA(Scsi_Cmnd * SCpnt,
-		       struct scatterlist *sgp,
-		       int nseg,
-		       int badseg)
-{
-	printk(KERN_CRIT "sgpnt[%d:%d] page %p/0x%llx length %u\n",
-	       badseg, nseg, sg_virt(sgp),
-	       (unsigned long long)SCSI_SG_PA(sgp),
-	       sgp->length);
-
-	/*
-	 * Not safe to continue.
-	 */
-	panic("Buffer at physical address > 16Mb used for aha1542");
-}
-
 #include<linux/stat.h>
 
 #ifdef DEBUG
@@ -691,8 +675,6 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 		}
 		scsi_for_each_sg(SCpnt, sg, sg_count, i) {
 			any2scsi(cptr[i].dataptr, SCSI_SG_PA(sg));
-			if (SCSI_SG_PA(sg) + sg->length - 1 > ISA_DMA_THRESHOLD)
-				BAD_SG_DMA(SCpnt, scsi_sglist(SCpnt), sg_count, i);
 			any2scsi(cptr[i].datalen, sg->length);
 		};
 		any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain));
@@ -1133,16 +1115,9 @@ static int __init aha1542_detect(struct scsi_host_template * tpnt)
 				release_region(bases[indx], 4);
 				continue;
 			}
-			/* For now we do this - until kmalloc is more intelligent
-			   we are resigned to stupid hacks like this */
-			if (SCSI_BUF_PA(shpnt) >= ISA_DMA_THRESHOLD) {
-				printk(KERN_ERR "Invalid address for shpnt with 1542.\n");
-				goto unregister;
-			}
 			if (!aha1542_test_port(bases[indx], shpnt))
 				goto unregister;
 
-
 			base_io = bases[indx];
 
 			/* Set the Bus on/off-times as not to ruin floppy performance */
-- 
1.6.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD
  2010-06-02  2:30   ` FUJITA Tomonori
@ 2010-06-02  6:18     ` Jens Axboe
  2010-06-17 12:48       ` FUJITA Tomonori
  0 siblings, 1 reply; 11+ messages in thread
From: Jens Axboe @ 2010-06-02  6:18 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: akpm, James.Bottomley, linux-kernel, linux-arch

On Tue, Jun 01 2010, FUJITA Tomonori wrote:
> On Tue, 1 Jun 2010 20:24:52 +0200
> Jens Axboe <jaxboe@fusionio.com> wrote:
> 
> > On Mon, May 31 2010, FUJITA Tomonori wrote:
> > > This patchset removes useless ISA_DMA_THRESHOLD:
> > > 
> > > - ISA_DMA_THRESHOLD is irrelevant to the majority of architectures but
> > >   they have to define it.
> > > 
> > > - ISA_DMA_THRESHOLD definition is inconsistent on architectures; ISA
> > >   DMA addressing restriction, DMA addressing restriction or something
> > >   else.
> > > 
> > > - Everyone (except for SCSI) uses dma_mask instead of ancient
> > >   ISA_DMA_THRESHOLD.
> > > 
> > > Only SCSI uses ISA_DMA_THRESHOLD for ancient drivers with non-zero
> > > unchecked_isa_dma. We can safely remove ISA_DMA_THRESHOLD usage in
> > > SCSI. So we can clean up ISA_DMA_THRESHOLD on the whole tree.
> > 
> > Looks good. James, it's probably easier if I just carry this patch set.
> 
> Thanks,
> 
> Any tree works for me, I thought about -mm though.
> 
> Can you replace [1/3] with the following?
> 
> I fixed the subject and the body, s/aha1532/aha1542/;
> 
> Somehow I forgot to remove unused BAD_SG_DMA().

I'll collect the acks and include this update.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD
  2010-06-02  6:18     ` Jens Axboe
@ 2010-06-17 12:48       ` FUJITA Tomonori
  2010-06-17 12:59         ` Jens Axboe
  0 siblings, 1 reply; 11+ messages in thread
From: FUJITA Tomonori @ 2010-06-17 12:48 UTC (permalink / raw)
  To: jaxboe; +Cc: fujita.tomonori, akpm, James.Bottomley, linux-kernel, linux-arch

On Wed, 2 Jun 2010 08:18:15 +0200
Jens Axboe <jaxboe@fusionio.com> wrote:

> On Tue, Jun 01 2010, FUJITA Tomonori wrote:
> > On Tue, 1 Jun 2010 20:24:52 +0200
> > Jens Axboe <jaxboe@fusionio.com> wrote:
> > 
> > > On Mon, May 31 2010, FUJITA Tomonori wrote:
> > > > This patchset removes useless ISA_DMA_THRESHOLD:
> > > > 
> > > > - ISA_DMA_THRESHOLD is irrelevant to the majority of architectures but
> > > >   they have to define it.
> > > > 
> > > > - ISA_DMA_THRESHOLD definition is inconsistent on architectures; ISA
> > > >   DMA addressing restriction, DMA addressing restriction or something
> > > >   else.
> > > > 
> > > > - Everyone (except for SCSI) uses dma_mask instead of ancient
> > > >   ISA_DMA_THRESHOLD.
> > > > 
> > > > Only SCSI uses ISA_DMA_THRESHOLD for ancient drivers with non-zero
> > > > unchecked_isa_dma. We can safely remove ISA_DMA_THRESHOLD usage in
> > > > SCSI. So we can clean up ISA_DMA_THRESHOLD on the whole tree.
> > > 
> > > Looks good. James, it's probably easier if I just carry this patch set.
> > 
> > Thanks,
> > 
> > Any tree works for me, I thought about -mm though.
> > 
> > Can you replace [1/3] with the following?
> > 
> > I fixed the subject and the body, s/aha1532/aha1542/;
> > 
> > Somehow I forgot to remove unused BAD_SG_DMA().
> 
> I'll collect the acks and include this update.

Can you send this to -next via your tree? I want this to be
compile-tested on -next on various architectures.

Thanks,

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD
  2010-06-17 12:48       ` FUJITA Tomonori
@ 2010-06-17 12:59         ` Jens Axboe
  0 siblings, 0 replies; 11+ messages in thread
From: Jens Axboe @ 2010-06-17 12:59 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: akpm, James.Bottomley, linux-kernel, linux-arch

On 2010-06-17 14:48, FUJITA Tomonori wrote:
> On Wed, 2 Jun 2010 08:18:15 +0200
> Jens Axboe <jaxboe@fusionio.com> wrote:
> 
>> On Tue, Jun 01 2010, FUJITA Tomonori wrote:
>>> On Tue, 1 Jun 2010 20:24:52 +0200
>>> Jens Axboe <jaxboe@fusionio.com> wrote:
>>>
>>>> On Mon, May 31 2010, FUJITA Tomonori wrote:
>>>>> This patchset removes useless ISA_DMA_THRESHOLD:
>>>>>
>>>>> - ISA_DMA_THRESHOLD is irrelevant to the majority of architectures but
>>>>>   they have to define it.
>>>>>
>>>>> - ISA_DMA_THRESHOLD definition is inconsistent on architectures; ISA
>>>>>   DMA addressing restriction, DMA addressing restriction or something
>>>>>   else.
>>>>>
>>>>> - Everyone (except for SCSI) uses dma_mask instead of ancient
>>>>>   ISA_DMA_THRESHOLD.
>>>>>
>>>>> Only SCSI uses ISA_DMA_THRESHOLD for ancient drivers with non-zero
>>>>> unchecked_isa_dma. We can safely remove ISA_DMA_THRESHOLD usage in
>>>>> SCSI. So we can clean up ISA_DMA_THRESHOLD on the whole tree.
>>>>
>>>> Looks good. James, it's probably easier if I just carry this patch set.
>>>
>>> Thanks,
>>>
>>> Any tree works for me, I thought about -mm though.
>>>
>>> Can you replace [1/3] with the following?
>>>
>>> I fixed the subject and the body, s/aha1532/aha1542/;
>>>
>>> Somehow I forgot to remove unused BAD_SG_DMA().
>>
>> I'll collect the acks and include this update.
> 
> Can you send this to -next via your tree? I want this to be
> compile-tested on -next on various architectures.

Yep, going out now.


-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-06-17 12:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-31  6:59 [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD FUJITA Tomonori
2010-05-31  6:59 ` [PATCH -mm 1/3] aha1532: remove ISA_DMA_THRESHOLD usage FUJITA Tomonori
2010-05-31  6:59 ` [PATCH -mm 2/3] block: kill " FUJITA Tomonori
2010-05-31  6:59 ` [PATCH -mm 3/3] remove needless ISA_DMA_THRESHOLD FUJITA Tomonori
2010-06-01 18:24 ` [PATCH -mm 0/3] remove useless ISA_DMA_THRESHOLD Jens Axboe
2010-06-01 18:34   ` James Bottomley
2010-06-02  2:30   ` FUJITA Tomonori
2010-06-02  6:18     ` Jens Axboe
2010-06-17 12:48       ` FUJITA Tomonori
2010-06-17 12:59         ` Jens Axboe
2010-06-01 18:51 ` [PATCH -mm 3/3] remove needless ISA_DMA_THRESHOLD David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.