From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Mark E Mason <mark.e.mason@broadcom.com>
Cc: Martin Michlmayr <tbm@cyrius.com>, linux-mips@linux-mips.org
Subject: RE: BCM91x80A/B PCI DMA problems
Date: Tue, 14 Mar 2006 20:00:28 +0000 [thread overview]
Message-ID: <1142366428.3623.12.camel@localhost.localdomain> (raw)
In-Reply-To: <7E000E7F06B05C49BDBB769ADAF44D07868182@NT-SJCA-0750.brcm.ad.broadcom.com>
On Maw, 2006-03-14 at 08:55 -0800, Mark E Mason wrote:
> > needs fixing. The drivers don't deal with this matter beyond
> > setting their PCI DMA range mask.
>
> Thanks!
>
> I'm not that familiar with all parts of the Linux kernel. What should I
> be looking for in order to find the relevant bits in the arch-port code?
At the heart of it you need to look at the PCI DMA API.
[Documentation/DMA-mapping.txt]
Linux uses three kinds of address: virtual and physical are the usual
expected CPU view, bus is the view from the I/O side. On most platforms
physical == bus but not all.
These are mapped onto the dma_* functions of the same name for most
platforms (see include/asm-generic/pci-dma-compat.h) but need not be.
The allocators then grab memory from the right memory pool (16Mb, 32bit,
highmem ..).
For mapping of pages this isn't so simple as the page might be above the
DMA limit of a device. dma_map_* gives you the bus address of a
something relative to the device. This is arch implemented and can
return an address out of the device range.
For a block device that is misbehaving you want to check
1. That the DMA allocations done by the driver (eg the IDE PRD) are
coming in below 4GB as expected
2. Take a look then at block/ll_rw_blk.c which deals with the block
layer. Dump the calls to blk_queue_block_limit and make sure the things
it does are looking sane.
3. Take a look at what is going on in blk_rq_map_sg which deals with
mapping scatter gather lists to the device, while handling the bounce
limits. (dma_unmap_sg is the clean up end of this)
4. This lot then gets used by ide_build_sglist in drivers/ide/ide-dma.c
and the related ide_build_dmatable function. These might also be worth
dropping debug into to see what is cooking.
Alan
next prev parent reply other threads:[~2006-03-14 19:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-14 16:55 BCM91x80A/B PCI DMA problems Mark E Mason
2006-03-14 20:00 ` Alan Cox [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-03-14 22:43 Mark E Mason
2006-03-14 16:46 Mark E Mason
2006-03-14 16:21 Mark E Mason
2006-03-14 16:38 ` Martin Michlmayr
2006-03-14 2:31 Mark E Mason
2006-03-14 3:34 ` Martin Michlmayr
2006-03-14 12:14 ` Alan Cox
2006-02-28 22:15 Mark E Mason
2006-02-28 23:06 ` Alan Cox
2006-03-13 20:56 ` Martin Michlmayr
2006-02-28 21:53 Mark E Mason
2006-02-28 22:12 ` Martin Michlmayr
2006-02-28 21:46 Martin Michlmayr
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=1142366428.3623.12.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-mips@linux-mips.org \
--cc=mark.e.mason@broadcom.com \
--cc=tbm@cyrius.com \
/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