From 42507bf14195fa5b54ab005279536bf7d5607f6e Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Tue, 16 Nov 2021 22:28:10 +0100 Subject: [PATCH] [0.4.12][UNIATA] Workaround random crashes on Virtual PC (#3377) CORE-12441 CORE-17371 I am not sure why this line in id_queue.cpp was added. I don't know how I could improve that case. Then, disable it, for the time being. It regressed by 4b9cf2e33949a107fe6567632f1ac066c44a9d2c (r71252). CORE-12441 CORE-17371 fix picked from 0.4.15-dev-2740-g ba77a09c04a02841a6b88428697bd725402c1b9d While touching uniata do also PARTIALLY port back some bm_devs.h changes: 0.4.15-dev-1522-g 88d36c93a27f5d764027e2475c84bdde1a84c4a6 (Properly mark ReactOS diff from upstream) --- drivers/storage/ide/uniata/bm_devs.h | 12 ++++++++++-- drivers/storage/ide/uniata/id_queue.cpp | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/storage/ide/uniata/bm_devs.h b/drivers/storage/ide/uniata/bm_devs.h index 78893e42c90..dc1ddeddc91 100644 --- a/drivers/storage/ide/uniata/bm_devs.h +++ b/drivers/storage/ide/uniata/bm_devs.h @@ -352,7 +352,11 @@ BUSMASTER_CONTROLLER_INFORMATION_BASE const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 9d05, 8086, 0x00, ATA_SA300, "Intel Sunrise Point-LP" , UNIATA_SATA | UNIATA_AHCI | UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 9d07, 8086, 0x00, ATA_SA300, "Intel Sunrise Point-LP" , UNIATA_SATA | UNIATA_AHCI | UNIATA_RAID_CONTROLLER), -/* PCI_DEV_HW_SPEC_BM( a102, 8086, 0x00, ATA_SA300, "Intel Sunrise Point" , UNIATA_SATA | UNIATA_AHCI ),*/ /* workaround regression CORE-16078 */ +#ifndef __REACTOS__ + PCI_DEV_HW_SPEC_BM( a102, 8086, 0x00, ATA_SA300, "Intel Sunrise Point" , UNIATA_SATA | UNIATA_AHCI ), +#else + /* workaround regression CORE-16078 */ +#endif PCI_DEV_HW_SPEC_BM( a103, 8086, 0x00, ATA_SA300, "Intel Sunrise Point" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( a105, 8086, 0x00, ATA_SA300, "Intel Sunrise Point" , UNIATA_SATA | UNIATA_AHCI | UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( a106, 8086, 0x00, ATA_SA300, "Intel Sunrise Point" , UNIATA_SATA | UNIATA_AHCI | UNIATA_RAID_CONTROLLER), @@ -714,4 +718,8 @@ BUSMASTER_CONTROLLER_INFORMATION_BASE const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( ffff, ffff, 0xff, BMLIST_TERMINATOR, NULL , BMLIST_TERMINATOR ) }; -/* static */ const ULONG _NUM_BUSMASTER_ADAPTERS = (sizeof(BusMasterAdapters) / sizeof(BUSMASTER_CONTROLLER_INFORMATION_BASE)); +#ifndef __REACTOS__ +static const ULONG _NUM_BUSMASTER_ADAPTERS = (sizeof(BusMasterAdapters) / sizeof(BUSMASTER_CONTROLLER_INFORMATION_BASE)); +#else +const ULONG _NUM_BUSMASTER_ADAPTERS = (sizeof(BusMasterAdapters) / sizeof(BUSMASTER_CONTROLLER_INFORMATION_BASE)); +#endif diff --git a/drivers/storage/ide/uniata/id_queue.cpp b/drivers/storage/ide/uniata/id_queue.cpp index bdafe2fd8e6..a042cf21e54 100644 --- a/drivers/storage/ide/uniata/id_queue.cpp +++ b/drivers/storage/ide/uniata/id_queue.cpp @@ -231,7 +231,11 @@ UniataQueueRequest( AtaReq->next_req = NULL; LunExt->first_req = LunExt->last_req = AtaReq; +#ifdef __REACTOS__ + // Do nothing here, workaround for CORE-12441 and CORE-17371 +#else chan->cur_cdev = GET_CDEV(Srb); +#endif } LunExt->queue_depth++; chan->queue_depth++;