From patchwork Mon Mar 18 07:19:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 780955 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA7F722F02 for ; Mon, 18 Mar 2024 07:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710746355; cv=none; b=OxbTmct0DpJfCB16MvUZZanrCZ3kGoSX6zLgcxDs68tjxEvDU86du2a7fvzmD/mRoPvdm1X1fj2aJQA4m0zhF4DZBNqEttwbSWv5tNvsM4QUFc3ZiXabz+Ci9FybqsU8GFRcgPXMgk4C/aOrWnnzkDBPi7ghEEC2PzxToTjOaA8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710746355; c=relaxed/simple; bh=1v1aQLIYP8b+mI95hKqjB4PDKnC2GI6VXXU3JQllGfA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u3l04j8JbHOtFlVNqTEqHyswuJNb1GMm+NWeHVyK43CFYPHlWRSa8+310smbrEOmf+NWzhrHiuLLuyFtq0FI9sn4QSzWcQp9m6J5ni+1VAgAoaBD1MOudTztNcAtX8hU4D7qAhLfWTQUmgAJ1H6uu/inLgd/RyS0zUVB1PINwrI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=NFkWht3e; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NFkWht3e" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6da202aa138so1953185b3a.2 for ; Mon, 18 Mar 2024 00:19:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710746353; x=1711351153; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vq5Dos6DoYH4j6IedoqEyUOn4weuKjM4Z19kQDTr6Y0=; b=NFkWht3eQAH7ntsZchDqrXm7b+aU3x2abErjZN1B2hjh6Dj5F0/lNefQLmsEG3PsJC EIEiZNsW+H6uIWrC7irhlk48bTz6HIae7mzPhCDHh70VCztxxM/zXpBhcSMJdhmhqwmv l8DQ/5qz2lXCFPR+zG+OMTnQaT9NSto0RXGtjuB/8ifeN3luKeFMYO8I8St8mt4dGyHG O+pCeSCB6NrhYwzhonjvYYB2yg0npp1IpSJL1Y1qne9um1LXfJRDW80jQPA6zq7m7LsF duzYWQhvghyh6NxIms9HxB7wKij90B0PNIsnFjUN/TnLJ9aM8JDfJot+HvLoXdvI7CT+ /cEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710746353; x=1711351153; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vq5Dos6DoYH4j6IedoqEyUOn4weuKjM4Z19kQDTr6Y0=; b=UxNGMFYkhaj6VEhkTy//0Dw8caFBmY4OmCP4qTsPwMB2v5gw5VTi/8oGxKYzKB2DBY dgDFgdZyc1KHzhp13La+5+N9VAbgIm4C4Jli5wh/2G1uhVpLlmhoaEOGTBUOUiIegYxw UwSQTib/9LWydKUubtAlS/MGyJYQF2ZYyXwYC7mLp/ldLF6j5yrjdKgCxrkZipXk1Dzo 2tUzvAWuBeLiBzs8koYF87X2hkiAuS3tVMt5KKrJ1ly++MjbryOWynuandBYl4S7C/jT tnrEm30wRuzy2POX9CymbGFj+wde1GegpKrFPxDVfP+ciVDtB6ir+BrL/ilhPuqZaOqV qh2Q== X-Gm-Message-State: AOJu0YwgRbE+mMwWO+i2ufk90pc1Ua65UDQcc7mIb2n1P6+/Q/APpOwc 1QygPVzz4YZpcwZkE4P5vC4s+vQyue1m3RYuAuoflWXh0fJlqO7bvP6XU77KvQ== X-Google-Smtp-Source: AGHT+IFSMGfgI9ewcyB/Piyi5+UjAAibSDaWTk/5HkiYLVv/0ABTPRS3zbdmrJt1hEWYLIHu2wy2aQ== X-Received: by 2002:a05:6a00:2387:b0:6e6:a0de:563a with SMTP id f7-20020a056a00238700b006e6a0de563amr13811975pfc.15.1710746352955; Mon, 18 Mar 2024 00:19:12 -0700 (PDT) Received: from [127.0.1.1] ([103.246.195.160]) by smtp.gmail.com with ESMTPSA id x16-20020aa784d0000000b006e66c9bb00dsm7387515pfn.179.2024.03.18.00.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 00:19:12 -0700 (PDT) From: Manivannan Sadhasivam Date: Mon, 18 Mar 2024 12:49:03 +0530 Subject: [PATCH 1/3] arm64: dts: qcom: sm8450: Fix the msi-map entries Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240318-pci-bdf-sid-fix-v1-1-acca6c5d9cf1@linaro.org> References: <20240318-pci-bdf-sid-fix-v1-0-acca6c5d9cf1@linaro.org> In-Reply-To: <20240318-pci-bdf-sid-fix-v1-0-acca6c5d9cf1@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2236; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=1v1aQLIYP8b+mI95hKqjB4PDKnC2GI6VXXU3JQllGfA=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBl9+rpsZJOD5LdQA2yEn0WyWcaDrhLmj04RjjXG pK/74qvqrSJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZffq6QAKCRBVnxHm/pHO 9S3KB/42QV76nv/mS1H0u1J7geOMOVeURxPRrCxDsTk47fvKgH/rXwLsRQb0ZmpAhlX+4wtI1i3 rzTYnJr+CZGzVYIWktiszpGZ+V2/CH7igul/6ekvW7QUKOa3xLUKRObTi/K8+MDNxQs8x0olJ6v JWKyOZ1JyWvQrGZB2+zIhAKKlURRRK0V/yfHzOktZQLH3DZXsHUOaBthHOPxDVIAXLDaqdPgBQv VzvW7ZBYviiTHCnUXHcrSFpIeo1o2qRpV28hL0FFdyB8OGyMgyGAfNDXFHqlV5GOQ3nhyQCSlOJ WxC8S2xcnpDAQISj7XlJGE3jaZxbpJ5Giu8m+KgVpXBKFzUn X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 While adding the GIC ITS MSI support, it was found that the msi-map entries needed to be swapped to receive MSIs from the endpoint. But later it was identified that the swapping was needed due to a bug in the Qualcomm PCIe controller driver. And since the bug is now fixed with commit bf79e33cdd89 ("PCI: qcom: Enable BDF to SID translation properly"), let's fix the msi-map entries also to reflect the actual mapping in the hardware. Cc: # 6.3: bf79e33cdd89 ("PCI: qcom: Enable BDF to SID translation properly") Fixes: ff384ab56f16 ("arm64: dts: qcom: sm8450: Use GIC-ITS for PCIe0 and PCIe1") Signed-off-by: Manivannan Sadhasivam --- arch/arm64/boot/dts/qcom/sm8450.dtsi | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi index b86be34a912b..024d2653cc30 100644 --- a/arch/arm64/boot/dts/qcom/sm8450.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi @@ -1777,12 +1777,8 @@ pcie0: pcie@1c00000 { ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; - /* - * MSIs for BDF (1:0.0) only works with Device ID 0x5980. - * Hence, the IDs are swapped. - */ - msi-map = <0x0 &gic_its 0x5981 0x1>, - <0x100 &gic_its 0x5980 0x1>; + msi-map = <0x0 &gic_its 0x5980 0x1>, + <0x100 &gic_its 0x5981 0x1>; msi-map-mask = <0xff00>; interrupts = , , @@ -1900,12 +1896,8 @@ pcie1: pcie@1c08000 { ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; - /* - * MSIs for BDF (1:0.0) only works with Device ID 0x5a00. - * Hence, the IDs are swapped. - */ - msi-map = <0x0 &gic_its 0x5a01 0x1>, - <0x100 &gic_its 0x5a00 0x1>; + msi-map = <0x0 &gic_its 0x5a00 0x1>, + <0x100 &gic_its 0x5a01 0x1>; msi-map-mask = <0xff00>; interrupts = , , From patchwork Mon Mar 18 07:19:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 780954 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33E2C25761 for ; Mon, 18 Mar 2024 07:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710746361; cv=none; b=jw2xh1dqWpF1YByvl7/sxVODeUCq83m1b1Y6+rWU1cPYiYfPB5G0dnVEIEedlNgxq/fvb1a+q2I/DjSy67l4hkFi40hoWDeEYCWEvcGTXGaMt8D2Ssq7uwpV0ros7FA1h91gq8783Lh3voFTfs/b35N21eDofHOf2plzW8pS1xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710746361; c=relaxed/simple; bh=rq/JWeJfwa+47UTE5z66gjbDrTKJLAljsi84x0YRn1E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f1RyrngXz2ahxef/ek43ygYXkvIR35NDq3oJFGNjB/GoRKop5xoM191RgSbPHlC4GkSZgbeJNxnKqPfQJa2AJODQUGdWEfofAjId6BjNO/+Xaz28Xjhn/naFPkWWy21OXF6sg5QVSoXHzlY+0IK2HDjUu4D7aLDIvK4bVMRYoV4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=EHeZtgPE; arc=none smtp.client-ip=209.85.167.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EHeZtgPE" Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3c1a1e1e539so3436574b6e.1 for ; Mon, 18 Mar 2024 00:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710746359; x=1711351159; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=peDqrf3lDzXyT27A8hkXTSlSS0NQMm0NYY4FTf2ze+I=; b=EHeZtgPEE3EiEuSLPsy3uMr0EVavsgo7zuRtpsiH8kZyEMaXnU7DG7QVOW3Y5TuPum NZGiPP6xAjSU6GFCdyHH17a0CKDoyDeioSyYMfoFET28RzGAaMoaLaayPOH5NyRTsMVm 0mUxKqQL3BuYBrJ9gVmFwCII5HMPDEg5kI7VC1rlPLfFTATif/G9KY5ch/d/tAheR1HQ TfgKov1KM+J+tSrK5nSkxKPj+hLQ7JonqRkoKB3VuqQfrzdAB655qI9F+DFRGyFbKTFw a0vNTqgOVdkj4gnFwe2BxK+zH8J/L14i0+gGgA8VsQU/lhcL3UvH8MxSv5CWfwC7M8ni 4YCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710746359; x=1711351159; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=peDqrf3lDzXyT27A8hkXTSlSS0NQMm0NYY4FTf2ze+I=; b=dYDfW96kvnZYHdRfjxtndQzCd8DRjTkGGrw/S8Loub1UZ3R8B6XohFn0RVydUrCYWt U6NNoAgkKcRL3lAUOqZSGiCy1o4Zosmyqion+UOX0HwWCZLJKwSu1qeDjeB6qDJ6l+sb zlVgpRzBKGmjfkMMpN+fZGfr09V8QRk81eUB4Sr/EtndqR4rjbl3BtTfzB7HClT2XjeS l0jOSt8T54EYCGamzJ287oL4dtdAVm9lle9EeN8UgF2lxI1VZ+zVcQqZnIFQoCY8vncU O9VMXgEdOzmpvHRX3AmaFShyY512qKl7ZiarRXI0r8MrZozKaH21w18/7H4C64GErVxx bhcQ== X-Gm-Message-State: AOJu0YxGpp+MycSE0bho+8zSM1dFo5ZNZyzkKjgJis6gqmwclr+9ck3R eL/4RL38fmsvAXNEOieLZbKHk99p+sbSmZpP6GdFrUohdkcU+RqAVyBgdoFxvw== X-Google-Smtp-Source: AGHT+IHCEXCkkicFHPqzMoJYtv957hUagwd50f9Vz56pVIGqLDE1HWdz5aTIjyYY+wc/RBG4HywTog== X-Received: by 2002:a05:6808:2e4b:b0:3c3:8830:86fe with SMTP id gp11-20020a0568082e4b00b003c3883086femr3449028oib.12.1710746359276; Mon, 18 Mar 2024 00:19:19 -0700 (PDT) Received: from [127.0.1.1] ([103.246.195.160]) by smtp.gmail.com with ESMTPSA id x16-20020aa784d0000000b006e66c9bb00dsm7387515pfn.179.2024.03.18.00.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 00:19:18 -0700 (PDT) From: Manivannan Sadhasivam Date: Mon, 18 Mar 2024 12:49:05 +0530 Subject: [PATCH 3/3] arm64: dts: qcom: sm8650: Fix the msi-map entries Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240318-pci-bdf-sid-fix-v1-3-acca6c5d9cf1@linaro.org> References: <20240318-pci-bdf-sid-fix-v1-0-acca6c5d9cf1@linaro.org> In-Reply-To: <20240318-pci-bdf-sid-fix-v1-0-acca6c5d9cf1@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1806; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=rq/JWeJfwa+47UTE5z66gjbDrTKJLAljsi84x0YRn1E=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBl9+rqpS3tSZyn5nT5m8XnYf433vP7qur3M016c weAuR6t29WJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZffq6gAKCRBVnxHm/pHO 9Sm0CACbPTZu35ob3v4W4ZENolLAtUV5EG/zM1Pxidibyfa06T/ak/gljL32kJjKT/+kwc+ZAxg IXs2VabHIxsQ6rgqmVa2OqMRjU1E8gLzDTpBCmAC/0afS/qdj3fsmIXGpZd9xqp68SzDbthmBLG Zr+jVZDmNWSh7sqtyqT6NDJZlPy5KbyBnZ4RU5lnYq5S4guFnl+FB/NvJyIK0ox2T6z/P14fJxU 4eSgmVm0aZESSDPdHGMUrIL8LUOnC4pZUaBMTtbr8ah1vhRCGln5l+r9xHaWbrbfYVMsq8bepyq 7QImZZoJeVD2853iiC/klWcHXkUNiMiicYZ/y9OkidjzVfez X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 While adding the GIC ITS MSI support, it was found that the msi-map entries needed to be swapped to receive MSIs from the endpoint. But later it was identified that the swapping was needed due to a bug in the Qualcomm PCIe controller driver. And since the bug is now fixed with commit bf79e33cdd89 ("PCI: qcom: Enable BDF to SID translation properly"), let's fix the msi-map entries also to reflect the actual mapping in the hardware. Fixes: a33a532b3b1e ("arm64: dts: qcom: sm8650: Use GIC-ITS for PCIe0 and PCIe1") Signed-off-by: Manivannan Sadhasivam --- arch/arm64/boot/dts/qcom/sm8650.dtsi | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi index ba72d8f38420..eb117866e59f 100644 --- a/arch/arm64/boot/dts/qcom/sm8650.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi @@ -2274,9 +2274,8 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, interrupt-map-mask = <0 0 0 0x7>; #interrupt-cells = <1>; - /* Entries are reversed due to the unusual ITS DeviceID encoding */ - msi-map = <0x0 &gic_its 0x1401 0x1>, - <0x100 &gic_its 0x1400 0x1>; + msi-map = <0x0 &gic_its 0x1400 0x1>, + <0x100 &gic_its 0x1401 0x1>; msi-map-mask = <0xff00>; linux,pci-domain = <0>; @@ -2402,9 +2401,8 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, interrupt-map-mask = <0 0 0 0x7>; #interrupt-cells = <1>; - /* Entries are reversed due to the unusual ITS DeviceID encoding */ - msi-map = <0x0 &gic_its 0x1481 0x1>, - <0x100 &gic_its 0x1480 0x1>; + msi-map = <0x0 &gic_its 0x1480 0x1>, + <0x100 &gic_its 0x1481 0x1>; msi-map-mask = <0xff00>; linux,pci-domain = <1>;