Skip to contentSkip to conversation

ide: cmd_exec_dev_diagnostic() always set error register to 0x01

PATCH In review David du Colombier 2 participants 4 messages Dec 25, 2013 – Feb 1, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ide: cmd_exec_dev_diagnostic() always set error register to 0x01

This notably fix IDE CD probing on the Plan 9 operating system, which rely on the error register set by the Execute Device Diagnostic command to detect drive configurations.

Thanks to Rémi Pommarel for reporting this issue.

---
 hw/ide/core.c | 1 +
 1 file changed, 1 insertion(+)
hw/ide/core.c +1 -0
index e1f4c33..7783d58 100644
@@ -1321,6 +1321,7 @@ static bool cmd_exec_dev_diagnostic(IDEState *s, uint8_t cmd)
         s->status = 0; /* ATAPI spec (v6) section 9.10 defines packet
                         * devices to return a clear status register
                         * with READY_STAT *not* set. */
+        s->error = 0x01;
     } else {
         s->status = READY_STAT | SEEK_STAT;
         /* The bits of the error register are not as usual for this command!
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 20 lines

This notably fix IDE CD probing on the Plan 9 operating system, which rely on the error register set by the Execute Device Diagnostic command to detect drive configurations.

Thanks to Rémi Pommarel for reporting this issue.

---
 hw/ide/core.c | 1 +
 1 file changed, 1 insertion(+)
hw/ide/core.c +0 -0
index e1f4c33..7783d58 100644
@@ -1321,6 +1321,7 @@ static bool cmd_exec_dev_diagnostic(IDEState
 *s, uint8_t cmd) s->status = 0; /* ATAPI spec (v6) section 9.10

defines packet
* devices to return a clear status register
* with READY_STAT *not* set. */

Quoted 5 lines
+        s->error = 0x01;
     } else {
         s->status = READY_STAT | SEEK_STAT;
         /* The bits of the error register are not as usual for this

command!

Ping.

Signature · 1 line
David du Colombier
#2 lore raw
In reply to David du Colombier
Quoted 3 lines · David du Colombier

This notably fix IDE CD probing on the Plan 9 operating system, which rely on the error register set by the Execute Device Diagnostic command to detect drive configurations.

While this is a one-liner, I'm not sure it is "trivial enough", just because it is not at all obvious we shuold clear error here and not somewhere else. I mean, shouldn't s->error be cleared somewhere when next request is queued, or something like that?

That's basically why I haven't applied this initially.

CC'ing qemu-devel.

Thanks,

/mjt

Quoted 20 lines

Thanks to Rémi Pommarel for reporting this issue.

---
 hw/ide/core.c | 1 +
 1 file changed, 1 insertion(+)
hw/ide/core.c +1 -0
index e1f4c33..7783d58 100644
@@ -1321,6 +1321,7 @@ static bool cmd_exec_dev_diagnostic(IDEState *s, uint8_t cmd)
         s->status = 0; /* ATAPI spec (v6) section 9.10 defines packet
                         * devices to return a clear status register
                         * with READY_STAT *not* set. */
+        s->error = 0x01;
     } else {
         s->status = READY_STAT | SEEK_STAT;
         /* The bits of the error register are not as usual for this command!
#3 lore raw
Quoted 5 lines · Michael Tokarev
Quoted 3 lines · David du Colombier

This notably fix IDE CD probing on the Plan 9 operating system, which rely on the error register set by the Execute Device Diagnostic command to detect drive configurations.

Quoted 8 lines

While this is a one-liner, I'm not sure it is "trivial enough", just because it is not at all obvious we shuold clear error here and not somewhere else. I mean, shouldn't s->error be cleared somewhere when next request is queued, or something like that?

That's basically why I haven't applied this initially.

CC'ing qemu-devel.

I've applied this to qemu-trivial 3 weeks ago, and now this change has been applied to the master branch, -- still without any additional comments, which is somewhat troubling me, but here we go.

Thanks,

/mjt