From: James Bottomley <James.Bottomley@SteelEye.com>
To: Douglas Gilbert <dougg@torque.net>
Cc: Nishanth Aravamudan <nacc@us.ibm.com>,
SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: scsi_debug issues
Date: 16 Oct 2004 08:12:43 -0500 [thread overview]
Message-ID: <1097932370.1962.4.camel@mulgrave> (raw)
In-Reply-To: <4170C505.3000805@torque.net>
On Sat, 2004-10-16 at 01:51, Douglas Gilbert wrote:
> So this problem seems related to highmem.
>
> The attachment is against the current scsi_debug driver
> (at least in lk 2.6.9-rc4). It uses dma_map_sg() and friends
> together with phys_to_virt() which comes highly recommended:
> "in almost all conceivable cases a device driver should not be
> using this function" :-) Could you try the patch.
>
> Perhaps others my be able to answer this: is setting
> scsi_host_template::dma_boundary (to some figure other
> than 0xffffffff) going to help in this case?
No, the problem is with highmem as you correctly point out, but the
issue is that your driver cannot see beyond it. On x86, highmem begins
at about 900Mb. The kernel has no page tables for any memory beyond
this. In order to see the memory you need to kmap it (i.e. ask the
kernel to create a temporary page table for it); so the virtual address
sg uses should be got by kmapping the pages in the sg list:
kaddr = kmap(sg[i].page) + sg[i].offset
If you make sure clustering is disabled, you should never get multiple
pages in the initial sg list.
When you've finished you need to release the mapping with kunmap().
There are also atomic versions of these depending on where you are.
James
next prev parent reply other threads:[~2004-10-16 13:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-15 19:01 scsi_debug issues Nishanth Aravamudan
2004-10-16 6:51 ` Douglas Gilbert
2004-10-16 10:50 ` Christoph Hellwig
2004-10-16 13:12 ` James Bottomley [this message]
2004-10-18 13:44 ` [PATCH] scsi_debug [was: scsi_debug issues] Douglas Gilbert
2004-10-18 18:37 ` Nishanth Aravamudan
2004-10-18 22:05 ` Douglas Gilbert
2004-10-18 23:23 ` Nishanth Aravamudan
2004-10-19 6:57 ` Douglas Gilbert
2004-10-21 21:36 ` Nishanth Aravamudan
2004-10-22 10:04 ` Jens Axboe
2004-10-22 10:02 ` Jens Axboe
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=1097932370.1962.4.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=dougg@torque.net \
--cc=linux-scsi@vger.kernel.org \
--cc=nacc@us.ibm.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;
as well as URLs for NNTP newsgroup(s).