From: Leon Romanovsky <leon@kernel.org>
To: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
Helge Deller <deller@gmx.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Leon Romanovsky <leon@kernel.org>, Jason Gunthorpe <jgg@ziepe.ca>
Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org,
Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH] parisc: Set valid bit in high byte of 64‑bit physical address
Date: Thu, 18 Dec 2025 14:08:08 +0200 [thread overview]
Message-ID: <20251218-fix-parisc-conversion-v1-1-4a04d26b0168@nvidia.com> (raw)
From: Leon Romanovsky <leonro@nvidia.com>
On 32‑bit systems, phys_addr_t is defined as u32. However, parisc
expects physical addresses to be 64‑bit values so it can store a
validity bit in the upper byte.
Resolve this mismatch by casting the physical address to unsigned
long, ensuring it is treated as a 64‑bit value where required. This
fixes the failure to start block device drivers on the C3700
platform, as reported by Guenter.
Also remove the now‑obsolete macro.
QEMU command line to reproduce the issue (with Debian SID as rootfs):
qemu-system-hppa -machine C3700 \
-kernel arch/parisc/boot/bzImage \
-append "console=ttyS0 \
root=/dev/sda rw rootwait panic=-1" \
-nographic \
-device lsi53c895a \
-drive file=rootfs-hppa.img,if=none,format=raw,id=hd0 \
-device scsi-hd,drive=hd0
Fixes: 96ddf2ef58ec ("parisc: Convert DMA map_page to map_phys interface")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/all/b184f1bf-96dc-4546-8512-9cba5ecb58f7@roeck-us.net/
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
arch/parisc/include/asm/special_insns.h | 15 ---------------
drivers/parisc/sba_iommu.c | 4 ++--
2 files changed, 2 insertions(+), 17 deletions(-)
diff --git a/arch/parisc/include/asm/special_insns.h b/arch/parisc/include/asm/special_insns.h
index 1013eeba31e5..fbccd76180b6 100644
--- a/arch/parisc/include/asm/special_insns.h
+++ b/arch/parisc/include/asm/special_insns.h
@@ -2,21 +2,6 @@
#ifndef __PARISC_SPECIAL_INSNS_H
#define __PARISC_SPECIAL_INSNS_H
-#define lpa(va) ({ \
- unsigned long pa; \
- __asm__ __volatile__( \
- "copy %%r0,%0\n" \
- "8:\tlpa %%r0(%1),%0\n" \
- "9:\n" \
- ASM_EXCEPTIONTABLE_ENTRY(8b, 9b, \
- "or %%r0,%%r0,%%r0") \
- : "=&r" (pa) \
- : "r" (va) \
- : "memory" \
- ); \
- pa; \
-})
-
#define lpa_user(va) ({ \
unsigned long pa; \
__asm__ __volatile__( \
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index a6eb6bffa5ea..eefb2bac8443 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -578,8 +578,8 @@ sba_io_pdir_entry(__le64 *pdir_ptr, space_t sid, phys_addr_t pba,
pba &= IOVP_MASK;
pba |= (ci >> PAGE_SHIFT) & 0xff; /* move CI (8 bits) into lowest byte */
- pba |= SBA_PDIR_VALID_BIT; /* set "valid" bit */
- *pdir_ptr = cpu_to_le64(pba); /* swap and store into I/O Pdir */
+ /* set "valid" bit, swap and store into I/O Pdir */
+ *pdir_ptr = cpu_to_le64((unsigned long)pba | SBA_PDIR_VALID_BIT);
/*
* If the PDC_MODEL capabilities has Non-coherent IO-PDIR bit set
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251218-fix-parisc-conversion-37e31197a291
Best regards,
--
Leon Romanovsky <leonro@nvidia.com>
next reply other threads:[~2025-12-18 12:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 12:08 Leon Romanovsky [this message]
2025-12-18 16:22 ` [PATCH] parisc: Set valid bit in high byte of 64‑bit physical address Guenter Roeck
2025-12-18 17:14 ` Marek Szyprowski
2025-12-18 18:27 ` Helge Deller
2025-12-18 21:28 ` Leon Romanovsky
2025-12-19 8:35 ` Marek Szyprowski
2025-12-19 12:38 ` James Bottomley
2025-12-19 12:48 ` Marek Szyprowski
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=20251218-fix-parisc-conversion-v1-1-4a04d26b0168@nvidia.com \
--to=leon@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=deller@gmx.de \
--cc=jgg@ziepe.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=m.szyprowski@samsung.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox