Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266543AbUF0DwW (ORCPT ); Sat, 26 Jun 2004 23:52:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267243AbUF0DwW (ORCPT ); Sat, 26 Jun 2004 23:52:22 -0400 Received: from netrider.rowland.org ([192.131.102.5]:50694 "HELO netrider.rowland.org") by vger.kernel.org with SMTP id S266543AbUF0DwV (ORCPT ); Sat, 26 Jun 2004 23:52:21 -0400 Date: Sat, 26 Jun 2004 23:52:20 -0400 (EDT) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Oliver Neukum cc: Pete Zaitcev , , , , , , , Subject: Re: drivers/block/ub.c In-Reply-To: <200406270046.53352.oliver@neukum.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1216 Lines: 32 On Sun, 27 Jun 2004, Oliver Neukum wrote: > Am Samstag, 26. Juni 2004 22:06 schrieb Pete Zaitcev: > > +static int ub_submit_top_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd) > > +{ > > +???????struct ub_scsi_cmd *scmd; > > + > > +???????scmd = &sc->top_rqs_cmd; > > + > > +???????/* XXX Can be done at init */ > > +???????scmd->cdb[0] = REQUEST_SENSE; > > +???????scmd->cdb_len = 6; > > +???????scmd->dir = UB_DIR_READ; > > +???????scmd->state = UB_CMDST_INIT; > > +???????scmd->data = sc->top_sense; > > You must allocate a separate buffer to the sense data. > We had similar code in hid which leads to data corruption > on some architectures. It's an issue of DMA coherency. I mentioned this some time ago to the SCSI maintainers. They felt that it wasn't necessary to allocate a separate buffer for the sense data -- I'm not sure why. Apparently most if not all SCSI drivers fail to do this. Usb-storage doesn't do it either; maybe we should. 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/