From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3751A30B502 for ; Tue, 23 Jun 2026 16:00:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782230433; cv=none; b=pHaKdx1PYwPpkUQ8LiMharCjTYkKEx2yzfuC6WhX78qP7UT1+enpzIOZotxBWfgCyCG5AlFJovrZJfWax/BNb2e0QyiVtl/0W09p4FxMlG2zllSL2TSS155s60twSMhq8gjq8e74nSo//jfbm3uJNtmL9Z1yLOzyN8ROJev0Dpw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782230433; c=relaxed/simple; bh=z2Vxd/2tM2532gtQ1Kzukk34nRBbD4l9UDtgLjNDRXU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bZ7EonaO9MPFjgxyyZnJIVoFqzxhznV3fkpw/PVsYcGJA3D6GwSEL8NU4cZEuHs3gOCgqjon5jynlNUTu3PhSZ/osfL40AgPRtmjxDpFu/sx9vMcxLn/0WdXW+O/2xoH8gkvAxjoMifb06hVJ1nX/s/0S7/d2zDbknClQpXVAaU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=EIyIx9f0; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=IdhFvDnS; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="EIyIx9f0"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="IdhFvDnS" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65NC6rXa3745612 for ; Tue, 23 Jun 2026 16:00:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 984yqp6xp/UoBF7AK86FvPHitvhzVPhDbtSUmWGIqgU=; b=EIyIx9f0zBiXE/ft GvJtD5yz45oJ3KZ5VmYdMAfQqMW13fA3Pyyd1APY3fKsobzmnG7zh8k+1Nio20Hg IR0xNNCAvytNmFFeSqihmoPDkDPbaF/NrM0g9GbMbQtkuyiHplpyXecbo+fp/7no N5F1LLC20LsKLGkM/9rc1R6WGu4fZN4bcuqvL668lG9QA96cmxmi+wEMb+QGuhp8 RtllTQ3H/N3A+G2KF7xYPnCZnVMZsxwOha3SpguietOBtTU66JxdRMti1xVQdfKf AHRHq6KK90t5MJUa43i0CcQi8zlgXmZBuGbxrox8ffDCE9ajtL2u+AtL+YyBd9+b Ru7dFA== Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eysv3h0te-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 23 Jun 2026 16:00:31 +0000 (GMT) Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-8df26121c8aso181896d6.3 for ; Tue, 23 Jun 2026 09:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782230430; x=1782835230; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=984yqp6xp/UoBF7AK86FvPHitvhzVPhDbtSUmWGIqgU=; b=IdhFvDnSY2mziMg6ocTWp/p1TC7qGw0Yvu4/7p3hY5n6qAE0ZAihU8foGR6PVZkr+m aS/phgyFfNeVMy6MZDeFmlp7phM1ktltNBo+3mk6/PB1wsVZeYOdGgXsY1WS41r3O1kT Y8vtSpXrFv28re2FaTu8WSgMf5zNHzQtHUo+KOodQ2F7LFgouGMPkm4LFXpIs0iF1Rfu HL+8g5OM5T59jTqC17iElSjHgCn41s75Kx2v8K2DOzew6X0CxHt5N/TbQKMNC6mnaEfZ u//w4HO4LIdmxpI79UyZaIaDMvQFU3s3hvJ/n8F0DujaGA3E7PwGrSI4tKzABiZlEuQW Bd8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782230430; x=1782835230; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=984yqp6xp/UoBF7AK86FvPHitvhzVPhDbtSUmWGIqgU=; b=ThDphOAaAeLRwNmNRqeZ0MMIATtp1NWsaD416rtWFp3ogmIHg05Q0e8cEQ7tcTltJl AzmTTz4FBq6sBihEhdw0cTH8QhpYQoqhlaZoJGqIoghMFB7qvHOgeG1kzpb5MPdJr5eM Hv7zVgKvJm1wZATi+8ijAwKmbnZOi3SiqcssP0hYzMKJTIxo9ZME0aKpAkkKCtPqvhkN kfB8pAcKqnFNUZVN0IoH/RyzhwRN5gIc70DU+EXo+99VhH6E2HxCPZ+tGi6sbBvYOTTh fZJu7VHtnglwU9o+yAUKjh66l6Ae9FotPHAW0KHAG+G44nKn3T5Bl4lFMVfuHr+wErJ+ R0Dw== X-Forwarded-Encrypted: i=1; AFNElJ8CXemUafXV1oPuIrk19ZJFXjb/MSLVcq4jciTtZVws/a1R94JfBCWUVb68nyNrgEyL5g/GGyknpKTSRbQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxW9UQ+2SB9lnr9MxjM21/4QXwbueVQkq1on2fDx5rXPdZni2y9 liuWPk4CC7yfMmOwFcghgk/GdJrgFL4BnbrY5gDfGPqEbpNggTImJP+LZIkL21NxzKK1NBIgYr5 phCOFMl0JTvAFGZxI9qu/qs6Jmfls8ixgjnRsHJrKaofXQ64WopY/+W4DTi9eUPyDtP4= X-Gm-Gg: AfdE7clJNRxK/e1EiQflACbEXBjHwX3wpdNc5m6PFo89EIMbCGewCivj6srCyB0CV/O kA01t/iyZcYIwHQFgwE6cKMQkEeiSQ+7xbdJ/8gpLWwx08Fjqf/Hy27knnnbi8PEzgQun+ZYMLU 3gtHPpbjbre7cuo2tCQnSwnC4pfNDKK2ynriYuV/l3aIb5WcTYja9OxaGgpjVL+wCtxTChrqOpA 2HMANosZpn6q6vbRmHmREndwYXYmDK1WLLNe6lQF30k+caxmZ2s5caESilEOBuCPdvPac3irFah n5Lzx3esk4qGNbsO1mnCN4aKAwGaKsVtE2o5sYhGddZ8ldelY96oIWeHH2rmWR6VX5YhOYJ08vj ImcSqqOTtXONwl9EDiS70pH0p+7zSgJEFKkY= X-Received: by 2002:a05:622a:1a85:b0:517:6a56:accf with SMTP id d75a77b69052e-51a4f417e62mr59007261cf.1.1782230429982; Tue, 23 Jun 2026 09:00:29 -0700 (PDT) X-Received: by 2002:a05:622a:1a85:b0:517:6a56:accf with SMTP id d75a77b69052e-51a4f417e62mr59002911cf.1.1782230426876; Tue, 23 Jun 2026 09:00:26 -0700 (PDT) Received: from [192.168.120.170] ([178.235.128.140]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c0c60aca46csm540916766b.36.2026.06.23.09.00.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Jun 2026 09:00:26 -0700 (PDT) Message-ID: Date: Tue, 23 Jun 2026 18:00:23 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/8] iommu/qcom: Fix inverted fault report check in qcom_iommu_fault() To: Mukesh Ojha , Rob Clark , Will Deacon , "Joerg Roedel (AMD)" Cc: Robin Murphy , iommu@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260623122034.1166295-1-mukesh.ojha@oss.qualcomm.com> <20260623122034.1166295-2-mukesh.ojha@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20260623122034.1166295-2-mukesh.ojha@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNjIzMDEzMSBTYWx0ZWRfX0oKsOWr2C5Xx GT3JZJ5Ky/L/54XuqgJBLK9ZDBk9L/yQDsFb99STQwBkP8RwAQvm6Qx2UJ34qg1+5yCbUdfNj0C UCk3gFB+OtQet9GZ/mtZZxPuVd1br2w= X-Authority-Analysis: v=2.4 cv=WtAb99fv c=1 sm=1 tr=0 ts=6a3aad9f cx=c_pps a=wEM5vcRIz55oU/E2lInRtA==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=yRyykpyyrqY15ofKUHUA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=OIgjcC2v60KrkQgK7BGD:22 X-Proofpoint-ORIG-GUID: l6hKLrKYHe--pmLu8sE5tYdWutS7hN1o X-Proofpoint-GUID: l6hKLrKYHe--pmLu8sE5tYdWutS7hN1o X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjIzMDEzMSBTYWx0ZWRfXwWLlSciqFe2y jROribu0VCMwpQqAxlbl0eG0uIMWDuwbKbbtAuWcSZ6VWt/ahQk13A+csfWra0Zsh/RN/F6Od3O Jql+KU15rKcS9JY0eNOLwc8izGeLxrqyY4afjdvnCgSrgUnpwEDwqlPvDFT92SARuVAhxyL4j9H YN32hpM949DxCGEWX/gEbjgyKd4Fv24Yf0n98MIIPj4aGabiXZh2L2poIP0dCLEDteZbDb4+gm3 4lWa07kXgAmEfpZsOilH+kpxBj6+t6bc6ioK3VFKbzxmnA9/TPYlVacS5WmIYiN6+vPe8nddmu+ h/vOjz7i3DVGtoQWvf2jiDPOJ6CLoPPHvz+W7BAmovwmk72s/kxtX7oVfAEmI/UUGsUIKAOHyvC nvETXnqnAQF+Hsw2NzvOHYx84aeq1Z3Z2dg537g37eelLm9snGLy84q4sIOsTB1yqxY5rTt+XUT 3JDys5itCW9jkK25nag== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-23_03,2026-06-23_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 adultscore=0 priorityscore=1501 suspectscore=0 phishscore=0 malwarescore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606230131 On 6/23/26 2:20 PM, Mukesh Ojha wrote: > report_iommu_fault() returns 0 when a fault handler successfully handles > the fault, and -ENOSYS when no handler is installed. The condition > '!report_iommu_fault()' evaluates to true (printing "Unhandled context > fault") precisely when the fault *was* handled, and stays silent when no > handler is present — the opposite of what is intended. > > Remove the '!' so the driver logs unhandled faults correctly. > > Signed-off-by: Mukesh Ojha > --- > drivers/iommu/arm/arm-smmu/qcom_iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c > index 32efef69e72d..09f2ee6be988 100644 > --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c > +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c > @@ -200,7 +200,7 @@ static irqreturn_t qcom_iommu_fault(int irq, void *dev) > fsynr = iommu_readl(ctx, ARM_SMMU_CB_FSYNR0); > iova = iommu_readq(ctx, ARM_SMMU_CB_FAR); > > - if (!report_iommu_fault(ctx->domain, ctx->dev, iova, 0)) { > + if (report_iommu_fault(ctx->domain, ctx->dev, iova, 0)) { Absolutely hilarious Fixes: 049541e178d5 ("iommu: qcom: wire up fault handler") Reviewed-by: Konrad Dybcio Konrad > dev_err_ratelimited(ctx->dev, > "Unhandled context fault: fsr=0x%x, " > "iova=0x%016llx, fsynr=0x%x, cb=%d\n",