From: Douglas Gilbert <dougg@torque.net>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Nishanth Aravamudan <nacc@us.ibm.com>,
SCSI Mailing List <linux-scsi@vger.kernel.org>,
hch@infradead.org
Subject: [PATCH] scsi_debug [was: scsi_debug issues]
Date: Mon, 18 Oct 2004 23:44:59 +1000 [thread overview]
Message-ID: <4173C8DB.8030009@torque.net> (raw)
In-Reply-To: <1097932370.1962.4.camel@mulgrave>
[-- Attachment #1: Type: text/plain, Size: 2470 bytes --]
James Bottomley wrote:
> 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.
done
> When you've finished you need to release the mapping with kunmap().
ouch, that requires a re-org
> There are also atomic versions of these depending on where you are.
hopefully not required
The above required a fair few changes to scsi_debug.
Attached is a patch that rolls "kmap" changes with
patches I have sent recently for scsi_debug.
Attachment is gzipped (due to size) and applies against
lk 2.6.8.1 -> lk 2.6.9-rc4 .
Nishanth, could you test this with highmem?
Changelog:
- use kmap/kunmap to handle normal and highmem cases
- disable clustering
- previously could only handle 'use_sg > 1' for
read and write commands
- VERIFY (SBC) and REWIND (SSC) command support (dummies)
- 'dsense' parameter (sysfs + load time) for descriptor
sense format
- allow negative 'every_nth' to fail continually after
|every_nth| commands (or until sysfs intervention)
- clean up debug messages sent to the log (when opts=1)
- correct ordering of log messages
- set scsi_cmnd::resid when underflow on DMA_FROM_DEVICE
operations
- clean up std inquiry response; add version descriptors
- reject mode sense subpage commands since no subpages
currently supported (i.e. better command filtering)
Doug Gilbert
[-- Attachment #2: sdebug269rc4_174.diff.gz --]
[-- Type: application/x-gzip, Size: 8135 bytes --]
next prev parent reply other threads:[~2004-10-18 13:47 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
2004-10-18 13:44 ` Douglas Gilbert [this message]
2004-10-18 18:37 ` [PATCH] scsi_debug [was: scsi_debug issues] 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=4173C8DB.8030009@torque.net \
--to=dougg@torque.net \
--cc=James.Bottomley@SteelEye.com \
--cc=hch@infradead.org \
--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).