mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-08-26 22:23:12 -04:00
hw/ide: report ATAPI UDMA5 with a matching standard and cable
IDENTIFY PACKET DEVICE claims UDMA mode 5 in word 88 while word 80 reports support only up to ATA/ATAPI-4. UDMA5 first appears in ATA/ATAPI-6; ATA/ATAPI-5 stops at mode 4. Bits 3:1 of word 80 are obsolete in IDENTIFY PACKET DEVICE data as well, so the old 001eh claimed three standards that mean nothing for a packet device. Report 0070h, ATA/ATAPI-4 through ATA/ATAPI-6. Word 93 was left unset, so nothing reported the 80-conductor cable that UDMA5 needs. Fill it in, but only for a parallel attachment: ACS-3 7.13.6.41 gives word 93 of IDENTIFY PACKET DEVICE data the meaning of word 93 of IDENTIFY DEVICE data, where "For SATA devices, word 93 shall be set to the value 0000h". A cleared ncq_queues is how both identify paths already tell a parallel attachment from an AHCI one. The device 0 reset result is 0fh rather than the 01h ide_identify() reports: bit 3 says diagnostics passed, which they did, and bits 2:1 say the device number came from some other method, the only one of the four encodings that is not a jumper, CSEL or reserved. Raising word 80 has a second effect. Linux decides a device is SATA in ata_id_is_sata(), which wants word 93 clear and word 80 at ATA/ATAPI-5 or later. An AHCI CD-ROM satisfied neither condition before and was taken for a parallel device; now it satisfies both. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/4038 Cc: John Snow <jsnow@redhat.com> Cc: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Signed-off-by: Denis V. Lunev <den@openvz.org>
This commit is contained in:
parent
0b7cc42531
commit
60faaa8c3b
1 changed files with 5 additions and 1 deletions
|
|
@ -292,7 +292,7 @@ static void ide_atapi_identify(IDEState *s)
|
|||
put_le16(p + 76, (1 << 8));
|
||||
}
|
||||
|
||||
put_le16(p + 80, 0x1e); /* support up to ATA/ATAPI-4 */
|
||||
put_le16(p + 80, 0x70); /* support up to ATA/ATAPI-6 */
|
||||
if (s->wwn) {
|
||||
put_le16(p + 84, (1 << 8)); /* supports WWN for words 108-111 */
|
||||
put_le16(p + 87, (1 << 8)); /* WWN enabled */
|
||||
|
|
@ -300,6 +300,10 @@ static void ide_atapi_identify(IDEState *s)
|
|||
|
||||
#ifdef USE_DMA_CDROM
|
||||
put_le16(p + 88, 0x3f | (1 << 13)); /* udma5 set and supported */
|
||||
if (!s->ncq_queues) {
|
||||
/* word 93 is parallel ATA only, a SATA device reports zero */
|
||||
put_le16(p + 93, 0x600f);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (s->wwn) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue