All of lore.kernel.org
 help / color / mirror / Atom feed
From: deller@kernel.org
To: qemu-devel@nongnu.org
Cc: "Soumyajyotii Ssarkar" <soumyajyotisarkar23@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Helge Deller" <deller@gmx.de>,
	"Sven Schnelle" <svens@stackframe.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Fam Zheng" <fam@euphon.net>
Subject: [PULL 04/12] scsi: ncr710: Fix interrupt related register handing
Date: Tue, 23 Dec 2025 16:50:23 +0100	[thread overview]
Message-ID: <20251223155031.7110-5-deller@kernel.org> (raw)
In-Reply-To: <20251223155031.7110-1-deller@kernel.org>

From: Soumyajyotii Ssarkar <soumyajyotisarkar23@gmail.com>

These fixes ensure proper interrupt signaling and status
register behavior during SCSI operations:
- Mask DFE bit in ncr710_update_irq()
- Remove manual ISTAT_DIP clearing, let ncr710_update_irq()
  handle it consistently
- Fix SSTAT0 read to clear unconditionally when non zero
- Fix SSTAT2 read was returning DSTAT instead
- Preserve DFE status bit when clearing DSTAT

Signed-off-by: Soumyajyotii Ssarkar <soumyajyotisarkar23@gmail.com>
Tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Helge Deller <deller@gmx.de>
---
 hw/scsi/ncr53c710.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c
index ac1ca4cef8..0b7734a129 100644
--- a/hw/scsi/ncr53c710.c
+++ b/hw/scsi/ncr53c710.c
@@ -593,7 +593,7 @@ static void ncr710_update_irq(NCR710State *s)
 {
     int level = 0;
 
-    if (s->dstat) {
+    if (s->dstat & ~NCR710_DSTAT_DFE) {
         if (s->dstat & s->dien) {
             level = 1;
         }
@@ -1785,7 +1785,6 @@ static uint8_t ncr710_reg_readb(NCR710State *s, int offset)
         }
         s->dstat = 0;  /* Clear all DMA interrupt status bits */
         s->dstat |= NCR710_DSTAT_DFE;
-        s->istat &= ~NCR710_ISTAT_DIP;
         ncr710_update_irq(s);
 
         if (s->waiting == NCR710_WAIT_RESELECT && s->current &&
@@ -1811,7 +1810,7 @@ static uint8_t ncr710_reg_readb(NCR710State *s, int offset)
         return ret;
     case NCR710_SSTAT0_REG: /* SSTAT0 */
         ret = s->sstat0;
-        if (s->sstat0 != 0 && !(s->sstat0 & NCR710_SSTAT0_STO)) {
+        if (s->sstat0 != 0) {
             s->sstat0 = 0;
             s->istat &= ~NCR710_ISTAT_SIP;
             ncr710_update_irq(s);
@@ -1824,14 +1823,7 @@ static uint8_t ncr710_reg_readb(NCR710State *s, int offset)
         ret = s->sstat0;
         break;
     case NCR710_SSTAT2_REG: /* SSTAT2 */
-        ret = s->dstat;
-
-        if (s->dstat & NCR710_DSTAT_SIR) {
-            /* SIR bit processing */
-        }
-        s->dstat = 0;
-        s->istat &= ~NCR710_ISTAT_DIP;
-        ncr710_update_irq(s);
+        ret = s->sstat2;
         break;
         CASE_GET_REG32(dsa, NCR710_DSA_REG)
         break;
@@ -1902,7 +1894,6 @@ static uint8_t ncr710_reg_readb(NCR710State *s, int offset)
         if (s->dsps == GOOD_STATUS_AFTER_STATUS &&
             (s->dstat & NCR710_DSTAT_SIR)) {
             s->dstat &= ~NCR710_DSTAT_SIR;
-            s->istat &= ~NCR710_ISTAT_DIP;
             ncr710_update_irq(s);
         }
         break;
-- 
2.52.0



  parent reply	other threads:[~2025-12-23 15:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23 15:50 [PULL 00/12] Hppa updates qemu v11 patches deller
2025-12-23 15:50 ` [PULL 02/12] scsi: ncr710: Add null pointer checks deller
2025-12-23 15:50 ` [PULL 03/12] scsi: ncr710: Fix use after free in command_complete deller
2025-12-23 15:50 ` deller [this message]
2025-12-23 15:50 ` [PULL 05/12] scsi: ncr710: Fix DMA State machine and flow control deller
2025-12-23 15:50 ` [PULL 06/12] scsi: ncr710: Fix table indirect addressing endianness deller
2025-12-23 15:50 ` [PULL 07/12] scsi: ncr710: Mark command complete in status phase and fix disconnect deller
2025-12-23 15:50 ` [PULL 08/12] scsi: ncr710: Add LUN scanning deller
2025-12-23 15:50 ` [PULL 09/12] scsi: ncr710: Simplify disconnect handling deller
2025-12-23 15:50 ` [PULL 10/12] scsi: ncr710: Fix DSA register deller
2025-12-23 15:50 ` [PULL 11/12] scsi: ncr710: Fix CTEST FIFO status deller
2025-12-23 15:50 ` [PULL 12/12] target/hppa: add 64 bit support to gdbstub deller
2026-03-10  6:15   ` Philippe Mathieu-Daudé
2026-03-10  6:45     ` Sven Schnelle
2026-03-10  7:06       ` Sven Schnelle
2026-03-10 10:54         ` Philippe Mathieu-Daudé
2026-03-10 16:49           ` Sven Schnelle
2025-12-28 22:08 ` [PULL 00/12] Hppa updates qemu v11 patches Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251223155031.7110-5-deller@kernel.org \
    --to=deller@kernel.org \
    --cc=deller@gmx.de \
    --cc=fam@euphon.net \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=soumyajyotisarkar23@gmail.com \
    --cc=svens@stackframe.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.