Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

ata: Use a better default for SET_MULTIPLE_MODE

* If the device returns a valid upper limit (word 47) use that.
* If the current limit (word 59) is valid, use that.
* Fall back to 1 as a default, not 16!

Note this is only used for PIO transfers!

Change-Id: I269b751466242bbcce91ee991d9ade449cc84b6b

+7 -4
+7 -4
firmware/drivers/ata.c
··· 112 112 113 113 static sector_t total_sectors; 114 114 static uint32_t log_sector_size; 115 - static int multisectors; /* number of supported multisectors */ 115 + static uint8_t multisectors; /* number of supported multisectors */ 116 116 117 117 static unsigned short identify_info[ATA_IDENTIFY_WORDS] STORAGE_ALIGN_ATTR; 118 118 ··· 1097 1097 } 1098 1098 1099 1099 multisectors = identify_info[47] & 0xff; 1100 - if (multisectors == 0) /* Invalid multisector info, try with 16 */ 1101 - multisectors = 16; 1100 + if (!multisectors && (identify_info[59] & 0x100) == 0x100) 1101 + multisectors = identify_info[59] & 0xff; 1102 + if (!multisectors) 1103 + multisectors = 1; /* One transfer per REQ */ 1102 1104 1103 - DEBUGF("ata: %d sectors per ata request\n", multisectors); 1105 + DEBUGF("ata: max %d sectors per DRQ\n", multisectors); 1104 1106 1105 1107 total_sectors = (identify_info[61] << 16) | identify_info[60]; 1106 1108 ··· 1142 1144 ata_state = ATA_ON; 1143 1145 keep_ata_active(); 1144 1146 } 1147 + 1145 1148 rc = set_multiple_mode(multisectors); 1146 1149 if (rc) 1147 1150 rc = -100 + rc;