Re: [issue report] pm8001 driver crashes with IOMMU enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24/11/2021 12:43, Jinpu Wang wrote:
I notice that the driver is calling virt_to_phys() on a dma_addr_t,
which is broken:
phys_to_virt you meant.

Right

static int pm80xx_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
struct pm8001_ccb_info *ccb)
{
char *preq_dma_addr = NULL;
__le64 tmp_addr;

tmp_addr = cpu_to_le64((u64)sg_dma_address(&task->smp_task.smp_req));
preq_dma_addr = (char *)phys_to_virt(tmp_addr);

The code was there since the initial support in 2013.
f5860992db55 ("[SCSI] pm80xx: Added SPCv/ve specific hardware
functionalities and relevant changes in common files")

How is this supposed to work? I assume that someone has enabled the
IOMMU on a system with one of these cards before.

One thing to note is that a long time ago I had to fix libsas for broken DMA API usage which was exposed when the IOMMU enabled, which also seems strange not to be noticed then.

See commit 9702c67c6066 ("scsi: libsas: fix ata xfer length")

I guess it's due to the unaligned access to memory on ARM? AFAIK most
of the user are on x86_64.

I doubt it, especially since !IOMMU seems ok.

I have encountered some other RAID cards which bypasses the IOMMU to
access host memory - is that the case here potentially?
I don't know, maybe guys from microchip can answer.

Hopefully.

Thanks,
John




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux