public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	bigeasy@linutronix.de, Thomas.Hommel@gefanuc.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	James.Bottomley@HansenPartnership.com
Subject: Re: ISP1760 driver crashes
Date: Thu, 20 Nov 2008 18:50:53 +0100	[thread overview]
Message-ID: <20081120175053.GN26308@kernel.dk> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0811201026280.2447-100000@iolanthe.rowland.org>

On Thu, Nov 20 2008, Alan Stern wrote:
> On Thu, 20 Nov 2008, FUJITA Tomonori wrote:
> 
> > We have been used 4GB for long time if dma_mask is zero (I guess we
> > use 4GB as kinda the default dma address limit at several places). The
> > majority of drivers (such as pci) sets properly dev->dma_mask so the
> > patch might not change anything but suddenly changing the
> > long-standing rule in an odd way (use BLK_BOUNCE_HIGH if dma_mask is
> > zero) doesn't sound a good idea to me.
> > 
> > Why not calling blk_queue_bounce_limit() in the slave_configure hook?
> > I think that it's the common way for SCSI LLDs with odd bounce limit.
> 
> Thomas, here's a patch to do what Tomonori suggests.  Try replacing the 
> old patch with this one.
> 
> Alan Stern
> 
> 
> Index: usb-2.6/drivers/usb/storage/scsiglue.c
> ===================================================================
> --- usb-2.6.orig/drivers/usb/storage/scsiglue.c
> +++ usb-2.6/drivers/usb/storage/scsiglue.c
> @@ -129,6 +129,14 @@ static int slave_configure(struct scsi_d
>  					      max_sectors);
>  	}
>  
> +	/* Some USB host controllers can't do DMA; they have to use PIO.
> +	 * They indicate this by setting their dma_mask to NULL.  For
> +	 * such controllers we need to make sure the block layer sets
> +	 * up bounce buffers in addressable memory.
> +	 */
> +	if (!us->pusb_dev->bus->controller->dma_mask)
> +		blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_HIGH);
> +
>  	/* We can't put these settings in slave_alloc() because that gets
>  	 * called before the device type is known.  Consequently these
>  	 * settings can't be overridden via the scsi devinfo mechanism. */
> 

That looks like a good fix. You can add my Acked-by: to that, if you
wish.

-- 
Jens Axboe


  reply	other threads:[~2008-11-20 17:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4923F120.6000303@linutronix.de>
2008-11-19 14:59 ` ISP1760 driver crashes Alan Stern
2008-11-19 15:00   ` Jens Axboe
2008-11-19 15:36     ` Alan Stern
2008-11-19 15:39       ` Jens Axboe
2008-11-19 16:33         ` Alan Stern
2008-11-19 17:21           ` Jens Axboe
2008-11-20  5:40             ` FUJITA Tomonori
2008-11-20  7:33               ` Jens Axboe
2008-11-20 15:28               ` Alan Stern
2008-11-20 17:50                 ` Jens Axboe [this message]
2008-11-21 10:58                 ` Hommel, Thomas (GE EntSol, Intelligent Platforms)
2008-11-19 15:59       ` Hommel, Thomas (GE EntSol, Intelligent Platforms)

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=20081120175053.GN26308@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Thomas.Hommel@gefanuc.com \
    --cc=bigeasy@linutronix.de \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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