mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Don't flush the caches of CD/DVD drives.
svn path=/trunk/; revision=12699
This commit is contained in:
parent
6bd1cc19a3
commit
4cffccfe6f
1 changed files with 24 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2001, 2002, 2003, 2004 ReactOS Team
|
||||
* Copyright (C) 2001, 2002, 2003, 2004, 2005 ReactOS Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: atapi.c,v 1.56 2004/11/18 08:32:32 gvg Exp $
|
||||
/* $Id$
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS ATAPI miniport driver
|
||||
|
@ -115,6 +115,7 @@ typedef struct _ATAPI_MINIPORT_EXTENSION
|
|||
#define DEVICE_48BIT_ADDRESS 0x00000010
|
||||
#define DEVICE_MEDIA_STATUS 0x00000020
|
||||
#define DEVICE_DMA_CMD 0x00000040
|
||||
#define DEVICE_NO_FLUSH 0x00000080
|
||||
|
||||
|
||||
typedef struct _UNIT_EXTENSION
|
||||
|
@ -1895,6 +1896,12 @@ AtapiInquiry(PATAPI_MINIPORT_EXTENSION DeviceExtension,
|
|||
/* get it from the ATAPI configuration word */
|
||||
InquiryData->DeviceType = (DeviceParams->ConfigBits >> 8) & 0x1F;
|
||||
DPRINT("Device class: %u\n", InquiryData->DeviceType);
|
||||
|
||||
/* Don't flush CD/DVD drives */
|
||||
if (InquiryData->DeviceType == READ_ONLY_DIRECT_ACCESS_DEVICE)
|
||||
{
|
||||
DeviceExtension->DeviceFlags[Srb->TargetId] |= DEVICE_NO_FLUSH;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2224,6 +2231,18 @@ AtapiFlushCache(PATAPI_MINIPORT_EXTENSION DeviceExtension,
|
|||
DPRINT("SCSIOP_SYNCRONIZE_CACHE: TargetId: %lu\n",
|
||||
Srb->TargetId);
|
||||
|
||||
if (!(DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_NO_FLUSH))
|
||||
{
|
||||
/*
|
||||
* NOTE: Don't flush the cache for CD/DVD drives. Although
|
||||
* the ATAPI-6 standard allows that, it has been experimentally
|
||||
* proved that it can damage some broken LG drives. Afterall
|
||||
* it doesn't make sense to flush cache on devices we don't
|
||||
* write to.
|
||||
*/
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Wait for BUSY to clear */
|
||||
for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue