linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -mm 1/2] 53c700: remove dma_is_consistent usage
@ 2010-07-22 11:40 FUJITA Tomonori
  2010-07-22 11:40 ` FUJITA Tomonori
  2010-07-22 11:40 ` [PATCH -mm 2/2] remove dma_is_consistent API FUJITA Tomonori
  0 siblings, 2 replies; 5+ messages in thread
From: FUJITA Tomonori @ 2010-07-22 11:40 UTC (permalink / raw)
  To: akpm; +Cc: JBottomley, linux-arch, linux-kernel, fujita.tomonori

This driver is the only user of dma_is_consistent(). We plan to remove
this API.

The driver uses the API in the following way:

BUG_ON(!dma_is_consistent(hostdata->dev, pScript) && L1_CACHE_BYTES < dma_get_cache_alignment());

The above code tries to see if L1_CACHE_BYTES is greater than
dma_get_cache_alignment() on sysmtes that can not allocate coherent
memory (some old systems can't).

James Bottomley exmplained that this is necesary because the driver
packs the set of mailboxes into a single coherent area and separates
the different usages by a L1 cache stride. So it's fatal if the dma
coherence stride is greater than the L1 cache size.

He also pointed out that we can kill this checking because we don't
hit this BUG_ON on all architectures that actually use the driver.

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

diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index 80dc3ac..89fc1c8 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -309,9 +309,6 @@ NCR_700_detect(struct scsi_host_template *tpnt,
 	hostdata->msgin = memory + MSGIN_OFFSET;
 	hostdata->msgout = memory + MSGOUT_OFFSET;
 	hostdata->status = memory + STATUS_OFFSET;
-	/* all of these offsets are L1_CACHE_BYTES separated.  It is fatal
-	 * if this isn't sufficient separation to avoid dma flushing issues */
-	BUG_ON(!dma_is_consistent(hostdata->dev, pScript) && L1_CACHE_BYTES < dma_get_cache_alignment());
 	hostdata->slots = (struct NCR_700_command_slot *)(memory + SLOTS_OFFSET);
 	hostdata->dev = dev;
 
-- 
1.6.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH -mm 1/2] scsi: remove dma_is_consistent usage in 53c700
@ 2010-06-27 10:10 FUJITA Tomonori
  2010-06-27 10:10 ` [PATCH -mm 2/2] remove dma_is_consistent() API FUJITA Tomonori
  0 siblings, 1 reply; 5+ messages in thread
From: FUJITA Tomonori @ 2010-06-27 10:10 UTC (permalink / raw)
  To: akpm
  Cc: grundler, lethal, JBottomley, linux-kernel, linux-arch,
	fujita.tomonori

53c700 is the only user of dma_is_consistent():

BUG_ON(!dma_is_consistent(hostdata->dev, pScript) && L1_CACHE_BYTES < dma_get_cache_alignment());

The above code tries to see if the system can allocate coherent memory
or not. It's for some old systems that can't allocate coherent memory
at all (e.g some parisc systems).

I think that we can safely remove the above usage:

- such old systems haven't triger the above checking for long.

- the above condition is important for systems that can't allocate
  coherent memory if these systems do DMA. So probably it would be
  better to have such checking in arch's DMA initialization code
  instead of a driver.

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

diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index 80dc3ac..89fc1c8 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -309,9 +309,6 @@ NCR_700_detect(struct scsi_host_template *tpnt,
 	hostdata->msgin = memory + MSGIN_OFFSET;
 	hostdata->msgout = memory + MSGOUT_OFFSET;
 	hostdata->status = memory + STATUS_OFFSET;
-	/* all of these offsets are L1_CACHE_BYTES separated.  It is fatal
-	 * if this isn't sufficient separation to avoid dma flushing issues */
-	BUG_ON(!dma_is_consistent(hostdata->dev, pScript) && L1_CACHE_BYTES < dma_get_cache_alignment());
 	hostdata->slots = (struct NCR_700_command_slot *)(memory + SLOTS_OFFSET);
 	hostdata->dev = dev;
 
-- 
1.6.5

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

end of thread, other threads:[~2010-07-23 16:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-22 11:40 [PATCH -mm 1/2] 53c700: remove dma_is_consistent usage FUJITA Tomonori
2010-07-22 11:40 ` FUJITA Tomonori
2010-07-22 11:40 ` [PATCH -mm 2/2] remove dma_is_consistent API FUJITA Tomonori
2010-07-23 16:18   ` Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2010-06-27 10:10 [PATCH -mm 1/2] scsi: remove dma_is_consistent usage in 53c700 FUJITA Tomonori
2010-06-27 10:10 ` [PATCH -mm 2/2] remove dma_is_consistent() API FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).