Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751265AbVIHUkT (ORCPT ); Thu, 8 Sep 2005 16:40:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751382AbVIHUkS (ORCPT ); Thu, 8 Sep 2005 16:40:18 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:9108 "HELO iolanthe.rowland.org") by vger.kernel.org with SMTP id S1751265AbVIHUkR (ORCPT ); Thu, 8 Sep 2005 16:40:17 -0400 Date: Thu, 8 Sep 2005 16:40:16 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Jim Ramsay cc: Matthew Dharm , , Linux Kernel , Subject: Re: [Linux-usb-users] Possible bug in usb storage (2.6.11 kernel) In-Reply-To: <4789af9e05090813287f05e12a@mail.gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1331 Lines: 39 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/