Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1914d4af authored by Chris Goldsworthy's avatar Chris Goldsworthy Committed by Vijayanand Jitta
Browse files

iommu/arm-smmu: report BID, PID and MID of client on context fault



Aid debugging by reporting the BID, PID and MID of a transaction during a
context fault, in order to identify the master that initiated the fautling
transaction.

Change-Id: I2bed2b472a754f13bf85e3b576f0bf079d9d5541
Signed-off-by: default avatarChris Goldsworthy <cgoldswo@codeaurora.org>
Signed-off-by: default avatarVijayanand Jitta <vjitta@codeaurora.org>
parent 757f1d14
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -276,4 +276,8 @@ enum arm_smmu_s2cr_privcfg {
#define ACTLR_QCOM_NSH_SHIFT		30
#define ACTLR_QCOM_NSH			1

#define FSYNR1_BID			GENMASK(15, 13)
#define FSYNR1_PID			GENMASK(12, 8)
#define FSYNR1_MID			GENMASK(7, 0)

#endif /* _ARM_SMMU_REGS_H */
+11 −1
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@
#include "iommu-logger.h"
#include <linux/debugfs.h>
#include <linux/uaccess.h>
#include <linux/bitfield.h>

/*
 * Apparently, some Qualcomm arm64 platforms which appear to expose their SMMU
@@ -2042,6 +2043,11 @@ static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
		dev_dbg(smmu->dev,
			"Context fault handled by client: iova=0x%08lx, cb=%d, fsr=0x%x, fsynr0=0x%x, fsynr1=0x%x\n",
			iova, cfg->cbndx, fsr, fsynr0, fsynr1);
		dev_dbg(smmu->dev,
			"Client info: BID=0x%x, PID=0x%x, MID=0x%x\n",
			FIELD_GET(FSYNR1_BID, fsynr1),
			FIELD_GET(FSYNR1_PID, fsynr1),
			FIELD_GET(FSYNR1_MID, fsynr1));
		dev_dbg(smmu->dev,
			"soft iova-to-phys=%pa\n", &phys_soft);
		ret = IRQ_HANDLED;
@@ -2056,7 +2062,11 @@ static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
			dev_err(smmu->dev,
				"Unhandled context fault: iova=0x%08lx, cb=%d, fsr=0x%x, fsynr0=0x%x, fsynr1=0x%x\n",
				iova, cfg->cbndx, fsr, fsynr0, fsynr1);

			dev_err(smmu->dev,
				"Client info: BID=0x%x, PID=0x%x, MID=0x%x\n",
				FIELD_GET(FSYNR1_BID, fsynr1),
				FIELD_GET(FSYNR1_PID, fsynr1),
				FIELD_GET(FSYNR1_MID, fsynr1));

			dev_err(smmu->dev,
				"soft iova-to-phys=%pa\n", &phys_soft);