[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250903203502.1155-1-linmag7@gmail.com>
Date: Wed, 3 Sep 2025 22:29:43 +0200
From: Magnus Lindholm <linmag7@...il.com>
To: linux-kernel@...r.kernel.org,
linux-alpha@...r.kernel.org,
hch@...radead.org,
macro@...am.me.uk,
glaubitz@...sik.fu-berlin.de,
mattst88@...il.com,
richard.henderson@...aro.org
Cc: Magnus Lindholm <linmag7@...il.com>
Subject: [PATCH 0/1] alpha: disable DAC for 32-bit PCI on tsunami
I've spent quite some time trying to make the qla1280 driver work
with 64-bit DMA on Alpha/tsunami systems with more than 2GB RAM,
Many thanks to Martin, James, Maciej, Thomas and Christoph who has take
the time to provide feedback and testing during my attempts.
This is what I've concluded so far:
*The ISP1040B 32-bitcard works with 64-bit DMA_MASK on a 21164 Rawhide
machine, hence the card supports DAC, even though the papers on the chip
don't officially claim support until rev C (just as Thomas Bogendoerfer
pointed out earlier).
*The ISP1080 (64-bit pci slot/card) works with 64-bit DMA_MASK on a
21224 Tsunami machine, hence the monster window works fine on Tsunami.
*Data gets corrupted on Alpha/tsunami when DAC/Monster window is enabled
and the PCI card is a 32-bit card. The amount of data being corrupted
each run varies a lot, from no data corruption at all to several
kilobytes out of 20mb data. When data is corrupted it is always in
chunks of 64-bytes, which coincides with the cache block size on the
21264 processor. From manual inspection of the data, its clear that
the corrupted data is just memory content from other active processes
running DMA transfers from other drives/controllers.
The approach to fixing the above problems is to limit 32-bit PCI cards
from using DAC/monster window DMA on Tsunami based Alphas. This is
done by setting bus_dma_limit to 32 bits for devices that have no
64-bit memory BARs. There are examples of 64-bit PCI cards that only
have 32-bit memory BARs, like for example the QLogic ISP1080 and
IPS10160 SCSI controllers. These cards will be constrained to not use
DAC even if they are capable of doing so correctly on tsunami based
Alphas. I believe that this does not pose a problem since these cards
are not supported by any SRM firmware versions and hence rarely used
on Alpha.
In practice, I believe that there are very few 32-bit PCI cards that
are likely to be used on Alphas that have drivers which support 64-bit
DMA addressing. The only example I've found so far is the qla1280 driver.
but ISP1040 SCSI controllers are supported by most versions of SRM
firmware and is hence a fairly common controller on Alpha systems.
arch/alpha/kernel/pci.c | 25 +++++++++++++++++++++++++
arch/alpha/kernel/pci_iommu.c | 18 ++++++++++++------
2 files changed, 37 insertions(+), 6 deletions(-)
--
2.49.0
Powered by blists - more mailing lists