From c79f658125a7b53251820d866d8b6dfc004c4bff Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 8 Jul 2020 12:03:40 -0400 Subject: ATA: In picking PIO modes, word 64 is only valid if word 53 bit 1 is set. Change-Id: I0a7681be7d703c1baa7f8bd7b5e31f04f20f299d --- firmware/drivers/ata.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'firmware') diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 373078d8f9..2116855233 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -1046,15 +1046,16 @@ static int set_features(void) int pio_mode = 2; /* Find out the highest supported PIO mode */ - if(identify_info[64] & 2) + if (identify_info[53] & (1<<1)) { /* Is word 64 valid? */ + if (identify_info[64] & 2) pio_mode = 4; - else - if(identify_info[64] & 1) - pio_mode = 3; + else if(identify_info[64] & 1) + pio_mode = 3; + } /* Update the table: set highest supported pio mode that we also support */ features[0].parameter = 8 + pio_mode; - + #ifdef HAVE_ATA_DMA if (identify_info[53] & (1<<2)) /* Ultra DMA mode info present, find a mode */ -- cgit v1.2.3