From owner-freebsd-scsi@FreeBSD.ORG Tue Apr 5 11:15:08 2011 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C5F9106564A for ; Tue, 5 Apr 2011 11:15:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6162F8FC12 for ; Tue, 5 Apr 2011 11:15:06 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA02092 for ; Tue, 05 Apr 2011 14:15:05 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Q74Dx-0005vD-2w for freebsd-scsi@freebsd.org; Tue, 05 Apr 2011 14:15:05 +0300 Message-ID: <4D9AF9B7.9030107@FreeBSD.org> Date: Tue, 05 Apr 2011 14:15:03 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110308 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: freebsd-scsi@FreeBSD.org X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: Subject: propose: change some sense codes handling X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2011 11:15:08 -0000 I propose the following changes: --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -1431,7 +1431,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x27, 0x06, SS_RDEF, /* XXX TBD */ "Conditional write protect") }, /* DTLPWROMAEBKVF */ - { SST(0x28, 0x00, SS_FATAL | ENXIO, + { SST(0x28, 0x00, SS_TUR | SSQ_MANY | SSQ_DECREMENT_COUNT | EBUSY, "Not ready to ready change, medium may have changed") }, /* DT WROM B */ { SST(0x28, 0x01, SS_FATAL | ENXIO, In my opinion this condition doesn't really mean a fatal error, but implies that we should retry while new medium "settles down". In my testing this change actually helps with some USB flashdrives and cardreaders with slow access to media. Perhaps some real SCSI devices use this sense code to signal a really "fatal" condition? Please let me know. --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -1448,7 +1448,7 @@ static struct asc_table_entry asc_table[] = { * the networking errnos? ECONNRESET anyone? */ /* DTLPWROMAEBKVF */ - { SST(0x29, 0x00, SS_FATAL | ENXIO, + { SST(0x29, 0x00, SS_RDEF, "Power on, reset, or bus device reset occurred") }, /* DTLPWROMAEBKVF */ { SST(0x29, 0x01, SS_RDEF, Align handling of this condition with the rest of the conditions in the same family: "Power on occurred", "SCSI bus reset occurred", "Bus device reset function occurred", etc. I don't see this particular condition should be special. Any insights and/or historical reasons? Thank you. -- Andriy Gapon