linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>,
	hch@infradead.org
Subject: Re: [PATCH] scsi_debug [was: scsi_debug issues]
Date: Tue, 19 Oct 2004 08:05:53 +1000	[thread overview]
Message-ID: <41743E41.8020707@torque.net> (raw)
In-Reply-To: <20041018183747.GA3530@us.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

Nishanth Aravamudan wrote:
> On Mon, Oct 18, 2004 at 11:44:59PM +1000, Douglas Gilbert wrote:
> 
>>James Bottomley wrote:
>>
>>>On Sat, 2004-10-16 at 01:51, Douglas Gilbert wrote:
>>>
>>>
>>>>So this problem seems related to highmem.
> 
> 
> <snip>
> 
>>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?
> 
> 
> Doug,
> 
> I ran 2.6.9-rc4 with your patch applied and had several dump_stack()s
> occur (complaining about sleeping in an invalid context) and a final
> panic during mkfs :) I think something is still wrong... ;) Output is
> below and attached.

Ok, it looks like kmap_atomic() is needed.
Could you try this additional patch.

Doug Gilbert

[-- Attachment #2: sdebug269rc4_174b.diff --]
[-- Type: text/x-patch, Size: 1534 bytes --]

--- linux/drivers/scsi/scsi_debug.c	2004-10-19 07:59:14.966673272 +1000
+++ linux/drivers/scsi/scsi_debug.c174b	2004-10-19 07:58:46.044070176 +1000
@@ -56,7 +56,7 @@
 #include "scsi_debug.h"
 
 #define SCSI_DEBUG_VERSION "1.74"
-static const char * scsi_debug_version_date = "20041018";
+static const char * scsi_debug_version_date = "20041019";
 
 /* Additional Sense Code (ASC) used */
 #define NO_ADDED_SENSE 0x0
@@ -505,7 +505,8 @@
 	active = 1;
 	for (k = 0, req_len = 0, act_len = 0; k < scp->use_sg; ++k, ++sgpnt) {
 		if (active) {
-			kaddr = (unsigned char *)kmap(sgpnt->page);
+			kaddr = (unsigned char *)
+				kmap_atomic(sgpnt->page, KM_USER0);
 			if (NULL == kaddr)
 				return (DID_ERROR << 16);
 			kaddr = (unsigned char *)kaddr + sgpnt->offset;
@@ -515,7 +516,7 @@
 				len = arr_len - req_len;
 			}
 			memcpy(kaddr, arr + req_len, len);
-			kunmap(sgpnt->page);
+			kunmap_atomic(sgpnt->page, KM_USER0);
 			act_len += len;
 		}
 		req_len += sgpnt->length;
@@ -547,7 +548,7 @@
 	}
 	sgpnt = (struct scatterlist *)scp->request_buffer;
 	for (k = 0, req_len = 0, fin = 0; k < scp->use_sg; ++k, ++sgpnt) {
-		kaddr = (unsigned char *)kmap(sgpnt->page);
+		kaddr = (unsigned char *)kmap_atomic(sgpnt->page, KM_USER0);
 		if (NULL == kaddr)
 			return -1;
 		kaddr = (unsigned char *)kaddr + sgpnt->offset;
@@ -557,7 +558,7 @@
 			fin = 1;
 		}
 		memcpy(arr + req_len, kaddr, len);
-		kunmap(sgpnt->page);
+		kunmap_atomic(sgpnt->page, KM_USER0);
 		if (fin)
 			return req_len + len;
 		req_len += sgpnt->length;

  reply	other threads:[~2004-10-18 22:07 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     ` [PATCH] scsi_debug [was: scsi_debug issues] Douglas Gilbert
2004-10-18 18:37       ` Nishanth Aravamudan
2004-10-18 22:05         ` Douglas Gilbert [this message]
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=41743E41.8020707@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).