linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: "Justin T. Gibbs" <gibbs@scsiguy.com>
Cc: LBJM <LB33JM16@yahoo.com>, linux-kernel@vger.kernel.org
Subject: Re: highmem, aic7xxx, and vfat: too few segs for dma mapping
Date: Mon, 10 Dec 2001 20:21:30 +0100	[thread overview]
Message-ID: <20011210192130.GE12200@suse.de> (raw)
In-Reply-To: <3C1410BB.6884E52F@yahoo.com> <200112101840.fBAIeTg53340@aslan.scsiguy.com>
In-Reply-To: <200112101840.fBAIeTg53340@aslan.scsiguy.com>

On Mon, Dec 10 2001, Justin T. Gibbs wrote:
> >When I upgraded to 2gigs of ram I was using 2.4.10 then used 2.4.14 and
> >2.4.16 each did a kernel panic. however none do it with highmem off.
> 
> I am still investigating the cause of this particular problem.  In
> fact we are building up a new system today in the hope of being able
> to reproduce and solve this problem.

Ok I decided to try and trace this. You se sg_tablesize go AHC_NSEG, so
the SCSI mid layer merging functions will at best create a AHC_NSEG
sized request for you. So far, so good. Now, aic7xxx queuer is entered,
and eventually we end up in ahc_linux_run_device_queue to process the
queued scsi_cmnd. You call pci_map_sg on the supplied scatter gather
list, which returns nseg amount of segments. On x86 nseg will equal the
scatter gather members initially created (no iommu to do funky tricks),
so for our test case here nseg still equals AHC_NSEG. Now you build and
map the segments, the jist of that loop is something ala

	
		/*
		 * The sg_count may be larger than nseg if
		 * a transfer crosses a 32bit page.
		 */ 

hmm, here it already starts to smell fishy...

		scb->sg_count = 0;
		while(cur_seg < end_seg) {
			bus_addr_t addr;
			bus_size_t len;
			int consumed;

			addr = sg_dma_address(cur_seg);
			len = sg_dma_len(cur_seg);
			consumed = ahc_linux_map_seg(ahc, scb, sg, addr, len);

ahc_linux_map_seg checks if scb->sg_count gets bigger than AHC_NSEG, in
fact the test is

	if (scb->sg_count + 1 > AHC_NSEC)
		panic()

What am I missing here?? I see nothing preventing hitting this panic in
some circumstances.

	if (scb->sg_count + 2 > AHC_NSEG)
		panic()

weee, we crossed a 4gb boundary and suddenly we have bigger problems
yet. Ok, so what I think the deal is here is that AHC_NSEG are two
different things to your driver and the mid layer.

Am I missing something? It can't be this obvious.


-- 
Jens Axboe


  reply	other threads:[~2001-12-10 19:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-10  1:32 highmem, aic7xxx, and vfat: too few segs for dma mapping LBJM
2001-12-10 18:40 ` Justin T. Gibbs
2001-12-10 19:21   ` Jens Axboe [this message]
2001-12-10 19:50     ` Justin T. Gibbs
2001-12-10 20:03       ` Jens Axboe
2001-12-10 19:21         ` Gérard Roudier
2001-12-11  6:12         ` David S. Miller
2001-12-11 17:01           ` Gérard Roudier
2001-12-12  9:36             ` Jens Axboe
2001-12-12 13:32               ` Andrea Arcangeli
2001-12-12 17:22                 ` Gérard Roudier
2001-12-12 22:19                   ` Andrea Arcangeli
2001-12-12 20:24                     ` Gérard Roudier
2001-12-13  0:26                     ` David S. Miller
2001-12-13 16:17                       ` Gérard Roudier
2001-12-13 20:30                       ` David S. Miller
2001-12-13 18:13                         ` Gérard Roudier
2001-12-13  0:06                 ` David S. Miller
2001-12-13 16:39                   ` Gérard Roudier
2001-12-12 16:39               ` Gérard Roudier
2001-12-13 20:10       ` Steve Lord
2001-12-13 20:15         ` Justin T. Gibbs
2001-12-13 20:29           ` Steve Lord
2001-12-13 20:48             ` Justin T. Gibbs
2001-12-13 20:58               ` Steve Lord
2001-12-13 21:27                 ` David S. Miller
2001-12-14 15:16                   ` Jens Axboe
2001-12-14 16:15                     ` Jens Axboe
2001-12-14 16:22                       ` Alok K. Dhir
2001-12-14 16:32                         ` Jens Axboe
2001-12-14 16:25                       ` Stephen Lord
2001-12-14 16:24                         ` Jens Axboe
2001-12-13 21:17               ` Steve Lord

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=20011210192130.GE12200@suse.de \
    --to=axboe@suse.de \
    --cc=LB33JM16@yahoo.com \
    --cc=gibbs@scsiguy.com \
    --cc=linux-kernel@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 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).