i2c: ismt: Provide a DMA buffer for Interrupt Cause Logging
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 27 Apr 2022 10:19:10 +0000 (13:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jun 2022 06:43:36 +0000 (08:43 +0200)
commit71475936e647c192d6c5321f1dc582c0f9573413
tree2ac4d88c3cad7357d2df82252ea020d3a6e6072b
parent731561de2aeb2957ef55bb17d3d9cb39b9ded2ba
i2c: ismt: Provide a DMA buffer for Interrupt Cause Logging

[ Upstream commit 17a0f3acdc6ec8b89ad40f6e22165a4beee25663 ]

Before sending a MSI the hardware writes information pertinent to the
interrupt cause to a memory location pointed by SMTICL register. This
memory holds three double words where the least significant bit tells
whether the interrupt cause of master/target/error is valid. The driver
does not use this but we need to set it up because otherwise it will
perform DMA write to the default address (0) and this will cause an
IOMMU fault such as below:

  DMAR: DRHD: handling fault status reg 2
  DMAR: [DMA Write] Request device [00:12.0] PASID ffffffff fault addr 0
        [fault reason 05] PTE Write access is not set

To prevent this from happening, provide a proper DMA buffer for this
that then gets mapped by the IOMMU accordingly.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-ismt.c