linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Jim Ramsay <jim.ramsay@gmail.com>
Cc: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>,
	<linux-usb-users@lists.sourceforge.net>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	<linux-scsi@vger.kernel.org>
Subject: Re: [Linux-usb-users] Possible bug in usb storage (2.6.11 kernel)
Date: Thu, 8 Sep 2005 16:40:16 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.0509081637410.4545-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <4789af9e05090813287f05e12a@mail.gmail.com>

On Thu, 8 Sep 2005, Jim Ramsay wrote:

> More information:
> 
> The error only occurrs during device sensing when the
> srb->request_buffer is assigned as follows, by usb/storage/transport.c
> in the routine usb_stor_invoke_transport:
> 
> old_request_buffer = srb->request_buffer;
> srb->request_buffer = srb->sense_buffer;
> 
> Now, this is a problem because srb->sense_buffer is defined as follows
> in the struct scsi_cmnd:
> 
> #define SCSI_SENSE_BUFFERSIZE   96
>         unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE];
> 
> Since it is not allocated at runtime there is NO WAY the SCSI layer
> can possibly guarantee it is page- or cache-aligned and ready for DMA.
> 
> Any suggestions on best fix for this?  Is it still a SCSI-layer issue?
>  Or should USB step up in this case and ensure this buffer is dma-safe
> itself?

Aha!

I've long thought that usb-storage should allocate its own transfer buffer 
for sense data.  In the past people have said, "No, don't bother, it's not 
really needed."  Here's a good reason for doing it.

Expect a patch before long.

Alan Stern


  reply	other threads:[~2005-09-08 20:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-08 17:14 Possible bug in usb storage (2.6.11 kernel) Jim Ramsay
2005-09-08 17:58 ` [Linux-usb-users] " Matthew Dharm
2005-09-08 19:52   ` Jim Ramsay
2005-09-08 20:28     ` Jim Ramsay
2005-09-08 20:40       ` Alan Stern [this message]
2005-09-27 13:38         ` Atsushi Nemoto
2005-09-27 14:21           ` Alan Stern
2005-09-27 14:46             ` Atsushi Nemoto
2005-09-27 15:38               ` Alan Stern
2005-09-28 16:27                 ` Atsushi Nemoto
2005-09-30 16:48                   ` Ralf Baechle
2005-09-08 20:43       ` Matthew Dharm

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=Pine.LNX.4.44L0.0509081637410.4545-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=jim.ramsay@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb-users@lists.sourceforge.net \
    --cc=mdharm-kernel@one-eyed-alien.net \
    /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;
as well as URLs for NNTP newsgroup(s).