From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 0FF292F7ABB for ; Fri, 21 Nov 2025 07:56:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763711775; cv=none; b=RaLHcun4KXBEHzJleFCedo2flP3dEn/+WbgUDvBtzm+QoQBUVY83lhG+DTKSrsWZlDQznfda8Z16LJ3C3EAWajFnascdrEzxhMIInxUqtFMyRbTfNArTl3rzxjbenx/tLDIddo6GbjkKnVqBsbIIyQPaZmwhB6wq+snRmOcRsHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763711775; c=relaxed/simple; bh=9O8cOrJeuY9GBH3d8E5up4xj3GyVsFfoHTujS0uZIUE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EhPHCZgnYN/d7j6cROBrkx5mRHaGZ6GQ6IR9/CK1cE0PrNIVcg2d5q02c9qe5KdwDwXLvOXdzHnX2w+OB7e6TJVJcphc2xwXxRa7JQYVrFP8L+cFWvi212ZjlQkT8bYH0mCKBXAVrHAYrmQ0u9fzFEVWMdPmweRYmwzekad6i7o= 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=XKkzn5IE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=GAlWyM6g; arc=none smtp.client-ip=205.220.180.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="XKkzn5IE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GAlWyM6g" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AL6bA0O1987990 for ; Fri, 21 Nov 2025 07:56:13 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= nme/VvBNv/AYe693OUbdgkmznUIedHABnYiUouLVBs0=; b=XKkzn5IEDXJV1mfE pVx4BD9ZuRGUsr+5eDwiaojFyyCRiB5NJe6/swwk+Bd4yFUFMYq13IwlIljdR8fj 03+tgq6QRMUucNy+dShAKg9wZdW1jSds914WnHdtXTtxd/549HM4UPWcu43ddLay IGkbecE4VQLlqJBsurpcT1tAO9jJki6m+VohH3X/UaOBVz3Cqe6htUwWqGrV26zI XvLgtYgw2KEueKm+oJzSDn51NpW2F5N+IQOxDNfzEKzgFbULnC9hOa6klgEvb/kQ NJp5NMRY+XNJioAZRFC7dqebv83BSyN7ZnIxiY4kb4LhJoKNcoTyIdbkJhWncXrw Zj21YQ== Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4aj1vabdvv-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 21 Nov 2025 07:56:12 +0000 (GMT) Received: by mail-oo1-f70.google.com with SMTP id 006d021491bc7-6577768ec28so3461468eaf.1 for ; Thu, 20 Nov 2025 23:56:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1763711772; x=1764316572; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=nme/VvBNv/AYe693OUbdgkmznUIedHABnYiUouLVBs0=; b=GAlWyM6ggvBDQ5nUJnSd82wZq+LdeR/b0ljWk7aR8OZeRebA1fVgimuQwbEPlHLOTq BneB8WkoNTdc64fWe9KMMpSm4JvQk8Plu209YB2joDQ/QD6b4ItK2EVxDj3ixI7QOTc1 TVK4SDH5FAV9LINbmFcCNBOJSf7bpLChgrJErxg8gmN8LwZRH8TtXZ8oxAQUBOoatuQ+ iaxwSmus4SsqMmx8pn42Eue/W9q7fEqdKfGF6WWxnAPwKHHtoSyaFM8PElSztUsL4Lob tPWbTSK8LQw95j6J2Gy3/puAN6JkQ6f4t88+WwrPiP0N12iJxYo/OY424t1qvbQ2Id9t j9eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763711772; x=1764316572; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nme/VvBNv/AYe693OUbdgkmznUIedHABnYiUouLVBs0=; b=CJkICE28bnO7FxCw2xSz6JoMqchSuo8/pLJ3wM30PF/SdBbgYS+lB/F2OxTlj3gapJ NdsuyhYndcXhJ69O31ZIqsm83WRrTzKg3qgjN2qc9yVJCxgODXLnBjyqWsZxyKHlufiR O8PBGvpTfpgQaqcWOIbdw+33wVfEAukIv9Rw72IqrWnpUBnRpkuUkCc5a2vu3RXqGyEg co0agAF5m+e3kUlcRPnlZy+AzO6hSDqJDX0lUfwRJI2OxJxq5odZIa6w+Qc3aDt08v41 UgTPX75aW124Ix0EhHVdFpOb1kCRT3mEEZMaxtk5geQ0YRsoZetJNZfbYHilD015H3Yg IehA== X-Forwarded-Encrypted: i=1; AJvYcCVQFzDFK7s9wyvR0pljHacjK005e++9OT21pUgJGA+lm5S/tXmQk3ncYFCCSRoD0hWUwlV9kyE3D+JCzSo=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+YPe8cAt/xr6c24kE6c2cJfobzWhlvibJXQzdHfHHHWjUKIvD AQthM6IUbnmrIguq7eyvXGEPg3JFvQenEWIYFXN9LAASnT8X21PTT+4KNnxJ598nO0B4hG3wXUS DC/Eu27fwhU5aLzinZG7vUHs+7KNuKLCF85cIENMAbRmR7NKkcSha1wHtFfAlXV2FI7g= X-Gm-Gg: ASbGncs+umogg3yDPNgIdfK3LqJX2HV9e7r6Aw7hweEuPEd5QbgW4WAQYKolWi4hfHW Gbt/oKRWa/IguAiSVF2aUeHpmCEBq/dlkgtNNv3WVXFGJ5ftllq0ZQ4MYz1Sc5HjQMI5cFrn5K3 M+A+BFJdRYECb+qtAwVNvdoiD0zQyZ0rwG9qUuDTjkwb6Y2X0/5LL4v1L3CmtHmEf5kPUnX93I8 n0xW4RJ4EjHkNSetj7hMbyJQXrvMh3r/4IOYxJ2LjF/2J2svgbZ8IK+Mfzefsu5/o8CVBz347a9 8ZgrFNOTC3zm6NYd+01nFxXKxBFhrzberR+tBgJXTLyPomAJsZdyux5D/AzubaAotGdoxNNVDXu RD7S1aNqs9NSET1L4Hf9WvsAslkW0OxxqoXQekKML/iotzj4sda7gT8Of X-Received: by 2002:a05:6871:3a24:b0:3e7:dea2:9607 with SMTP id 586e51a60fabf-3ecbbc38ee1mr719983fac.11.1763711772037; Thu, 20 Nov 2025 23:56:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuJnVGss4AC1dURESEaj+hVS8QGPRKiI0PbaZyLcDXBM9cxrwkCRas2nW38BCf5o39zQyqrw== X-Received: by 2002:a05:6871:3a24:b0:3e7:dea2:9607 with SMTP id 586e51a60fabf-3ecbbc38ee1mr719976fac.11.1763711771646; Thu, 20 Nov 2025 23:56:11 -0800 (PST) Received: from hu-qianyu-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-3ec9dcfe28csm2347744fac.22.2025.11.20.23.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 23:56:11 -0800 (PST) Date: Thu, 20 Nov 2025 23:56:08 -0800 From: Qiang Yu To: Shawn Lin Cc: Manivannan Sadhasivam , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Jingoo Han , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 3/5] PCI: dwc: Remove MSI/MSIX capability if iMSI-RX is used as MSI controller Message-ID: References: <20251109-remove_cap-v1-0-2208f46f4dc2@oss.qualcomm.com> <20251109-remove_cap-v1-3-2208f46f4dc2@oss.qualcomm.com> <7d4xj3tguhf6yodhhwnsqp5s4gvxxtmrovzwhzhrvozhkidod7@j4w2nexd5je2> <3ac0d6c5-0c49-45fd-b855-d9b040249096@rock-chips.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3ac0d6c5-0c49-45fd-b855-d9b040249096@rock-chips.com> X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTIxMDA2MCBTYWx0ZWRfX6iGG64hEkqWO 9RjbRiHeFNJTPKCxgWh1gH4KhsqIRf6IvWMg9wixvyPTIyrZLT3kFNmzAlL9GBs+k2VaUOiTHzJ W1N2KsUfOvqJd9HV6XMAXx+hMUE7ED10AxF2wBZ05oWrQCTKLC7UuCU0NLgXTMMERHIfKqFyND0 ONaGN1wOkwq53Z8fuf53/IQGcVjzYVyAIsx47W71E3TDJAzVMUR0pHbEts9xTt0p/aRNlwtXxws KvEHQedSeLuZbtwloqcvrd8a8bP+QrklcWZKo0hMQwSzV5p2otAdFG/IiYEkan1XY5LIs1bYCLv g3pk+NGmdL1aXCzns/gayKSOcn9ECwHkcchTVWsX1KVRpUIr9i3YNGJqnRO/mf21rWBw9ScQQiZ +iX59fYhVbr8egAt89gQqv7VRsAi8A== X-Authority-Analysis: v=2.4 cv=Vpwuwu2n c=1 sm=1 tr=0 ts=69201b1c cx=c_pps a=lkkFf9KBb43tY3aOjL++dA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=8BFNsxKPdyf3tXGkzS8A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=k4UEASGLJojhI9HsvVT1:22 X-Proofpoint-ORIG-GUID: l0a1V_RQpj5bgiVywXO1E66FWbZOsRvl X-Proofpoint-GUID: l0a1V_RQpj5bgiVywXO1E66FWbZOsRvl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-21_02,2025-11-20_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 bulkscore=0 phishscore=0 priorityscore=1501 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511210060 On Fri, Nov 21, 2025 at 12:04:09PM +0800, Shawn Lin wrote: > 在 2025/11/21 星期五 1:00, Manivannan Sadhasivam 写道: > > On Thu, Nov 20, 2025 at 10:06:03PM +0800, Shawn Lin wrote: > > > 在 2025/11/10 星期一 14:59, Qiang Yu 写道: > > > > Some platforms may not support ITS (Interrupt Translation Service) and > > > > MBI (Message Based Interrupt), or there are not enough available empty SPI > > > > lines for MBI, in which case the msi-map and msi-parent property will not > > > > be provided in device tree node. For those cases, the DWC PCIe driver > > > > defaults to using the iMSI-RX module as MSI controller. However, due to > > > > DWC IP design, iMSI-RX cannot generate MSI interrupts for Root Ports even > > > > when MSI is properly configured and supported as iMSI-RX will only monitor > > > > and intercept incoming MSI TLPs from PCIe link, but the memory write > > > > generated by Root Port are internal system bus transactions instead of > > > > PCIe TLPs, so they are ignored. > > > > > > > > This leads to interrupts such as PME, AER from the Root Port not received > > > > > > This's true which also stops Rockchip's dwc IP from working with AER > > > service. But my platform can't work with AER service even with ITS support. > > > > > > > on the host and the users have to resort to workarounds such as passing > > > > "pcie_pme=nomsi" cmdline parameter. > > > > > > ack. > > > > > > > > > > > To ensure reliable interrupt handling, remove MSI and MSI-X capabilities > > > > from Root Ports when using iMSI-RX as MSI controller, which is indicated > > > > by has_msi_ctrl == true. This forces a fallback to INTx interrupts, > > > > eliminating the need for manual kernel command line workarounds. > > > > > > > > With this behavior: > > > > - Platforms with ITS/MBI support use ITS/MBI MSI for interrupts from all > > > > components. > > > > - Platforms without ITS/MBI support fall back to INTx for Root Ports and > > > > use iMSI-RX for other PCI devices. > > > > > > > > Signed-off-by: Qiang Yu > > > > --- > > > > drivers/pci/controller/dwc/pcie-designware-host.c | 10 ++++++++++ > > > > 1 file changed, 10 insertions(+) > > > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c > > > > index 20c9333bcb1c4812e2fd96047a49944574df1e6f..3724aa7f9b356bfba33a6515e2c62a3170aef1e9 100644 > > > > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > > > > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > > > > @@ -1083,6 +1083,16 @@ int dw_pcie_setup_rc(struct dw_pcie_rp *pp) > > > > dw_pcie_dbi_ro_wr_dis(pci); > > > > + /* > > > > + * If iMSI-RX module is used as the MSI controller, remove MSI and > > > > + * MSI-X capabilities from PCIe Root Ports to ensure fallback to INTx > > > > + * interrupt handling. > > > > + */ > > > > + if (pp->has_msi_ctrl) { > > > > > > Isn't has_msi_ctrl means you have something like GIC-ITS > > > support instead of iMSI module? Am I missing anything? > > > > > > > It is the other way around. Presence of this flag means, iMSI-RX is used. But I > > think the driver should clear the CAPs irrespective of this flag. > > Thanks for correcting me. Yeap, how can I make such a mistake. :( > > Anyway, this patch works for me: > > root@debian:/userdata# ./aer-inject aer.txt > [ 17.764272] pcieport 0000:00:00.0: aer_inject: Injecting errors > 00000040/00000000 into device 0000:01:00.0 > [ 17.765178] aer_isr ! #log I added in aer_isr > [ 17.765394] pcieport 0000:00:00.0: AER: Correctable error message > received from 0000:01:00.0 > [ 17.766211] nvme 0000:01:00.0: PCIe Bus Error: severity=Correctable, > type=Data Link Layer, (Receiver ID) > root@debian:/userdata# [ 17.767045] nvme 0000:01:00.0: device > [144d:a80a] error status/mask=00000040/0000e000 > [ 17.767980] nvme 0000:01:00.0: [ 6] BadTLP > > root@debian:/userdata# cat /proc/interrupts | grep aerdrv > 60: 0 0 0 0 0 0 0 0 INTx 0 Edge > PCIe PME, aerdrv, PCIe bwctrl > 63: 0 0 0 1 0 0 0 0 INTx 0 Edge > PCIe PME, aerdrv > 110: 0 0 0 0 0 0 0 0 INTx 0 Edge > PCIe PME, aerdrv > > > > > > > + dw_pcie_remove_capability(pci, PCI_CAP_ID_MSI); > > > > + dw_pcie_remove_capability(pci, PCI_CAP_ID_MSIX); > > > > > > Will it make all devices connected to use INTx only? > > > > > > > Nah, it is just for the Root Port. The MSI/MSI-X from endpoint devices will > > continue to work as usual. > > Qiang Yu, > > Could you please help your IP version with below patch? > It's in hex format, you could convert each pair of hex > characters to ASCII, i.g, 0x3437302a is 4.70a. The reason > is we asked Synopsys to help check this issue before, then > we were informed that they have supported it at least since > IP version 6.0x. So we may have to limit the version first. > Okay, let me check with internal team, will update. - Qiang Yu > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > @@ -1057,6 +1057,10 @@ int dw_pcie_setup_rc(struct dw_pcie_rp *pp) > > dw_pcie_msi_init(pp); > > +#define PORT_LOGIC_PCIE_VERSION_NUMBER_OFF 0x8f8 > + val = dw_pcie_readl_dbi(pci, PORT_LOGIC_PCIE_VERSION_NUMBER_OFF); > + printk("version = 0x%x\n", val); > + > > >