[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081120175053.GN26308@kernel.dk>
Date: Thu, 20 Nov 2008 18:50:53 +0100
From: Jens Axboe <jens.axboe@...cle.com>
To: Alan Stern <stern@...land.harvard.edu>
Cc: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
bigeasy@...utronix.de, Thomas.Hommel@...anuc.com,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
James.Bottomley@...senPartnership.com
Subject: Re: ISP1760 driver crashes
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists