From: James Bottomley <James.Bottomley@steeleye.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Atulm@lsil.com, SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] fix wrong argument to pci_dma_sync_sg in megaraid driver
Date: 01 Feb 2004 11:16:27 -0500 [thread overview]
Message-ID: <1075652188.1818.15.camel@mulgrave> (raw)
In-Reply-To: <20040201160032.GA14959@lst.de>
On Sun, 2004-02-01 at 11:00, Christoph Hellwig wrote:
> sgl is incremented for each element in the routine, but pci_dma_sync_sg
> needs the original buffer.
>
>
> --- 1.59/drivers/scsi/megaraid.c Fri Jan 23 06:37:03 2004
> +++ edited/drivers/scsi/megaraid.c Sat Jan 31 07:09:25 2004
> @@ -1805,7 +1805,7 @@
> *len = (u32)cmd->request_bufflen;
>
> if( scb->dma_direction == PCI_DMA_TODEVICE ) {
> - pci_dma_sync_sg(adapter->dev, sgl, cmd->use_sg,
> + pci_dma_sync_sg(adapter->dev, cmd->request_buffer, cmd->use_sg,
> PCI_DMA_TODEVICE);
> }
Hang on a minute, none of these syncs (including all the other syncs to
and from the device) looks to be necessary.
Once the buffers are mapped, their cache line ownership is transferred
automatically to the device. Once they are unmapped, it is transferred
back. There's no need to do additional syncs after mapping and
unmapping *unless* the driver needs to touch the actual data in between
the mapping and the unmapping. I didn't notice the megaraid actually
doing this (but even if it does, the sync would be in the wrong place).
James
prev parent reply other threads:[~2004-02-01 16:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-01 16:00 [PATCH] fix wrong argument to pci_dma_sync_sg in megaraid driver Christoph Hellwig
2004-02-01 16:16 ` James Bottomley [this message]
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=1075652188.1818.15.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=Atulm@lsil.com \
--cc=hch@lst.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox