mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Cameron <steve.cameron@hp.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.44-ac3, cciss, more scatter gather elements
Date: Wed, 30 Oct 2002 14:23:55 -0600	[thread overview]
Message-ID: <20021030142355.A1492@zuul.cca.cpqcorp.net> (raw)

I wrote:
[...]
> Anyway, here is a new cciss patch to work with your ll_rw_blk.c patch
> to use more than 31 scatter gather entries.

And that patch was missing something important.  It didn't unmap
all the addresses correctly.  That's what I get for sitting on a patch
since 2.5.7, I guess.  Here's a patch to fix that.

-- steve

 drivers/block/cciss.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions, 4 deletions

--- lx2544ac5/drivers/block/cciss.c~sgc4	Wed Oct 30 14:09:56 2002
+++ lx2544ac5-root/drivers/block/cciss.c	Wed Oct 30 14:09:56 2002
@@ -1719,6 +1719,8 @@ static inline void complete_command( ctl
 	int i;
 	int retry_cmd = 0;
 	u64bit temp64;
+	int sgpage, sgelem;
+	SGDescriptor_struct *sgd;
 		
 	if (timeout)
 		status = 0; 
@@ -1830,13 +1832,23 @@ static inline void complete_command( ctl
 	}	
 	/* command did not need to be retried */
 	/* unmap the DMA mapping for all the scatter gather elements */
-	for(i=0; i<cmd->Header.SGList; i++) {
-		temp64.val32.lower = cmd->SG[i].Addr.lower;
-		temp64.val32.upper = cmd->SG[i].Addr.upper;
+	sgpage = 0;
+	sgelem = 0;
+	for(i=0; i<cmd->Header.SGTotal; i++) {
+		sgd = &cmd->sgdlist[sgpage].sgd[sgelem];
+		if (sgelem == MAXSGENTRIES-1 && sgd->Ext) {
+			i++;
+			sgpage++;
+			sgelem=0;
+			sgd = &cmd->sgdlist[sgpage].sgd[sgelem];
+		}
+		temp64.val32.lower = sgd->Addr.lower;
+		temp64.val32.upper = sgd->Addr.upper;
 		pci_unmap_page(hba[cmd->ctlr]->pdev,
-			temp64.val, cmd->SG[i].Len,
+			temp64.val, sgd->Len,
 			(cmd->Request.Type.Direction == XFER_READ) ?
 				PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);
+		sgelem++;
 	}
 	complete_buffers(cmd->rq->bio, status);
 

.

             reply	other threads:[~2002-10-30 20:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-30 20:23 Stephen Cameron [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-10-28 23:10 Stephen Cameron
2002-10-29  7:28 ` Jens Axboe
2002-10-25 22:06 Cameron, Steve
2002-10-28 15:24 ` Jens Axboe
2002-10-25 20:47 Cameron, Steve
2002-10-25 21:11 ` Jens Axboe
2002-10-25 21:24   ` Jens Axboe
2002-10-25 21:25     ` Jens Axboe
2002-10-25 21:31       ` Jens Axboe
2002-10-25 20:00 Stephen Cameron
2002-10-25 19:59 Stephen Cameron
2002-10-25 20:24 ` 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=20021030142355.A1492@zuul.cca.cpqcorp.net \
    --to=steve.cameron@hp.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

all inboxes | Powered by JetHome®