public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: linux-kernel@vger.kernel.org
Cc: James.Bottomley@HansenPartnership.com
Subject: Question about using the kernel dma_cache_...() defines in asm/io.h
Date: Tue, 31 Jul 2001 12:37:24 -0500	[thread overview]
Message-ID: <200107311737.MAA01378@jet.il.steeleye.com> (raw)

I'm currently writing a SCSI device driver that can be used on multiple 
platforms, some of which don't preserve DMA cache coherency like the x86 does.

I know the basics of how to use the dma_cache_wback(), dma_cache_inv() and 
dma_cache_wback_inv() functions, however the question has come up about what I 
should do in the edge cases where the memory I want the device to write to 
shares a cache line with some other kernel data that I don't control.  Since 
some CPU chip architectures only support cache control bits per cache line 
rather than per byte, if I invalidate my range of data I could potentially 
cause the destruction of cached but unflushed data sharing the cache line.

I suspect that it is the intention of these cache coherency functions to 
operate without regard for neighbouring data, and that this could be enforced 
on architectures like the above by restricting the minimum kernel memory 
allocation alignment to be the cache line width.

Could the designer of these functions step forward and confirm how they are 
supposed to be used?

Thanks,

James Bottomley



                 reply	other threads:[~2001-07-31 17:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200107311737.MAA01378@jet.il.steeleye.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox