All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-ide@vger.kernel.org,
	PARISC list <parisc-linux@lists.parisc-linux.org>,
	Kyle McMartin <kyle@parisc-linux.org>
Subject: Re: [parisc-linux] Re: Why toggle_bounce only for disks?
Date: Fri, 19 Aug 2005 16:03:08 +0200	[thread overview]
Message-ID: <20050819140307.GY6273@suse.de> (raw)
In-Reply-To: <1124458322.5130.18.camel@mulgrave>

On Fri, Aug 19 2005, James Bottomley wrote:
> On Fri, 2005-08-19 at 12:21 +0200, Jens Axboe wrote:
> > Because not bouncing is a performance optimization and I only did the
> > work on ide-cd to allow it. Your patch breaks ide-cd on highmem i386
> > machines, so it's not acceptable.
> > 
> > Tells us more about this crash instead, I'm pretty sure you are working
> > around another issue (your io-mmu code, is it hardware or software?)
> > somehwere with this patch.
> 
> OK, so the particular fix is wrong; but the logic in ide_toggle_bounce()
> is also incorrec.  Our problem is not that we don't want to bounce
> highmem in ide-cd, it's that this is a parisc system with an IOMMU and
> doesn't have any highmem to begin with.
> 
> we need ide_toggle_bounce to return BLK_BOUNCE_ANY always if
> PCI_DMA_BUS_IS_PHYS is not set.
> 
> James
> 
> diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
> --- a/drivers/ide/ide-lib.c
> +++ b/drivers/ide/ide-lib.c
> @@ -410,10 +410,10 @@ void ide_toggle_bounce(ide_drive_t *driv
>  {
>  	u64 addr = BLK_BOUNCE_HIGH;	/* dma64_addr_t */
>  
> -	if (on && drive->media == ide_disk) {
> -		if (!PCI_DMA_BUS_IS_PHYS)
> -			addr = BLK_BOUNCE_ANY;
> -		else if (HWIF(drive)->pci_dev)
> +	if (!PCI_DMA_BUS_IS_PHYS)
> +		addr = BLK_BOUNCE_ANY;
> +	else if (on && drive->media == ide_disk) {
> +		if (HWIF(drive)->pci_dev)
>  			addr = HWIF(drive)->pci_dev->dma_mask;
>  	}

That looks more correct, indeed. It's really too convoluted for drivers,
the defines/setup could do with a little work-over.

-- 
Jens Axboe


  reply	other threads:[~2005-08-19 14:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-06 23:56 Why toggle_bounce only for disks? Kyle McMartin
2005-08-19 10:07 ` Bartlomiej Zolnierkiewicz
2005-08-19 10:21   ` Jens Axboe
2005-08-19 13:32     ` [parisc-linux] " James Bottomley
2005-08-19 14:03       ` Jens Axboe [this message]
2005-08-19 14:03       ` Jens Axboe
2005-08-19 13:32     ` James Bottomley
2005-08-19 10:21   ` Jens Axboe
2005-08-19 10:07 ` Bartlomiej Zolnierkiewicz

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=20050819140307.GY6273@suse.de \
    --to=axboe@suse.de \
    --cc=James.Bottomley@SteelEye.com \
    --cc=bzolnier@gmail.com \
    --cc=kyle@parisc-linux.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=parisc-linux@lists.parisc-linux.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.