Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757255AbYG3VSZ (ORCPT ); Wed, 30 Jul 2008 17:18:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754425AbYG3VSN (ORCPT ); Wed, 30 Jul 2008 17:18:13 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:52034 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751739AbYG3VSM (ORCPT ); Wed, 30 Jul 2008 17:18:12 -0400 Date: Wed, 30 Jul 2008 17:18:10 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Matthew Dharm cc: Robert Hancock , , Tomas Styblo , , Subject: Re: [usb-storage] [PATCH] JMicron JM20337 USB-SATA data corruption bugfix - device 152d:2338 In-Reply-To: <20080730200033.GD7578@one-eyed-alien.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1439 Lines: 31 On Wed, 30 Jul 2008, Matthew Dharm wrote: > The code path to supress the reporting of an error when auto-sense shows no > ASC/ASCQ was added for a reason. That reason has likely been lost to time, > but I worry about devices that are out there that rely on the current > behavior to function properly.... In this case we shouldn't have to worry about that code path. It applies to situations where there actually is no error. In fact, if you follow the logic flow you'll see that the supression code gets invoked only for CB-like transports, i.e., unsolicited auto-sense. But in this situation there really _is_ an error: We get an underflow. The existing logic checks for underflow only when the device reports Okay status; my patch changes the logic so that it also checks for underflow when the device reports Check Condition status with no sense data. The idea is that the higher SCSI layers don't know what to do with Check Condition plus no-sense -- so they treat the transfer as a success. But that's definitely the wrong thing to do when there was an underflow; in that situation we want to report the underflow so that the midlayer will retry the command. 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/