qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] esp: Do not overwrite  ESP_TCHI after reset
@ 2014-11-10 15:37 Hannes Reinecke
  2014-11-10 15:49 ` Hannes Reinecke
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Reinecke @ 2014-11-10 15:37 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Hannes Reinecke

After a reset ESP_TCHI should contain the unique ID
of the chip. This value will be overwritten with the
current tranfer count if the transfer count has
previously been set.
The code never checks if the transfer count has
been set, so the unique ID will always be overwritten
if the driver sends a DMA NOP after reset.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 hw/scsi/esp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 5ab44d8..9798180 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -454,7 +454,9 @@ void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val)
             /* Reload DMA counter.  */
             s->rregs[ESP_TCLO] = s->wregs[ESP_TCLO];
             s->rregs[ESP_TCMID] = s->wregs[ESP_TCMID];
-            s->rregs[ESP_TCHI] = s->wregs[ESP_TCHI];
+            if (s->wregs[ESP_TCHI]) {
+                    s->rregs[ESP_TCHI] = s->wregs[ESP_TCHI];
+            }
         } else {
             s->dma = 0;
         }
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] esp: Do not overwrite ESP_TCHI after reset
  2014-11-10 15:37 [Qemu-devel] [PATCH] esp: Do not overwrite ESP_TCHI after reset Hannes Reinecke
@ 2014-11-10 15:49 ` Hannes Reinecke
  0 siblings, 0 replies; 2+ messages in thread
From: Hannes Reinecke @ 2014-11-10 15:49 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 11/10/2014 04:37 PM, Hannes Reinecke wrote:
> After a reset ESP_TCHI should contain the unique ID
> of the chip. This value will be overwritten with the
> current tranfer count if the transfer count has
> previously been set.
> The code never checks if the transfer count has
> been set, so the unique ID will always be overwritten
> if the driver sends a DMA NOP after reset.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>  hw/scsi/esp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
> index 5ab44d8..9798180 100644
> --- a/hw/scsi/esp.c
> +++ b/hw/scsi/esp.c
> @@ -454,7 +454,9 @@ void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val)
>              /* Reload DMA counter.  */
>              s->rregs[ESP_TCLO] = s->wregs[ESP_TCLO];
>              s->rregs[ESP_TCMID] = s->wregs[ESP_TCMID];
> -            s->rregs[ESP_TCHI] = s->wregs[ESP_TCHI];
> +            if (s->wregs[ESP_TCHI]) {
> +                    s->rregs[ESP_TCHI] = s->wregs[ESP_TCHI];
> +            }
>          } else {
>              s->dma = 0;
>          }
> 
Hmm.
This is actually not quite correct.
I'll be sending an updated patch.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-10 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-10 15:37 [Qemu-devel] [PATCH] esp: Do not overwrite ESP_TCHI after reset Hannes Reinecke
2014-11-10 15:49 ` Hannes Reinecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).