Skip to content

Commit

Permalink
Merge pull request #1490 from pcm720/master
Browse files Browse the repository at this point in the history
Limit max BDM UDMA mode to UDMA4 to avoid compatibility issues with various SATA/IDE2SD adapters
  • Loading branch information
rickgaiser authored Feb 23, 2025
2 parents 200eaa7 + 9916579 commit 4b6cc21
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bdmsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,9 +766,13 @@ void bdmResolveLBA_UDMA(bdm_device_data_t *pDeviceData)

// Query the drive for the highest UDMA mode.
pDeviceData->ataHighestUDMAMode = fileXioDevctl("xhdd0:", ATA_DEVCTL_GET_HIGHEST_UDMA_MODE, NULL, 0, NULL, 0);
if (pDeviceData->ataHighestUDMAMode < 0 || pDeviceData->ataHighestUDMAMode > 7) {
if (pDeviceData->ataHighestUDMAMode < 0) {
// Failed to query highest UDMA mode supported.
LOG("Mass device %d is backed by ATA but failed to get highest UDMA mode %d\n", pDeviceData->ataHighestUDMAMode);
LOG("Mass device %d is backed by ATA but failed to get highest UDMA mode %d\n", pDeviceData->massDeviceIndex, pDeviceData->ataHighestUDMAMode);
pDeviceData->ataHighestUDMAMode = 4;
} else if (pDeviceData->ataHighestUDMAMode > 4) {
// Limit max UDMA mode to 4 to avoid compatibility issues
LOG("Mass device %d supports up to UDMA mode %d, limiting to UDMA 4\n", pDeviceData->massDeviceIndex, pDeviceData->ataHighestUDMAMode);
pDeviceData->ataHighestUDMAMode = 4;
}

Expand Down

0 comments on commit 4b6cc21

Please sign in to comment.