[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 4/9] ide: don't tamper with the device register
From: |
John Snow |
Subject: |
[PULL 4/9] ide: don't tamper with the device register |
Date: |
Thu, 1 Oct 2020 13:46:44 -0400 |
In real ISA operation, register writes go out to an entire bus channel
and all listening devices receive the write. The devices do not toggle
the DEV bit based on their own configuration, nor does the HBA
intermediate or tamper with that value.
The reality of the matter is that DEV0/DEV1 accordingly will react to
command register writes based on whether or not the device was selected.
This does not fix a known bug, but it makes the code slightly simpler
and more obvious.
Signed-off-by: John Snow <jsnow@redhat.com>
---
hw/ide/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 84499e2241c..29dc5dc4b45 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1297,8 +1297,8 @@ void ide_ioport_write(void *opaque, uint32_t addr,
uint32_t val)
break;
case ATA_IOPORT_WR_DEVICE_HEAD:
/* FIXME: HOB readback uses bit 7 */
- bus->ifs[0].select = (val & ~0x10) | 0xa0;
- bus->ifs[1].select = (val | 0x10) | 0xa0;
+ bus->ifs[0].select = val | 0xa0;
+ bus->ifs[1].select = val | 0xa0;
/* select drive */
bus->unit = (val >> 4) & 1;
break;
--
2.26.2
- [PULL 0/9] Ide patches, John Snow, 2020/10/01
- [PULL 4/9] ide: don't tamper with the device register,
John Snow <=
- [PULL 5/9] ide: model HOB correctly, John Snow, 2020/10/01
- [PULL 3/9] ide: rename cmd_write to ctrl_write, John Snow, 2020/10/01
- [PULL 1/9] MAINTAINERS: Update my git address, John Snow, 2020/10/01
- [PULL 2/9] hw/ide/ahci: Do not dma_memory_unmap(NULL), John Snow, 2020/10/01
- [PULL 8/9] ide: clear interrupt on command write, John Snow, 2020/10/01
- [PULL 7/9] ide: remove magic constants from the device register, John Snow, 2020/10/01
- [PULL 6/9] ide: reorder set/get sector functions, John Snow, 2020/10/01
- [PULL 9/9] ide: cancel pending callbacks on SRST, John Snow, 2020/10/01
- Re: [PULL 0/9] Ide patches, Peter Maydell, 2020/10/01