[PATCH 05/10] scsi:ncr710: Fix table indirect addressing endianness

Soumyajyotii Ssarkar posted 10 patches 1 month, 2 weeks ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Helge Deller <deller@gmx.de>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>
[PATCH 05/10] scsi:ncr710: Fix table indirect addressing endianness
Posted by Soumyajyotii Ssarkar 1 month, 2 weeks ago
Correct the endianness conversion for table indirect addressing
Now we use be32_to_cpu() instead of cpu_to_le32()

This fix descriptor table parsing when using indirect
addressing modes in SCRIPTS

Signed-off-by: Soumyajyotii Ssarkar<soumyajyotisarkar23@gmail.com>
---
 hw/scsi/ncr53c710.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c
index e17d1f3fb8..4b42fab754 100644
--- a/hw/scsi/ncr53c710.c
+++ b/hw/scsi/ncr53c710.c
@@ -1355,8 +1355,8 @@ again:
             offset = sextract32(addr, 0, 24);
             ncr710_dma_read(s, s->dsa + offset, buf, 8);
             /* byte count is stored in bits 0:23 only */
-            s->dbc = cpu_to_le32(buf[0]) & 0xffffff;
-            addr = cpu_to_le32(buf[1]);
+            s->dbc = be32_to_cpu(buf[0]) & 0xffffff;
+            addr = be32_to_cpu(buf[1]);
         }
         /* Check phase match for block move instructions */
         if ((s->sstat2 & PHASE_MASK) != ((insn >> 24) & 7)) {
-- 
2.49.0
Re: [PATCH 05/10] scsi:ncr710: Fix table indirect addressing endianness
Posted by Helge Deller 1 month, 2 weeks ago
On 12/21/25 15:23, Soumyajyotii Ssarkar wrote:
> Correct the endianness conversion for table indirect addressing
> Now we use be32_to_cpu() instead of cpu_to_le32()
> 
> This fix descriptor table parsing when using indirect
> addressing modes in SCRIPTS
> 
> Signed-off-by: Soumyajyotii Ssarkar<soumyajyotisarkar23@gmail.com>


Reviewed-by: Helge Deller <deller@gmx.de>

> ---
>   hw/scsi/ncr53c710.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)