diff -ruN v45i1\chglog.txt v45i2\chglog.txt --- v45i1\chglog.txt Thu Sep 24 13:06:12 2015 +++ v45i2\chglog.txt Fri Sep 25 13:00:24 2015 @@ -953,3 +953,13 @@ o) implemented quick device absence detection for all types of VM (0x00 status) o) stop detection process in IssueIdentify if after IDENTIFY command still reports 0x00 status. + +-- +2015.09.25 - v0.45i1 + +*) added more logs to IssueIdentify +!) removed unhandled ATA_DMA attempt from Promice init code. +e) temporary (for test only) removed HDD cache/acoustic/etc tuning (ROS +BUG-8280) ++) HDD tuning checks Capability flags + diff -ruN v45i1\driver\bsmaster.h v45i2\driver\bsmaster.h --- v45i1\driver\bsmaster.h Wed Sep 23 19:07:18 2015 +++ v45i2\driver\bsmaster.h Sun Sep 27 12:05:58 2015 @@ -31,7 +31,7 @@ Revision History: Code was created by - Alter, Copyright (c) 2002-2014 + Alter, Copyright (c) 2002-2015 Some definitions were taken from FreeBSD 4.3-9.2 ATA driver by Søren Schmidt, Copyright (c) 1998-2014 @@ -64,7 +64,7 @@ #include "uata_ctl.h" -#pragma pack(push, 8) +#pragma pack(push, 4) #define MAX_RETRIES 6 #define RETRY_UDMA2 1 @@ -1203,6 +1203,11 @@ struct _HW_DEVICE_EXTENSION* DeviceExtension; struct _HW_CHANNEL* chan; ULONG Lun; + + ULONGLONG errLastLba; + ULONG errBCount; + UCHAR errRetry; + UCHAR errPadding[3]; #ifdef IO_STATISTICS diff -ruN v45i1\driver\id_ata.cpp v45i2\driver\id_ata.cpp --- v45i1\driver\id_ata.cpp Fri Sep 25 12:50:46 2015 +++ v45i2\driver\id_ata.cpp Sun Sep 27 12:06:12 2015 @@ -1780,13 +1780,11 @@ KdPrint2((PRINT_PREFIX "R-rate %d\n", deviceExtension->FullIdentifyData.NominalMediaRotationRate )); - KdPrint2((PRINT_PREFIX "WC %d/%d, LA %d/%d, Protected %d/%d, WB %d/%d, RB %d/%d, Q %d/%d\n", + KdPrint2((PRINT_PREFIX "WC %d/%d, LA %d/%d, WB %d/%d, RB %d/%d, Q %d/%d\n", deviceExtension->FullIdentifyData.FeaturesEnabled.WriteCache, deviceExtension->FullIdentifyData.FeaturesSupport.WriteCache, deviceExtension->FullIdentifyData.FeaturesEnabled.LookAhead, deviceExtension->FullIdentifyData.FeaturesSupport.LookAhead, - deviceExtension->FullIdentifyData.FeaturesEnabled.Protected, - deviceExtension->FullIdentifyData.FeaturesSupport.Protected, deviceExtension->FullIdentifyData.FeaturesEnabled.WriteBuffer, deviceExtension->FullIdentifyData.FeaturesSupport.WriteBuffer, deviceExtension->FullIdentifyData.FeaturesEnabled.ReadBuffer, @@ -1795,6 +1793,13 @@ deviceExtension->FullIdentifyData.FeaturesSupport.Queued )); + KdPrint2((PRINT_PREFIX "Protected %d/%d status %#x, rev %#x\n", + deviceExtension->FullIdentifyData.FeaturesEnabled.Protected, + deviceExtension->FullIdentifyData.FeaturesSupport.Protected, + deviceExtension->FullIdentifyData.SecurityStatus, + deviceExtension->FullIdentifyData.MasterPasswdRevision + )); + // Read very-old-style drive geometry KdPrint2((PRINT_PREFIX "CHS %#x:%#x:%#x\n", deviceExtension->FullIdentifyData.NumberOfCylinders, @@ -2271,17 +2276,17 @@ #ifndef UNIATA_CORE while((CurSrb = UniataGetCurRequest(chan))) { + PHW_LU_EXTENSION LunExt; PATA_REQ AtaReq = (PATA_REQ)(CurSrb->SrbExtension); + i = GET_CDEV(CurSrb); + KdPrint2((PRINT_PREFIX " Lun %x\n", i)); + LunExt = chan->lun[i]; + KdPrint2((PRINT_PREFIX "AtapiResetController: pending SRB %#x, chan %#x\n", CurSrb, chan)); if(CurSrb->Cdb[0] == SCSIOP_MECHANISM_STATUS) { - PHW_LU_EXTENSION LunExt; KdPrint2((PRINT_PREFIX " was MechStatus\n")); - i = GET_CDEV(CurSrb); - KdPrint2((PRINT_PREFIX " Lun %x\n", i)); - LunExt = chan->lun[i]; - if(!(LunExt->DeviceFlags & DFLAGS_CHANGER_INITED)) { LunExt->DeviceFlags |= DFLAGS_CHANGER_INITED; KdPrint2((PRINT_PREFIX " set DFLAGS_CHANGER_INITED\n")); @@ -2332,6 +2337,15 @@ } } + if(!ATAPI_DEVICE(chan, i) && AtaReq->bcount && AtaReq->retry < MAX_RETRIES) { + KdPrint2((PRINT_PREFIX "Save retry status %d\n", AtaReq->retry)); + LunExt->errLastLba = AtaReq->lba; + LunExt->errBCount = AtaReq->bcount; + LunExt->errRetry = AtaReq->retry+1; + } else { + LunExt->errRetry = 0; + } + // Clear request tracking fields. AtaReq->WordsLeft = 0; AtaReq->DataBuffer = NULL; @@ -3197,9 +3211,7 @@ LunExt->MaximumBlockXfer)); } - if(LunExt->IdentifyData.MajorRevision - && 0 /* DEBUG !!!! REMOVE ME */ - ) { + if(LunExt->IdentifyData.MajorRevision) { if(LunExt->opt_ReadCacheEnable) { KdPrint2((PRINT_PREFIX " Try Enable Read Cache\n")); @@ -6723,6 +6735,16 @@ AtaReq->bcount)); AtaReq->lba = lba; + if(LunExt->errRetry && + lba == LunExt->errLastLba && + AtaReq->bcount == LunExt->errBCount) { + KdPrint3((PRINT_PREFIX "IdeReadWrite: Retry after BUS_RESET %d @%#I64x (%#x)\n", + LunExt->errRetry, LunExt->errLastLba, LunExt->errBCount)); + if(AtaReq->retry < MAX_RETRIES) { + AtaReq->retry = LunExt->errRetry; + AtaReq->Flags |= REQ_FLAG_FORCE_DOWNRATE; + } + } // assume best case here // we cannot reinit Dma until previous request is completed diff -ruN v45i1\driver\uniata_ver.h v45i2\driver\uniata_ver.h --- v45i1\driver\uniata_ver.h Fri Sep 25 12:52:08 2015 +++ v45i2\driver\uniata_ver.h Sun Sep 27 12:06:32 2015 @@ -1,10 +1,10 @@ -#define UNIATA_VER_STR "45i1" -#define UNIATA_VER_DOT 0.45.9.1 +#define UNIATA_VER_STR "45i2" +#define UNIATA_VER_DOT 0.45.9.2 #define UNIATA_VER_MJ 0 #define UNIATA_VER_MN 45 #define UNIATA_VER_SUB_MJ 9 -#define UNIATA_VER_SUB_MN 1 -#define UNIATA_VER_DOT_COMMA 0,45,9,1 -#define UNIATA_VER_DOT_STR "0.45.9.1" +#define UNIATA_VER_SUB_MN 2 +#define UNIATA_VER_DOT_COMMA 0,45,9,2 +#define UNIATA_VER_DOT_STR "0.45.9.2" #define UNIATA_VER_YEAR 2015 #define UNIATA_VER_YEAR_STR "2015"