All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kai Mäkisara" <kai.makisara@kolumbus.fi>
To: Adam Kropelin <akropel1@rochester.rr.com>
Cc: linux-scsi@vger.kernel.org, gibbs@scsiguy.com
Subject: Re: aic7xxx & st: BUG at include/asm/dma-mapping.h:37
Date: Fri, 8 Aug 2003 20:30:03 +0300	[thread overview]
Message-ID: <20030808173003.GA3231@kai.makisara.local> (raw)
In-Reply-To: <20030807201916.A1065@mail.kroptech.com>

Thus spake Adam Kropelin (akropel1@rochester.rr.com):

> On Fri, Aug 08, 2003 at 12:00:56AM +0300, Kai Makisara wrote:
...
> I tried aic7xxx_old and hit the same BUG so Justin's driver would seem
> to be exonerated. The new backtrace is below. The commonality is clearly
> the st driver and the SCSI midlayer. Perhaps I'll try to verbosify
> things a bit in that area and see what comes up.
> 
I reproduced the problem with an aha2940. The patch at the end of this
message fixes the problem but I must think a little more before
sending a permanent fix (at least some comments must be added).

In case someone wonders what this has to do with the symptoms: the bug
lead to setting sr_use_sg to one even when the byte count was zero and
DMA direction DMA_NONE. The byte count in the first s/g segment was
non-zero. Different SCSI HBA drivers handle this inconsistency
differently and this is why I have not seen this in my tests.

This bug has been in st for quite a long time. Thanks for finally
detecting it :-)

-- 
Kai
----------------------------8<--------------------------------------
--- linux-2.6/drivers/scsi/st.c.2.6t2	2003-08-08 19:17:54.000000000 +0300
+++ linux-2.6/drivers/scsi/st.c	2003-08-08 19:56:49.000000000 +0300
@@ -2340,6 +2340,7 @@
 	int timeout;
 	long ltmp;
 	int ioctl_result;
+	int saved_do_dio;
 	int chg_eof = TRUE;
 	unsigned char cmd[MAX_COMMAND_SIZE];
 	Scsi_Request *SRpnt;
@@ -2609,8 +2610,15 @@
 		return (-ENOSYS);
 	}
 
+	/* Save the direct i/o state in case this is called from
+	   error recovery */
+	saved_do_dio = STp->buffer->do_dio;
+	STp->buffer->do_dio = 0;
+
 	SRpnt = st_do_scsi(NULL, STp, cmd, datalen, direction,
 			   timeout, MAX_RETRIES, TRUE);
+
+	STp->buffer->do_dio = saved_do_dio;
 	if (!SRpnt)
 		return (STp->buffer)->syscall_result;
 

  parent reply	other threads:[~2003-08-08 17:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-07  3:14 aic7xxx & st: BUG at include/asm/dma-mapping.h:37 Adam Kropelin
2003-08-07 21:00 ` Kai Makisara
2003-08-08  0:19   ` Adam Kropelin
2003-08-08  4:32     ` Kai Makisara
2003-08-08 17:30     ` Kai Mäkisara [this message]
2003-08-08 17:58       ` Mr. James W. Laferriere
2003-08-09  7:09         ` Kai Makisara
2003-08-11 17:41       ` Adam Kropelin

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=20030808173003.GA3231@kai.makisara.local \
    --to=kai.makisara@kolumbus.fi \
    --cc=akropel1@rochester.rr.com \
    --cc=gibbs@scsiguy.com \
    --cc=linux-scsi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.